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:
SeafloorGridA class derived from
SeafloorGridfor 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
SeafloorGridobject.- Parameters:
plate_reconstruction (PlateReconstruction) –
A
PlateReconstructionobject to provide the following essential components for seafloor gridding.PlateReconstruction.topology_featues
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_spacingis provided, all grids will use it. If not,grid_spacingdefaults 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 toFalse, 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_filenameis 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_filenameis specified. IfTruethen 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). IfFalsethen builds the continent masks using the continents ofcontinent_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.ncwith 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
1then executes in serial (ie, is not parallelized). If0then aValueErroris raised. If-1then all available CPUs are used. If-2then 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()orSeafloorGrid.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_namefor a given time range intime_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_KEYSPREADING_RATE_KEYmax_timeThe maximum time for age gridding.
- generate(use_topological_model=True)[source]
Call
SeafloorGrid.reconstruct_by_topological_model()orSeafloorGrid.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.