crater_type (str, optional) – The type of craters to export. Options are “observed”, “emplaced”, and “both”. Default is “observed”.
interval (int | None, optional) – The interval number to export. If None, all intervals currently saved will be exported. Default is None.
driver (str, default=’SCC’) – The export driver used to save. The valid drivers are given by the valid_drivers attribute of this object.
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.
interval (int | None, optional) – The interval number to load the emplaced crater data from. if None, then all emplaced data currently saved to file is used. Default is None.
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. If None, emplaced craters will not be plotted. Default is None.
plot_style (str, optional) – The style of the plot. Options are “map” and “hillshade”. In “map” mode, the variable is displayed as a colored map. In “hillshade” mode, a hillshade image is generated using “face_elevation” data. If a different variable is passed to variable, then the hillshade will be overlayed with that variable’s data. Default is “map”.
variable_name (str | None, optional) – The variable to plot. If None is provided then “face_elevation” is used in “map” mode.
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”).
label (str | None, optional) – A label for the plot. If None, no label will be added.
scalebar (bool, optional) – If True, a scalebar will be added to the plot. Default is True.
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 is True.
save (bool, optional) – If True, the plot will be saved to the default plot directory. Default is True
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.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
Returns:
matplotlib.image.Axes object created by the surface plot method, with crater counts plotted on top if specified. If show is True, the plot will also be displayed. – The Axes object
Passes through to the surface pyvista_plotter method and adds crater counts to it.
When enable_interactive is True (the default), this will add all saved crater data (observed and emplaced) with all plot styles (rings, points, and impacts) and allow them to be activated by key presses. If False, this will only plot one set of data with one style.
Parameters:
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”.
interval (int, optional) – The interval number to load the emplaced crater data from. if None, then all emplaced data currently saved to file is used. Default is None.
enable_interactive (bool, optional) – If True, enables key events to toggle the visibility of all saved crater count types (observed and emplaced) with all styles (rings, points, and impacts), which are activated by keypresses (“c” for observed craters, and “t” for emplaced craters), and all are not visible on initialization. If False, only one set of data is plotted, and is visible on initialization.
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.
surface (Surface | LocalSurface, optional) – The surface or local surface view to be displayed. If None, uses the associated surface property
plotter (pyvista.Plotter, optional) – An existing pyvista Plotter to add the crater counts to. If None, a new Plotter will be created by the surface pyvista_plotter method. Default is None.
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.
Returns:
plotter (pyvista.Plotter) – The pyvista plotter with the crater counts added.
Export the crater data to a vector file and stores it in the default export directory.
Parameters:
crater_type (Literal[“observed”, “emplaced”], optional) – The name of the crater dataset to export, either “observed” or “emplaced
crater_ds (xr.Dataset | list[Crater] | dict[int, Crater] | None, optional) – The crater data to export. Can be provided as an xarray Dataset, a list of Crater objects, or a dictionary mapping interval numbers to Crater objects. If None, the crater data will be the attribute of the class corresponding to the name parameter (self.observed or self.emplaced). Default is None.
interval (int | None, optional) – The interval number to export. If None, all intervals currently saved will be exported. Default is None.
driver (str, optional) – The file format to save. Supported formats are ‘GPKG’, ‘ESRI Shapefile’, etc. Default is ‘GPKG’.
use_measured_properties (bool, optional) – If True, use the current measured crater properties (semimajor_axis, semiminor_axis, location, orientation) instead of the initial ones, by default True.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
crater_type (Literal[“observed”, “emplaced”], optional) – The name of the crater dataset to convert, either “observed” or “emplaced. If None is provided, then a list of Crater objects must be provided directly to the craters parameter. Default is None.
interval (int | None, optional) – The interval number to load if craters is not provided directly. If None, then the most recent interval will be used. Default is None.
craters (list[Crater], optional) – A list of Crater objects to convert. If None is provided, then the crater dataset will be determined by the name parameter. Default is None.
use_measured_properties (bool, optional) – If True, use the current measured crater properties (semimajor_axis, semiminor_axis, location, orientation) instead of the initial ones, by default True.
crater_style (Literal[“rings”, “points”, “impacts”, “spheres”], optional) – Sets the style of the mesh. Options are “rings”, which creates polyline circles over the rim of each crater, “points” which creates a small sphere at the center of each crater, and “impacts” which places a point above the floor of the center of the crater and “spheres” which creates spheres with radius equal to the projectile radius at the location of each crater. Default is “rings”.
crater_size_scale_factor (FloatLike, optional) – A factor to scale the size of the craters in “point”, “impacts”, or “spheres” styles, which places the center point of the actor above the surface by its radius. Default is 1.0.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
Returns:
vtkPolyData – A VTK PolyData object representing the crater geometries.
Export the crater data to a VTK file and stores it in the default export directory.
Notes: In order for the crater and surface to be synced up when saving to VTK/VTP format, the initial conditions (no craters) must be saved. Otherwise, saving to file only occurs if there are craters to save.
Parameters:
crater_type (Literal[“observed”, “emplaced”], optional) – The name of the crater dataset to convert, either “observed” or “emplaced. If None is provided, then a list of Crater objects must be provided directly to the craters parameter. Default is None.
interval (int | None, optional) – The interval number to export. If None, all intervals currently saved will be exported. Default is None.
craters (list[Crater], optional) – A list of Crater objects to convert. If None is provided, then the crater dataset will be determined by the crater_type parameter. Default is None.
use_measured_properties (bool, optional) – If True, use the current measured crater properties (semimajor_axis, semiminor_axis, location, orientation) instead of the initial ones, by default True.
crater_style (Literal[“rings”, “points”, “impacts”, “spheres”], optional) – Sets the style of the mesh. Options are “rings”, which creates polyline circles over the rim of each crater, “points” which creates a small sphere at the center of each crater, and “impacts” which places a point above the floor of the center of the crater and “spheres” which creates spheres with radius equal to the projectile radius at the location of each crater. Default is “rings”.
crater_size_scale_factor (FloatLike, optional) – A factor to scale the size of the craters in “point”, “impacts”, or “spheres” styles, which places the center point of the actor above the surface by its radius. Default is 1.0.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
Export the crater data to a CSV file and stores it in the default export directory.
Parameters:
crater_type (Literal[“observed”, “emplaced”], optional) – The type of the crater dataset to export, either “observed” or “emplaced
crater_ds (xr.Dataset | list[Crater] | dict[int, Crater] | None, optional) – The crater data to export. Can be provided as an xarray Dataset, a list of Crater objects, or a dictionary mapping interval numbers to Crater objects. If None, the crater data will be the attribute of the class corresponding to the crater_type parameter (self.observed or self.emplaced). Default is None.
interval (int | None, optional) – The interval number to export. If None, all intervals currently saved will be exported. Default is None.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
Export the crater data to Craterstats and OpenCraterTools-compatible SCC file and stores it in the default export directory.
Parameters:
crater_type (Literal[“observed”, “emplaced”], optional) – The type of the crater dataset to export, either “observed” or “emplaced
craters (xr.Dataset | list[Crater] | dict[int, Crater] | None, optional) – The crater data to export. Can be provided as an xarray Dataset, a list of Crater objects, or a dictionary mapping interval numbers to Crater objects. If None, the crater data will be the attribute of the class corresponding to the crater_type parameter (self.observed or self.emplaced). Default is None.
interval (int | None, optional) – The interval number to export. If None, all intervals currently saved will be exported. Default is None.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
Remove complex data from all observed and emplaced craters to free up memory. This is typically called after the tally step to clear out things like the affect node and face index sets.
The morphology component associated with this counting component, which determines the Crater class and the crater properties that are tracked in the simulation.
Note
The Morphology component requires a Countinng component, so this property is set by the Morphology component on initialization, rather than by the Counting component itself.
Measure the degradation state of a crater by using a variation of the depth-to-diameter proxy for degradation state from Minton et al. (2019) [2] and Riedel et al. (2020) [3].
Parameters:
crater (Crater) – The crater to measure.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
Returns:
float – The estimated degradation state of the crater in m². The crater object will also have its degradation state value updated in place
References
Notes
The technique used here is a major improvement over the one used previously in CTEM. Rather than using the depth-to-diameter directly, it instead uses the ratio of the measured depth-to-diameter to the initial computed depth-to-diameter of the crater. Fitting functions for both simple and complex craters were developed using this metric.