Simulation#
The Simulation class is the main class for the cratermaker project. It is used to create a simulation of a crater on a given target body. The Simulation class is used to generate craters of a given size and morphology based on the production function, morphology function, and crater scaling relationship model. The surface of the target body is represented by a Surface attribute called surface, which contains a UxDataset object called surface.uxds. This is an unstructured grid dataset that contains data for the target body surface.
- class cratermaker.core.simulation.Simulation(*, target=None, scaling=None, production=None, morphology=None, projectile=None, surface=None, counting=None, simdir=None, rng=None, rng_seed=None, rng_state=None, reset=None, ask_overwrite=True, do_counting=True, save_actions='default', **kwargs)[source]#
Bases:
CratermakerBaseCreates a simulation of a crater population on a target body. It allows for the generation of craters based on a variety of parameters, including the target body, scaling laws, production functions, and morphology models.
- Parameters:
target (Target or str, optional, default “Moon”) – Name target body for the simulation, default is “Moon”.
scaling (Scaling or str, optional) – The projectile->crater size scaling model to use from the components library. The default is “montecarlo”.
production (Production or str, optional) – The production function model to use from the components library that defines the production function used to populate the surface with craters. If none provided, then the default will be based on the target body, with the NeukumProduction crater-based scaling law used if the target body is the Moon or Mars, the NeukumProduction projectile-based scaling law if the target body is Mercury, Venus, or Earth, and a simple power law model otherwise.
morphology (str, optional) – The model used to generate the morphology of the crater. If none provided, then the default will “basicmoon”, which is similar to the one used by CTEM.
projectile (str, optional) – The projectile model to use from the components library, which is used to generate the projectile properties for the simulation, such as velocity and density. The default is “asteroids” when target is Mercury, Venus, Earth, Moon, Mars, Ceres, or Vesta, and “comets” otherwise.
surface (str, optional) – The name of the surface used for the surface. Default is “icosphere”.
counting (Counting or str, optional) – The crater counting model to use from the components library. Default is “depthcount”.
simdir (str | Path) – The main project simulation directory. Default is the current working directory if None.
rng (numpy.random.Generator | None) – A numpy random number generator. If None, a new generator is created using the rng_seed if it is provided.
rng_seed (Any type allowed by the rng_seed argument of numpy.random.Generator, optional) – The rng_seed for the RNG. If None, a new RNG is created.
rng_state (dict, optional) – The state of the random number generator. If None, a new state is created.
ask_overwrite (bool, optional) – If True, the user will be prompted before overwriting any existing files. Default is True.
reset (bool, optional) – Flag to indicate whether to reset the simulation or resume from an old simulation. If False, the simulation will attempt to load the previous state from the config file. Default is False if ask_overwrite=False and a config file is detected, otherwise default is True.
do_counting (bool, optional) – If True, the counting component will keep track of observable craters during the simulation. If False, emplaced craters that are large enoug to be observable are saved, but the observability of craters on the surface is not evaluated and observed craters are not tracked. Default is True.
save_actions (list[dict[str, dict]], optional) – A dictionary of actions to perform when the save method is called. The keys are the names of the actions and the values are dictionaries of keyword arguments to pass to the corresponding component’s save method. For example, if you want to automatically generate a hillshade plot every time the simulation is saved, you can pass save_actions=[{“plot”: {“plot_style”: “hillshade”, “cmap”: “pink”, “scalebar”: True, “label”: “Mars region simulation”, “show”: True, “save”: True}}]. This will call the surface’s save method with the specified keyword arguments every time the simulation is saved. Default is to save a hillshade plot of the surface every time the simulation is saved. Set to None to disable or “default” to use the default save actions.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed., including those for component function constructors. Refer to the documentation of each component module for details.
- run(age=None, time_start=None, time_end=None, N_D=None, N_D_end=None, time_interval=None, ninterval=None, **kwargs)[source]#
Run the simulation over a specified interval using the current production function.
- Parameters:
age (FloatLike, optional) – Start age in My relative to the present for the simulation, used to compute the starting point of the production function. Default is None, which requires ‘time_start’ or N_D to be set.
time_start (Floatlike, optional) – An alternative to age that specifies the starting time in My relative to the present for the simulation, used to compute the starting point of the production function. This is used in conjunction with time_end in order to allow for simulations that span a range of time rather than being of a specific age. Default is None, which requires either age or N_D to be set.
time_end (FloatLike, optional) – Ending time in My relative to the present for the simulation, used to compute the ending point of the production function. Default is 0 (present day) if not provided but time_start is provided.
N_D (PairOfFloats, optional) – A pair of numbers, (D, N), representing the starting cumulative number density N above a given diameter D using the N(D) convention. By default, D must be in units of km and N is in number of craters per 10⁶ km². The N value conversion factor can be set using
N_conversion_factor. For example (20, 1000) is intepreted as N(20) = 1000, which is number of craters larger than 20 km per 10⁶ km². If provided, the function will convert this value to a corresponding age and use the production function for a given age. By default None, which requires age or time_start to be set.N_D_end (PairOfFloats, optional) – A pair of numbers, (D, N) representing the ending cumulative number density N above a given diameter D using the N(D) convention. By default, D must be in units of km and N is in number of craters per 10⁶ km². The N value conversion factor can be set using
N_conversion_factor. For example (20, 1000) is intepreted as N(20) = 1000, which is number of craters larger than 20 km per 10⁶ km². If provided, the function will convert this value to a corresponding age and use the production function for a given age. By default None, which will set the ending time to 0 (present day) if N_D is provided.time_interval (FloatLike, optional) – Interval in My for outputting intermediate results. If not provided, calculated as age / ninterval or (time_start - time_end) / ninterval if ninterval is provided, otherwise set to the total simulation duration (e.g. ninterval=1).
ninterval (int, optional) – Number of intervals for outputting results. This has a special use case where one can specify age-based inputs but output are computed in equal cumulative number intervals and vice versa.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
Notes
This function allows defining the simulation parameters either in terms of time or crater frequency (cumulative number). The arguments age, time_start, time_end are mutually exclusive with diameter_number and time_interval is mutually exclusive with ninterval.
The initial state of the simulation (before any craters are emplaced) is always saved automatically. As a result, the total number of saved states will be ninterval + 1, where ninterval is the number of simulation intervals requested.
Examples
# Create a simulation object with default parameters (Moon, NeukumProduction, etc.) sim = cratermaker.Simulation() # Run the simulation for 3.8 billion years, saving the results every 100 million years sim.run(age=3.8e3, time_interval=100.0) # Run the simulation for 3.8 billion years, saving 100 intervals with equal cumulative number intervals sim.run(age=3.8e3, ninterval=100) # Run the simulation to create 80 craters larger than 300 km and output 100 equal cumulative number intervals sim.run(diameter_number=(300e3, 80), ninterval=100) # Run the simulation from 3.8 billion years to 3.0 billion years, saving the results every 100 million years sim.run(time_start=3.8e3, time_end=3.0e3, time_interval=100.0)
- populate(age=None, time_start=None, time_end=None, N_D=None, N_D_end=None, diameter_number=None, diameter_number_end=None, **kwargs)[source]#
Populate the surface with craters over a specified interval using the current production function.
- Parameters:
age (FloatLike, optional) – Age in the past in units of My relative to the present, which is used compute the cumulative SFD.
time_start (FloatLike, optional) – An alternative to age that specifies the starting time in My relative to the present for the simulation, used to compute the starting point of the production function. This is used in conjunction with time_end in order to allow for simulations that span a range of time rather than being of a specific age. Default is None, which requires either age or diameter_number
time_end (FloatLike, optional) – The ending time in My relative to the present for the simulation, used to compute the ending point of the production function. Default is 0 (present day).
N_D (PairOfFloats, optional) – A pair of numbers, (D, N), representing the starting cumulative number density N above a given diameter D using the N(D) convention. By default, D is in units of km and N is in number of craters per 10⁶ km². The N value conversion factor can be set using
N_conversion_factor. For example (20, 1000) is intepreted as N(20) = 1000, which is number of craters larger than 20 km per 10⁶ km². If provided, the function will convert this value to a corresponding age and use the production function for a given age.N_D_end (PairOfFloats, optional) – A pair of numbers, (D, N), representing the ending cumulative number density N above a given diameter D using the N(D) convention. By default, D is in units of km and N is in number of craters per 10⁶ km². The N value conversion factor can be set using
N_conversion_factor. For example (20, 1000) is intepreted as N(20) = 1000, which is number of craters larger than 20 km per 10⁶ km². If provided, the function will convert this value to a corresponding age and use the production function for a given age.diameter_number (PairOfFloats, optional) – A pair of numbers, (diameter, number), representing the diameter and total number of craters larger than that diameter, where diameter is in units of m and n is in number of craters. If provided, the function will convert this value to a corresponding age and use the production function for a given age.
diameter_number_end (PairOfFloats, optional) – A pair of numbers, (diameter, number), representing the diameter and total number of craters in the production function at the end, where diameter is in units of m and n is in number of craters. If provided, the function will convert this value to a corresponding age and use the production function for a given age.
craters (list[Crater] or Crater, optional) – A list of Crater objects to include along with the randomly generated craters. The crater list must include either time or time_min, time_max values.
- Returns:
list[Crater] – A list of the Crater objects that were emplaced. Returns an empty list if no craters were emplaced.
- emplace(craters=None, **kwargs)[source]#
Emplace one or more craters in the simulation.
This method orchestrates the creation and placement of a crater in the simulation. It can create a crater directly or based on the characteristics of a projectile.
- Parameters:
craters (Crater or list of Crater objects, optional) – The Crater object(s) to be emplaced. If provided, this will be used directly. Otherwise, a single crat er will be generated based on the keyword arguments.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
- Returns:
list[Crater] – A list of the Crater objects that were emplaced in the simulation. Returns an empty list if no craters were emplaced.
Notes
The keyword arguments provided are passed down to
Crater.maker(). Refer to its documentation for a detailed description of valid keyword arguments.Examples
from cratermaker import Simulation, Crater sim = Simulation() # Create a crater with specific diameter sim.emplace(diameter=10.0e3) # Create a crater based on a projectile with given mass and projectile_velocity sim.emplace(projectile_mass=1e15, projectile_velocity=20e3) # Create a crater with a specific transient diameter and location sim.emplace(transient_diameter=50e3, location=(43.43, -86.92)) # Create multiple craters craters = [Crater.maker(diameter=20.0e3), Crater.maker(diameter=20.0e3)] sim.emplace(craters)
- save(**kwargs)[source]#
Save the current simulation state to a file.
- Parameters:
**kwargs (Any) – Additional keyword argumments to pass to the component save methods.
- export(driver='OpenCraterTool', interval=-1, ask_overwrite=None, **kwargs)[source]#
Export component output to a specified file format.
- Parameters:
driver (str, optional) – The driver to use export the data to. Supported formats are ‘OpenCraterTool’, ‘VTK’ or a driver supported by GeoPandas (‘GPKG’, ‘ESRI Shapefile’, etc.). This is overridden if either the filename or file_extension parameters are provided. Default is ‘OpenCraterTool’.
interval (int, optional) – The interval number to export. Default is -1 (the most current interval saved in the simulation).
ask_overwrite (bool, optional) – If True, the user will be prompted to confirm before overwriting any existing files. If False, existing files will be overwritten without confirmation. If None, the default behavior of the class will be used. This will only persist for the duration of the export, and will be reset to its original value afterwards.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
Notes
The default driver is ‘OpenCraterTool’, which is designed to output data into a format that is relatively easy to import into QGIS with the OpenCraterTool plugin. This will create a GeoTIFF file representation of the surface, and a set of SCC files for the crater counting data if counting is enabled.
- labelmaker(interval=None, interval_label=False, time_label=False, age_label=True, N_label=False, N_diam_val=None, compact=False, **kwargs)[source]#
Generates a label for the current state of the simulation based on the time variables and other parameters.
- Parameters:
interval (int, optional) – The interval number to use for generating the label. Default is None, which will use the most current interval saved in the simulation.
interval_label (bool, optional) – If True, the interval number will be included in the label. Default is False.
time_label (bool, optional) – If True, the time variable will be included in the label if it is available. Default is True.
age_label (bool, optional) – If True, the elapsed time variable will be included in the label if it is available. Default is False.
N_label (bool, optional) – If True, the elapsed N(D) variable will be included in the label if it is available. Default is False.
N_diam_val (float, optional) – The D value in km to use for the N(D) label. If None, a default value is chosen based on the smallest crater size in the simulation. Default is None.
compact (bool, optional) – If True, the label will be formatted in a more compact way with newlines separating the different components. If False, the components will be separated by three spaces. Default is False.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
- plot(interval=None, plot_style='hillshade', label='default', show=False, save=True, ax=None, close_when_done=True, scalebar=None, colorbar=True, include_counting=False, observed_color='white', observed_original_color=None, emplaced_color=None, minimum_plot_width=800.0, superdomain=False, **kwargs)[source]#
Plot the current state of the surface.
- Parameters:
include_counting (bool, optional) – If True, the counting data will be included in the plot if counting is enabled. Default is False
interval (int, optional) – The interval number to plot. Default is None, which will plot the most current interval saved in the simulation.
plot_style (str, optional) – The style to use for surface plots. See
Surface.plot()for more details. Default is ‘hillshade’.cmap (str, optional) – The colormap to use for the plot. If None, a default colormap will be used (“cividis” by default and “grey” when plot_style==”hillshade” and variable==”face_elevation”).
observed_color (str | None, optional) – The color to use for observed craters using their measured properties. If None, observed craters will not be plotted. Default is “white”.
observed_original_color (str | None, optional) – The color to use for observed craters using their original properties. If None, observed craters will not be plotted. Default is None.
emplaced_color (str | None, optional) – The color to use for emplaced craters in the interval. If None, emplaced craters will not be plotted. Default is None.
label (str, optional) – The label to use for the plot. Default is “default”, which will use the labelmaker method to build a label based on the current time and age of the simulation.
scalebar (bool, optional) – If True, a scalebar will be added to the plot. Default is False for global surfaces.
colorbar (bool, optional) – If True, a colorbar will be added to the plot when using “map” plot_style or “hillshade” with a variable overlay. Default is True.
show (bool, optional) – If True, the plot will be displayed. Default for local surfaces is True.
save (bool, optional) – If True, the plot will be saved to the default plot directory. Default is False.
ax (matplotlib.axes.Axes, optional) – An existing Axes object to plot on. If None, a new figure and axes will be created.
close_when_done (bool, optional) – If True, the figure will be closed after plotting. Default is True when save is True and show is False, and False otherwise.
minimum_plot_width (float, optional) – Because the width of the plot is determined by the number of faces, small regions will generate small plots with labels that are hard to read. This parameter sets a lower limit to the width of the image that is generated by the plot. By default it is 800. Set to None to turn it off.
superdomain (bool, optional) –
HiResLocalSurfacevariants only. If True, the full surface including the superdomain will be plotted. If False, only the local region will be plotted. Default is False**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
- Returns:
Axes – The matplotlib Axes object created by the surface plot method.
- show3d(**kwargs)[source]#
Show the component using an interactive 3D plot.
Valid arguments are those that are passed the engine functions (e.g. arguments to pyvista_plotter(), and plotter.show())
- Parameters:
engine (str, optional) – The engine to use for plotting. Currently, only “pyvista” is supported. Default is “pyvista”.
interval (int, optional) – The interval number to plot. Default is None, which will plot the most current interval saved in the simulation.
label (str, optional) – The label to use for the plot. Default is “default”, which will use a label based on the current time and elapsed time of the simulation. When “default” is used, additional options for
Simulation.labelmaker()can be passed as kwargs.plotter (pv.Plotter, optional) – An existing PyVista Plotter object to use for the plot. If None, a new Plotter object will be created. Default is None.
enable_interactive (bool, optional) – If True, the key events for the plotter will be updated to include custom events for navigating between intervals. Default is True.
variable_name (str | None, optional) – The name of the variable to plot. If the name of the variable is not already stored on the surface mesh, then the variable argument must also be passed. Default is None, which will plot a greyscale image of the surface.
variable ((n_face) array, optional) – An array face values that will be used to color the surface mesh. This is required if variable_name is not a face variable that is already saved in the the uxds dataset. Default is None.
interval (int | None, optional) – The interval number of the surface to plot. If None, the currently loaded surface data will be used. Default is None.
theme (str, optional) – The PyVista plot theme to use. If None, the default PyVista theme will be used. Default is None.
transparent_background (bool, optional) – If True, the background of the plot will be transparent. Default is None, which will use the default background setting for the chosen plot theme.
superdomain (bool, optional) – If True, show the full surface including the superdomain (
HiResLocalSurfacevariants only). If False, show only the local region. Default is False.crater_type (Literal[“observed”,”emplaced”,”both”] | list[Crater].) – This is only used if enable_interactive is False, in which case it controls which crater data will be plotted. Default is “both”.
crater_color (str | tuple[str] = (“white”, “yellow”)) – The color to use for the plots. When used with enable_interactive or when craters is set to “both”, this is a tuple where the first element is the color of observed craters and the second is the color of emplaced craters. Default is (“white,”red”).
crater_style (Literal[“rings”, “points”], optional) – Only used when enable_interactive is False. Sets the style of the mesh. Options are “rings”, which creates polyline circles over the rim of each crater or “points” which creates a point at the center.
crater_size_scale_factor (FloatLike, optional) – A factor to scale the size of the craters in “point”, “impacts”, or “spheres” styles. Default is 1.0.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
- pyvista_plotter(interval=None, label='default', plotter=None, enable_interactive=True, **kwargs)[source]#
Create a PyVista plotter for the current state of the surface.
- Parameters:
interval (int, optional) – The interval number to plot. Default is None, which will plot the most current interval saved in the simulation.
label (str, optional) – The label to use for the plot. Default is “default”, which will use a label based on the current time and elapsed time of the simulation. When “default” is used, additional options for
Simulation.labelmaker()can be passed as kwargs.plotter (pv.Plotter, optional) – An existing PyVista Plotter object to use for the plot. If None, a new Plotter object will be created. Default is None.
enable_interactive (bool, optional) – If True, the key events for the plotter will be updated to include custom events for navigating between intervals. Default is True.
variable_name (str | None, optional) – The name of the variable to plot. If the name of the variable is not already stored on the surface mesh, then the variable argument must also be passed. Default is None, which will plot a greyscale image of the surface.
variable ((n_face) array, optional) – An array face values that will be used to color the surface mesh. This is required if variable_name is not a face variable that is already saved in the the uxds dataset. Default is None.
interval (int | None, optional) – The interval number of the surface to plot. If None, the currently loaded surface data will be used. Default is None.
theme (str, optional) – The PyVista plot theme to use. If None, the default PyVista theme will be used. Default is None.
transparent_background (bool, optional) – If True, the background of the plot will be transparent. Default is None, which will use the default background setting for the chosen plot theme.
superdomain (bool, optional) – If True, show the full surface including the superdomain (
HiResLocalSurfacevariants only). If False, show only the local region. Default is False.crater_type (Literal[“observed”,”emplaced”,”both”] | list[Crater].) – This is only used if enable_interactive is False, in which case it controls which crater data will be plotted. Default is “both”.
crater_color (str | tuple[str] = (“white”, “yellow”)) – The color to use for the plots. When used with enable_interactive or when craters is set to “both”, this is a tuple where the first element is the color of observed craters and the second is the color of emplaced craters. Default is (“white,”red”).
crater_style (Literal[“rings”, “points”], optional) – Only used when enable_interactive is False. Sets the style of the mesh. Options are “rings”, which creates polyline circles over the rim of each crater or “points” which creates a point at the center.
crater_size_scale_factor (FloatLike, optional) – A factor to scale the size of the craters in “point”, “impacts”, or “spheres” styles. Default is 1.0.
- Returns:
pyvista.Plotter – A PyVista Plotter object created by the surface pyvista_plotter method.
- to_config(save_to_file=True, **kwargs)[source]#
Converts values to types that can be used in yaml.safe_dump.
This will convert various types into a format that can be saved in a human-readable YAML file. This will consolidate all of the configuration parameters into a single dictionary that can be saved to a YAML file. This will also remove any common arguments from the individual configurations for each component model to avoid repeating them.
- Parameters:
save_to_file (bool, optional) – If True, the configuration will be saved to a file. Default is True.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
- Returns:
dict[str, Any] – A dictionary of the object’s attributes that can be serialized to YAML.
Notes
The function will ignore any attributes that are not serializable to human-readable YAML. Therefore, it will ignore anything that cannot be converted into a str, int, float, or bool.
The function will convert Numpy types to their native Python types.
- reset(skip_component=None)[source]#
Reset the simulation by clearing all data and files associated with it.
- Parameters:
skip_component (str or list of str, optional) – List of component names to skip during the reset process. Default is an empty list, which means all components will be reset.
- update_elevation(*args, **kwargs)[source]#
Set the elevation on the surface. Delegates to the Surface object.
- Parameters:
*args (Variable length argument list to pass to self.surface.update_elevation.)
|kwargs|
- property max_crater_diameter_range#
- property target#
The target body for the impact simulation. Set during initialization.
- property surface#
Surface mesh data for the simulation. Set during initialization.
- property production#
The Production class instance used for crater production. Set during initialization.
- property scaling#
The Scaling object that defines the crater scaling relationships model. Set during initialization.
- property morphology#
The crater morphology model. Set during initialization.
- property projectile#
The crater projectile model. Set during initialization.
- property counting#
The crater counting model. Set during initialization.
- property n_node#
Number of nodes in the simulation mesh. Dynamically set based on surface attribute.
- property n_face#
Number of faces in the simulation mesh. Dynamically set based on surface attribute.
- property interval#
The index of the current time step.
- property elapsed_time#
The elapsed time in My since the start of the simulation.
- property time#
The age of the current time step in My relative to the present from the chronology of the production function.
- property elapsed_n1#
The elapsed number of craters larger than 1 km in diameter.
- property smallest_crater#
The smallest crater diameter in meters. Set during initialization.
- property largest_crater#
The largest crater diameter in meters. Set during initialization.
- property smallest_projectile#
The smallest projectile diameter in meters. Set during initialization.
- property largest_projectile#
The largest projectile diameter in meters. Set during initialization.
- property name#
The name of the simulation.
- property config_file#
The path to the configuration file for the simulation.
- property config_readonly#
Flag indicating whether the configuration is read-only.
- property time_variables#
A dictionary of time-related variables for the simulation.
- Returns:
dict[str, float] – A dictionary containing the following keys: - “time”: The current age in My relative to the present. - “elapsed_time”: The elapsed time in My since the start of the simulation. - “elapsed_n1”: The elapsed number of craters larger than 1 km in diameter.
- property do_counting#
A boolean flag indicating whether or not counting is enabled for the simulation. This is determined by whether or not a counting model is present and has counting enabled.
- Returns:
bool – True if counting is enabled, False otherwise.
- property observed#
Pass-through to retrieve the current observed craters from the counting model, if it is enabled.
- property emplaced#
Pass-through to retrieve the current emplaced craters from the morphology model.
- property n_observed#
Pass-through to retrieve the current number of observed craters from the counting model, if it is enabled.
- property n_emplaced#
Pass-through to retrieve the current number of emplaced craters from the counting model.
- output_filename(interval=None, **kwargs)[source]#
Generate the base output filename for a given interval, but does not include the output directory.
- Parameters:
interval (int or None, optional) – The interval number to generate the filename for. If None, the filename will not include an interval number. Default is None.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
- Returns:
str – The generated output filename for the given interval.
- property is_new#
A boolean flag indicating that this is a new simulation run, which will trigger a reset action when run is called.
- property Crater#
The Crater class used for crater generation in the simulation. Set during initialization.
This is a property that returns
Craterif a morphology model is present, or the baseCraterclass if no morphology model is present.
- property do_quasimc#
A boolean flag indicating whether or not quasi-Monte Carlo sampling is being used for crater generation in the simulation. This is determined by whether or not the production function is using quasi-Monte Carlo sampling.
- Returns:
bool – True if quasi-Monte Carlo sampling is being used, False otherwise.
- property quasimc_craters#
List of craters to be emplaced using quasi-Monte Carlo.
When assigned a list of Crater objects with production metadata (production_time, production_ND, and/or production_sequence), they will be processed to set their
timevalue. Any craters without production metadata will be dropped. When accessed, if any of the craters have a None value for time, they will be reprocessed to set their time value. This allows for the quasimc_craters to be dynamically updated.This is a wrapper for
quasimc_craters.
- property quasimc_file#
File containing the quasi-Monte Carlo craters.
This is a wrapper for
quasimc_file.
- quasimc_merge(craters, time_start=None, time_end=None, N_D=None, N_D_end=None, **kwargs)[source]#
Merge a randomly-generated list of craters with the quasi-Monte Carlo craters over a given time interval.
It will extract any craters from
quasimc_cratersthat have time values that overlap those of the arguments. Then it will successively check the to see if any in the “craters” list are larger than the largest in- Parameters:
craters (list[Crater]) – The list of Crater objects to merge with the quasi-Monte Carlo craters.
time_start (float, optional) – The starting time in units of My relative to the present in which to extract the quasi-Monte Carlo craters.
time_end (float, optional) – The ending time in units of My relative to the present in which to extract the quasi-Monte Carlo craters.
N_D (PairOfFloats, optional) – A pair of D, N values that represent the N(D) format for the cumulative number density at the start of the sample, which is used to extract the quasi-Monte Carlo craters. The units given by
N_D_unitsand can be adjusted by settingD_conversion_factorandN_conversion_factor.N_D_end (PairOfFloats, optional) – A pair of D, N values that represent the N(D) format for the cumulative number density at the end of the sample, which is used to extract the quasi-Monte Carlo craters. The units given by
N_D_unitsand can be adjusted by settingD_conversion_factorandN_conversion_factor.**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
- Returns:
list[Crater] – The merged list of Crater objects, sorted in order of decreasing age.
Notes
This is a wrapper for
production.quasimc_merge()
- property face_variables#
Returns a list of the data variables currently being stored on the faces.
- property save_actions#
A dictionary where the keys are the names of actions that can be performed on this component (e.g. “plot”) when calling the save function and the values are the arguments that should be passed to that action when it is called by the save function.