gdtchron

GDTchron - Geodynamic Thermochronology

gdtchron.add_comp_field(mesh, fields=None)[source]

Assign compositional field as a single scalar from multiple scalars.

Compositional fields in VTK files are often defined using multiple scalars, where data is assigned a value from 0 to 1 for each compositional field. Thus, to plot data by compositional field requires using these scalars to create a new scalar using a different integer to represent each compositional field. This function creates a new scalar (‘comp_field’) consisting of an integer corresponding to the scalar where the data point has a value greater than 0.5. If no scalar meets this criteria, the data point is assigned the null value of 0.

For example, the default behavior is to use three scalars for upper crust, lower crust, and mantle lithosphere. Each data point in the mesh will have a value of 0 to 1 for each of these scalars, and if any of those values are greater than 0.5, the compositional field will be assigned to the corresponding integer (1: upper crust; 2: lower crust; 3: mantle lithosphere). If none are greater than 0.5, the compositional field will be the null value (0), representing the asthenosphere.

Parameters:
  • mesh (Pyvista mesh object) – A pyvista mesh object that contains geometrical representations of surface or volume data. The mesh may also have attributes, such as data values assigned to points, cells, or fields assigning various information to the mesh.

  • fields (str or list of str) – Names of compositional fields that are scalars in the mesh. If None, defaults to [‘crust_upper’,’crust_lower’,’mantle_lithosphere’] (default: None).

Returns:

mesh – Original input mesh with ‘comp_field’ added as a scalar.

Return type:

Pyvista mesh object

gdtchron.plot_vtk_2d(mesh, field, bounds=None, ax=None, colorbar=False, vertical_exaggeration=None, **kwargs)[source]

Plot 2D mesh using Pyvista on a Matplotlib axes.

Parameters:
  • mesh (Pyvista mesh object) – A pyvista mesh object that contains geometrical representations of surface or volume data. The mesh may also have attributes, such as data values assigned to points, cells, or fields assigning various information to the mesh.

  • field (str) – The name of the field contained within the Pyvista mesh object to plot.

  • bounds (list of floats or integers) – A list of four values that define the bounds by which to clip the plot. Successively, the list of values define the minimum x, maximum x, minimum y, and maximum y bounds (default: None).

  • ax (Matplotlib axes object) – Matplotlib axis on which to plot the mesh (default: None).

  • colorbar (bool) – Boolean (True or False) for whether to include colorbar (default: False).

  • vertical_exaggeration (float or integer) – Factor by which to vertically exaggerate the resulting plot (default: None).

  • **kwargs (dict) – Additional keyword arguments to pass to the Pyvista plotter.

Returns:

ax – Modified matplotlib axes object with the plotted mesh

Return type:

Matplotlib axes object

gdtchron.run_tt_paths(temp_paths, tsteps, system, u=100, th=100, radius=50, dpar=1.75, annealing_model='Ketcham99', batch_size=100, processes=None, **kwargs)[source]

Run forward model of a given isotopic system across multiple t-T paths.

Parameters:
  • temp_paths (list of NumPy arrays of floats) – List of NumPy arrays of floats containing the temperatures (K) at each timestep in tsteps. Each array corresponds to a different grain to obtain a thermochronometric age for.

  • tsteps (Numpy array of floats) – Array of times (Ma) in chronological (descending) order. First time is start of first timestep, last time is end of last timestep. Each pair of adjacent times composes a timestep. The time at a given index i corresponds to the temperatures at index i of each of the NumPy arrays in temp_paths.

  • system (str) – Isotopic system to model. Current options include ‘AHe’: Apatite (U-Th)/He, ‘ZHe’: Zircon (U-Th)/He, ‘AFT’: Apatite Fission Track

  • u (float, optional) – U concentration (ppm) (default: 100). Only used if system is ‘AHe’ or ‘ZHe’.

  • th (float, optional) – Th concentration (ppm) (default: 100). Only used if system is ‘AHe’ or ‘ZHe’.

  • radius (float, optional) – Radius of the grain (micrometers) (default: 50). Only used if system is ‘AHe’ or ‘ZHe’.

  • dpar (float, optional) – Etch figure length (micrometers) (default: 1.75). Only used if system is ‘AFT’.

  • annealing_model (str, optional) – Annealing model to use. Currently, the only acceptable value is ‘Ketcham99’, which corresponds to the fanning curvilinear model from Ketcham et al. (1999) (default: ‘Ketcham99’). Only used if system is ‘AFT’.

  • batch_size (int or 'auto', optional) – Number of jobs to be dispatched to each worker at a time during parallel computation (default: 100). If set to ‘auto’, this value is dynamically adjusted during computations to try to optimize efficiency. However, on most test systems, better efficiency is gained by manually setting batch size to 100 or 1000 than using ‘auto’.

  • processes (int or None, optional) – Maximum number of processes that can run concurrently. If None, this parameter is internally set to two less than the number of CPUs on the user’s system (default: None).

  • **kwargs (optional) – Additional arguments to pass to the forward model function of the corresponding isotopic system

