Projectile#
The Projectile class contains information about the populations of projectiles used to scale between crater and projectile sizes.
To define a projectile, a Target must be created first. If you’re unsure how to define a target, see the Target documentation for guidance.
Creating a Projectile#
Example 1: Using a target from the catalogue
In [1]: from cratermaker import Projectile
In [2]: from cratermaker import Target
# First define the target
In [3]: target = Target.maker("Moon")
#The projectile is determined based on the target by default
In [4]: projectile = Projectile.maker(target=target)
# Print projectile properties
In [5]: print(f"cratermaker projectile: {projectile}")
cratermaker projectile: <AsteroidProjectiles>
Sample from distributions: True
Mean Velocity: 22.10 km/s
Density: 2250.0 kg/m³
Target: Moon
If no projectile parameters are specified, Cratermaker will use a default asteroid population suitable for the specified target.
Example 2: Creating a custom projectile
You can specify projectile properties manually using keyword arguments.
In [6]: projectile_userdefined = Projectile.maker(
...: projectile="generic",
...: sample=False,
...: velocity=22000.0, # meters/second
...: angle=45.0, # degrees
...: direction=90.0,
...: density=3000.0, # kg/m³
...: target="Moon"
...: )
...:
In [7]: print("Projectile defined by user:", projectile_userdefined)
Projectile defined by user: <GenericProjectiles>
Velocity: 22.00 km/s
Angle: 45.0°
Direction: 90.0°
Density: 3000.0 kg/m³
In this case, the user specifies the projectile velocity, impact angle, trajectory direction, and material density. The target is still required to complete the projectile’s initialization.
More Projectile examples#
See more examples at Projectiles and Scaling