gplately.TopologySeafloorGrid

class gplately.TopologySeafloorGrid(plate_reconstruction, max_time: float | int, min_time: float | int, ridge_time_step: float | int, *, save_directory: str | Path = 'seafloor-grid-output', file_collection: str = '', refinement_levels: int = 6, ridge_sampling: float = 0.5, extent: Tuple = (-180, 180, -90, 90), grid_spacing: float = 0.1, subduction_collision_parameters=(5.0, 10.0), initial_ocean_mean_spreading_rate: float = 75.0, resume_from_checkpoints=False, continent_polygon_features=None, use_continent_contouring=False, continent_mask_filename=None, nprocs=-2)[source]

Bases: SeafloorGrid

A class derived from SeafloorGrid for generating seafloor grids using topologies.

__init__(plate_reconstruction, max_time: float | int, min_time: float | int, ridge_time_step: float | int, *, save_directory: str | Path = 'seafloor-grid-output', file_collection: str = '', refinement_levels: int = 6, ridge_sampling: float = 0.5, extent: Tuple = (-180, 180, -90, 90), grid_spacing: float = 0.1, subduction_collision_parameters=(5.0, 10.0), initial_ocean_mean_spreading_rate: float = 75.0, resume_from_checkpoints=False, continent_polygon_features=None, use_continent_contouring=False, continent_mask_filename=None, nprocs=-2)

Constructor. Create a SeafloorGrid object.

Parameters:
  • plate_reconstruction (PlateReconstruction) –

    A PlateReconstruction object to provide the following essential components for seafloor gridding.

  • max_time (float) – The maximum time for age gridding.

  • min_time (float) – The minimum time for age gridding.

  • ridge_time_step (float) – The delta time for resolving ridges (and thus age gridding).

  • save_directory (str, default=None) – The top-level directory to save all outputs to.

  • file_collection (str, default="") – A string to identify the plate model used (will be automated later).

  • refinement_levels (int, default=6) – Control the number of points in the icosahedral mesh (higher integer means higher resolution of initial ocean basin).

  • ridge_sampling (float, default=0.5) – Spatial resolution (in degrees) at which points that emerge from ridges are tessellated.

  • extent (tuple of 4, default=(-180.,180.,-90.,90.)) – A tuple containing the mininum longitude, maximum longitude, minimum latitude and maximum latitude extents for all masking and final grids.

  • grid_spacing (float, default=0.1) – The degree spacing/interval with which to space grid points across all masking and final grids. If grid_spacing is provided, all grids will use it. If not, grid_spacing defaults to 0.1.

  • subduction_collision_parameters (len-2 tuple of float, default=(5.0, 10.0)) – A 2-tuple of (threshold velocity delta in kms/my, threshold distance to boundary per My in kms/my)

  • initial_ocean_mean_spreading_rate (float, default=75.) – A spreading rate to uniformly allocate to points that define the initial ocean basin. These points will have inaccurate ages, but most of them will be phased out after points with plate-model prescribed ages emerge from ridges and spread to push them towards collision boundaries (where they are deleted).

  • resume_from_checkpoints (bool, default=False) – If set to True, and gridding was interrupted in a previous run, then SeafloorGrids will resume gridding. All other parameters and input data should remain unchanged when resuming (otherwise the results will be indeterminate). If set to False, SeafloorGrids will start gridding from scratch.

  • continent_polygon_features (str/os.PathLike, or a sequence (eg, list or tuple) of instances of pygplates.Feature, or a single instance of pygplates.Feature, or an instance of pygplates.FeatureCollection, or a sequence of any combination of those four types, optional) – Note that this is ignored if continent_mask_filename is specified, otherwise this argument must be specified. These are the continental polygon or COB terrane polygon features to mask the seafloor grids with. Can be provided as a continental polygon filename, or a sequence of continental polygon features, or a single continental polygon feature, or a continental polygon feature collection, or a sequence (eg, a list or tuple) of any combination of those four types.

  • use_continent_contouring (bool, default=False) – Note that this is ignored if continent_mask_filename is specified. If True then builds the continent mask for a given time using ptt’s ‘continent contouring’ method (for more information about ‘Continent Contouring’, visit https://github.com/EarthByte/continent-contouring). If False then builds the continent masks using the continents of continent_polygon_features.

  • continent_mask_filename (str, optional) – An optional parameter pointing to the full path to a continental mask for each timestep. Assuming the time is in the filename, i.e. /path/to/continent_mask_0Ma.nc, it should be passed as /path/to/continent_mask_{}Ma.nc with curly brackets. Include decimal formatting if needed.

  • nprocs (int, default=-2) – The number of CPUs to use for parts of the code that are parallelized. Must be an integer or convertible to an integer (eg, float is rounded towards zero). If positive then uses that many CPUs. If 1 then executes in serial (ie, is not parallelized). If 0 then a ValueError is raised. If -1 then all available CPUs are used. If -2 then all available CPUs except one are used, etc. Defaults to -2 (ie, uses all available CPUs except one to keep system responsive).

Methods

__init__(plate_reconstruction, max_time, ...)

Constructor.

generate([use_topological_model])

Call SeafloorGrid.reconstruct_by_topological_model() or SeafloorGrid.reconstruct_by_topologies() to generate the seafloor grids using topologies.

lat_lon_z_to_netCDF(zval_name[, time_arr, ...])

Produce a netCDF4 grid of a z-value identified by its zval_name for a given time range in time_arr.

reconstruct_by_topological_model()

Use pygplates.TopologicalModel class to reconstruct seed points.

reconstruct_by_topologies()

Obtain all active ocean seed points which are points that have not been consumed at subduction zones or have not collided with continental polygons.

Attributes

SEAFLOOR_AGE_KEY

SPREADING_RATE_KEY

max_time

The maximum time for age gridding.

generate(use_topological_model=True)[source]

Call SeafloorGrid.reconstruct_by_topological_model() or SeafloorGrid.reconstruct_by_topologies() to generate the seafloor grids using topologies.

Parameters:

use_topological_model (bool, optional) –

If True, use the pygplates.TopologicalModel class to reconstruct seed points. If False, use the GPlately Python code to reconstruct. Default is True.