Returns:

ages – Thermochronometric ages for the given isotopic system for grains that experienced each of the provided time series. All (U-Th)/He ages returned are corrected ages.

Return type:

list of floats

gdtchron.run_vtk(files, system, time_interval, u=100, th=100, radius=50, num_nodes=513, dpar=1.75, annealing_model='Ketcham99', file_prefix='meshes_tchron', path='./', temp_dir='~/dump', batch_size=100, processes=None, interpolate_vals=True, all_timesteps=True, overwrite=False)[source]

Perform parallel He or FT forward modeling of ASPECT VTK data.

This code performs forward modeling of the AHe, ZHe, or AFT systems across ASPECT VTK data. Data is output as .vtu folders in a new directory, with data for every timestep given.

Parameters:
  • files (list of str) – List of paths to VTK files to run forward model on. Files are processed in the order they are given in the list.

  • system (str) – Isotopic system to model. Current options include ‘AHe’: Apatite (U-Th)/He, ‘ZHe’: Zircon (U-Th)/He, ‘AFT’: Apatite Fission Track

  • time_interval (float) – Interval (Myrs) between times when each mesh was produced

  • u (float, optional) – U concentration (ppm) (default: 100). Only used if system is ‘AHe’ or ‘ZHe’.

  • th (float, optional) – Th concentration (ppm) (default: 100). Only used if system is ‘AHe’ or ‘ZHe’.

  • num_nodes (int) – Number of nodes within the grain (for He) (default: 513). Unused for FT system.

  • radius (float, optional) – Radius of the grain (micrometers) (default: 50). Only used if system is ‘AHe’ or ‘ZHe’.

  • dpar (float, optional) – Etch figure length (micrometers) (default: 1.75). Only used if system is ‘AFT’.

  • annealing_model (str, optional) – Annealing model to use. Currently, the only acceptable value is ‘Ketcham99’, which corresponds to the fanning curvilinear model from Ketcham et al. (1999) (default: ‘Ketcham99’). Only used if system is ‘AFT’.

  • file_prefix (str) – Prefix to give output files (default: ‘meshes_tchron’)

  • path (str) – Path to output directory (default: ‘./’)

  • temp_dir (str) – Path to output directory used to temporarily dump data that does not fit in memory.

  • batch_size (int or 'auto', optional) – Number of jobs to be dispatched to each worker at a time during parallel computation (default: 100). If set to ‘auto’, this value is dynamically adjusted during computations to try to optimize efficiency. However, on most test systems, better efficiency is gained by manually setting batch size to 100 or 1000 than using ‘auto’.

  • processes (int or None, optional) – Maximum number of processes that can run concurrently. If None, this parameter is internally set to two less than the number of CPUs on the user’s system (default: None).

  • interpolate_vals (bool) – Boolean indicating whether to interpolate particle data from nearest neighbor if the particle itself lacks He or FT data. If False and the particle is missing data, an age of np.nan is returned for that particle. (default: True)

  • all_timesteps (bool) – Boolean indicating whether to calculate ages at each tstep (default: True)

  • overwrite (bool) – Boolean indicating whether to overwrite old meshes that already have thermochronometric data for this system for a given timestep. If False, this function skips timesteps that already have data for this system and uses that data and uses for calculations in subsequent meshes. (default: False)

Modules

aft

Module for forward modeling of the apatite fission track system.

he

Module for forward modeling of (U-Th)/He ages.