The Morphology class is an operations class for computing the morphology of a crater based on its size and target properties. It encapsulates the logic for altering the topography of the surface based on the crater properties.
Initialize a Morphology model with the given name or instance.
Parameters:
morphology (str or Morphology or None) – The name of the morphology model to use, or an instance of Morphology. If None, the default “basicmoon” is used.
surface (str or Surface, optional) – The name of a Surface object, or an instance of Surface, to be associated the morphology model.
production (str or Production, optional) – The name of a Production object, or an instance of Production, to be associated with the morphology model. This is used for subpixel degradation in the emplace method. It is otherwise ignored.
counting (str or Counting, optional) – The name of a Counting object, or an instance of Counting, to be associated with the morphology model. This is used to record crater counts during emplacement. If None, no counting will be performed.
scaling (str or Scaling or None, optional) – The projectile->crater size scaling model to use from the components library. The default is “montecarlo”.
do_subpixel_degradation (bool, optional) – If True, subpixel degradation will be performed during the emplacement of craters. Default is True.
do_slope_collapse (bool, optional) – If True, slope collapse will be performed during the emplacement of craters. Default is True.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
Returns:
Morphology – An instance of the specified Morphology model (e.g. BasicMoonMorphology).
Raises:
KeyError – If the specified morphology model name is not found in the registry.
TypeError – If the specified morphology model is not a string or a subclass of Morphology.
Convenience method to immediately emplace a crater onto the surface.
Initializes and uses the queue system behind the scenes.
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 crater 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 of Crater or None – The crater(s) that were emplaced. If no craters were provided and a crater could not be generated based on the keyword arguments, an empty list is returned.
Notes
The keyword arguments provided are passed down to Crater.maker(). Refer to its documentation for a detailed description of valid keyword arguments.
Examples
fromcratermakerimportMorphology,Cratermorphology=Morphology.maker()# Create a crater with specific diametermorphology.emplace(diameter=10.0e3)# Create a crater based on a projectile with given mass and projectile_velocitymorphology.emplace(projectile_mass=1e15,projectile_velocity=20e3)# Create a crater with a specific transient diameter and locationmorphology.emplace(transient_diameter=50e3,location=(43.43,-86.92))# Create multiple craterscraters=[Crater.maker(diameter=20.0e3),Crater.maker(diameter=20.0e3)]morphology.emplace(craters)
A manager for craters awaiting emplacement. Craters are processed in order (FIFO) but batches of non-overlapping craters can be processed simultaneously.
Parameters:
overlap_fn (Callable[[Crater], tuple[set[int], set[int]]]) – A function that takes a crater and returns a tuple of (node indices, face indices) affected.
Initialize a MorphologyCrater object either from an existing Crater object or from parameters.
This generates a specialized Crater object with morphology parameters.
Parameters:
crater (Crater, optional) – The crater object to be converted into a BasicMoonCrater. If None, then a new crater is created using the provided parameters.
morphology (Morphology, optional) – The morphology model to use for generating morphology parameters.
location (pair of floats, optional) – The (longitude, latitude) location of the crater.
relative_location (dict) – Set the crater’s location based on the distance and bearing from a reference location. The dictionary is required to have the keys: “distance” and “bearing” with values of distance (in meters) and bearing (in degrees) from the reference point. A third key, “reference_location” should be in the form of a tuple of floats representing the longitude and latitude pair that defines the reference location. The “reference_location” is optional if the morphology.surface contains a local_location attribute (such as in the case of a HiResLocal surface type and its derivatives) which will be used if the key is missing or set to None, otherwise it is required. Both location and relative_location cannot be set unless check_redundant_inputs is set to False.
check_redundant_inputs (bool, optional) – If True, check for redundant inputs such as providing both diameter and radius. Default is True.
kwargs (Any) – The keyword arguments provided are passed down to MorphologyCrater.maker(). Refer to its documentation for a detailed description of valid keyword arguments.
Return a dictionary representation of the crater properties, including morphology-specific variable properties.
Parameters:
ignore_keys (list[str] or tuple[str], optional) – A list or tuple of property names to ignore when creating the dictionary representation. Default is an empty tuple unless skip_complex_data is True, in which case it will be extended to include (“morphology”, “affected_face_indices”, “affected_node_indices”, “ejecta_region”, “ejecta_region”, “crater_region”).
skip_complex_data (bool, optional) – If True, skip complex data types when creating the dictionary representation. This is useful when serializing the object for saving to a file, as it removes complex data types that may not be serializable. Default is False.
Remove complex data types from the crater variable properties.
This is useful for storing a lightweight representation, as it removes complex data types that can be recomputed from the fixed properties and the morphology model when needed. The morphology model is not removed, so that the complex data can be recomputed if needed.
The maximum radius of the ejecta region for this crater, as determined by the morphology model and is based on the distance that the ejecta thickness falls below the value of the smallest_length attribute of the morphology’s associated Surface object.
The LocalSurface view extracted around the crater center that encompasses the ejecta blanket, as determined by the morphology model.
This is extracted from the morphology’s associated Surface object based on the location of the crater and the ejecta_rmax distance. If the ejecta region cannot be extracted (e.g. if it is smaller than a single face of the mesh) this property will be set to None and the crater will be marked as not emplaceable.
The LocalSurface view extracted around the crater center that encompasses a buffered region around the cratered rim.
This is extracted from the morphology’s associated Surface object based on the location of the crater and a radius that extends by a _RIM_BUFFER_FACTOR constant times the crater radius. If the crater region cannot be extracted (e.g. if it is smaller than a single face of the mesh) this property will be set to None and the crater will be marked as not emplaceable.
Whether this crater is large enough to be emplaced on the surface mesh, which is determined based on whether the crater region could be successfully extracted.
The measured rim height of the crater, which is determined based on the morphology model’s crater shape and the surface elevation data in the crater region.
The measured floor depth of the crater, which is determined based on the morphology model’s crater shape and the surface elevation data in the crater region.
Whether this crater is large enough to be emplaced on the surface mesh, which is determined based on whether the crater region could be successfully extracted.
The maximum radius of the ejecta region for this crater, as determined by the morphology model and is based on the distance that the ejecta thickness falls below the value of the smallest_length attribute of the morphology’s associated Surface object.
The set of face indices on the surface mesh that are affected by this crater, which is determined based on the crater region and is used by the morphology’s queue manager to determine if craters overlap and can be emplaced simultaneously.
The set of node indices on the surface mesh that are affected by this crater, which is determined based on the crater region and is used by the morphology’s queue manager to determine if craters overlap and can be emplaced simultaneously.
The LocalSurface view extracted around the crater center that encompasses a buffered region around the cratered rim, as determined by the morphology model.
Convenience method to immediately emplace a crater onto the surface.
Initializes and uses the queue system behind the scenes.
Parameters:
crater (Crater | list[Crater] | None) – The crater or list of craters to be emplaced. If None, then a crater will be created using the provided parameters in kwargs and emplaced.
kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
Returns:
list[BasicMoonCrater] – The list of BasicMoonCrater objects that were emplaced.
Compute the ejecta shape based on the region view and surface.
Parameters:
region (LocalSurface) – The region view of the surface mesh centered at the crat er center.
crater (BasicMoonCrater) – The crater object containing the parameters for the ejecta shape.
**kwargs (Any) – Additional keyword arguments that are either ignored or passed to internal functions as needed.
Returns:
NDArray[np.float64] – The computed ejecta shape at the face and node elevations
NDArray[np.float64] – The computed ejecta intensity at the face and node elevations which is used to compute the degradation function. When dorays is True, this is the ray intensity function. When dorays is False, this is just a constant 1 over the ejecta region.
This models the combined degradation of the part of the production population that is below the resolution of the mesh on each face. It is called between batches of craters by the emplace method.
Parameters:
time_start (float) – The time of the surface at the start of the degradation.
time_end (float) – The time of the surface at the end of the degradation.
Additional keyword arguments that are either ignored or passed to internal functions as needed.
Compute the maximum extent of the crater based on the minimum thickness of a feature, or the ejecta_truncation factor, whichever is smaller.
Parameters:
crater (Crater) – The crater object to be used.
minimum_thickness (FloatLike) – The minimum thickness of the feature blanket in meters.
feature (str, optional, default = “ejecta”) – The feature to compute the maximum extent. Either “crater” or “ejecta”. If “crater” is chosen, the rmax is based
on where the raised rim is smaller than minimum thickness.
Returns:
float – The maximum extent of the crater or ejecta blanket in meters.
Computes the degradation function, which defines the topographic degradation that each crater contributes to the surface.
This function implements a combination of the model by Minton et al. (2019) [2] for small craters and Riedel et al. (2020) [3] for large craters. It is currently not well-constrained, so may change in the future.
Parameters:
diameter (FloatLike) – The final diameter of the crater in meters.
fe (FloatLike, optional) – The degradation function size factor, which is a scaling factor for the degradation function. Default is 100.0.
Initialize a BasicMoonCrater object either from an existing Crater object or from parameters.
This generates a specialized Crater object with morphology parameters.
Parameters:
crater (Crater, optional) – The crater object to be converted into a BasicMoonCrater. If None, then a new crater is created using the provided parameters.
morphology (Morphology, optional) – The morphology model to use for generating morphology parameters.
kwargs (Any) – The keyword arguments provided are passed down to cratermaker.morphology.MorphologyCrater.maker(). Refer to its documentation for a detailed description of valid keyword arguments.