pybacktrack.write_paleo_bathymetry_grids
- pybacktrack.write_paleo_bathymetry_grids(paleo_bathymetry, grid_spacing_degrees, output_file_prefix, *, output_xyz=False, output_file_decimal_places_in_time=1, output_positive_bathymetry_below_sea_level=False, merge_paleo_bathymetry_filename_format=None, merge_paleo_bathymetry_file_decimal_places_in_time=0, merge_paleo_bathymetry_is_positive_below_sea_level=False, interpolate_dynamic_topography_model=None, use_all_cpus=False)
Grid paleo bathymetry into a NetCDF grid for each time step.
- Parameters:
paleo_bathymetry (dict) – A dict mapping each reconstructed time to a list of 3-tuple (longitude, latitude, bathymetry) The reconstructed paleo bathymetry points over a sequence of reconstructed times. Each key in the returned dict is one of those times and each value in the dict is a list of reconstructed paleo bathymetries represented as a 3-tuple containing reconstructed longitude, reconstructed latitude and paleo bathmetry.
grid_spacing_degrees (float) – Lat/lon grid spacing (in degrees). Ideally this should match the spacing of the input points used to generate the paleo bathymetries.
output_file_prefix (string) – The prefix of the output paleo bathymetry grid filenames where each filename is generated from a time by appending
_<time>.ncto the output file prefix. This is the default method of generating filenames. Alternatively,output_file_prefixcan be a template string (see Template strings) containing the${time}identifier (eg,paleo_bathymetry_${time}.nc). If this identifier is detected, then each filename is generated by replacing all occurrences of the time identifier with the time. For both methods of generating filenames, time is formatted tooutput_file_decimal_places_in_timedecimal places.output_xyz (bool, optional) – Whether to also create a GMT xyz file (with “.xyz” extension) for each output paleo bathymetry grid. Each row of each xyz file contains “longitude latitude bathymetry”. Default is to only create grid files (no xyz).
output_file_decimal_places_in_time (int, default=1) – Number of decimal places to format each time into its paleobathymetry filename. Defaults to 1 decimal place.
output_positive_bathymetry_below_sea_level (bool, optional) – Whether to output positive bathymetry values below sea level (the same as backtracked water depths at a drill site). However topography/bathymetry grids typically have negative values below sea level (and positive above). So the default (
False) matches typical topography/bathymetry grids (ie, outputs negative bathymetry values below sea level).merge_paleo_bathymetry_filename_format (str, optional) –
Optional external paleobathymetry grids to merge into the reconstructed, backtracked paleobathymetry in
paleo_bathymetry. This is useful for filling in regions of sediment-covered crust that have subducted before present day. Backtracked paleobathymetry is only generated for crust that exists at present day (and it is given preference when merging). Regions not covered by backtracked paleobathymetry are then filled with external paleobathymetry after adding dynamic topography (if specified) to them. If specified then must contain the${time}identifier that will be used to generate a filename for each time (see Template strings). For example,external_paleobathymetry/bathymetry_${time}Ma.ncwill result in${time}being replaced by each time accurate to the number of decimal places specified withmerge_paleo_bathymetry_file_decimal_places_in_time(which defaults to zero). If not specified then no merging will occur.merge_paleo_bathymetry_file_decimal_places_in_time (int, default=0) – Number of decimal places to format each time into its merged paleobathymetry input filename. This argument is only used if
merge_paleo_bathymetry_filename_formatis specified. Defaults to 0 decimal places.merge_paleo_bathymetry_is_positive_below_sea_level (bool, optional) – Whether the external bathymetry values below sea level are positive. However topography/bathymetry grids typically have negative values below sea level (and positive above). So the default (
False) matches typical topography/bathymetry grids (ie, outputs negative bathymetry values below sea level). This argument is only used ifmerge_paleo_bathymetry_filename_formatis specified.interpolate_dynamic_topography_model (string, optional) – Optional dynamic topography model to add to external paleobathymetry grids. This is only used if
merge_paleo_bathymetry_filename_formatis specified. If specified then it should match the dynamic topography used to generatepaleo_bathymetry. Represents a time-dependent dynamic topography raster grid (in mantle frame). This is either the name of a bundled dynamic topography model (seepybacktrack.InterpolateDynamicTopography.create_from_bundled_model()), or a user-provided model specified as the filename of the grid list file (see parameter ofpybacktrack.InterpolateDynamicTopography.__init__()).use_all_cpus (bool or int, optional) – If
False(or zero) then use a single CPU. IfTruethen distribute CPU processing across all CPUs (cores). If a positive integer then use that many CPUs (cores). Defaults toFalse(single CPU).
Notes
Added in version 1.4.
Changed in version 1.5: The following changes were made:
output_file_prefixcan alternatively be a template string.Added optional
output_file_decimal_places_in_timeargument.Added optional
merge_paleo_bathymetry_filename_format,merge_paleo_bathymetry_file_decimal_places_in_timeandmerge_paleo_bathymetry_is_positive_below_sea_levelarguments.Some arguments (after
*) are now keyword-only (ie, can no longer be specified as positional arguments).