damit¶
This module provides an interface to the Database of Asteroid Models from
Inversion Techniques (DAMIT)
[56], which contains polyhedron shape models and rotation
states of asteroids.
DamitModel loads a model
from the database by MPC number or model ID (downloading it on first use), or
from files, and computes the tri-axial ellipsoid with the same moments of
inertia. Models of tumbling asteroids are not supported.
For example, the shape and rotation of Eros are set up from its DAMIT model by:
from tudatpy.data_input.environment_data.damit import DamitModel
eros = DamitModel.query(mpc_number=433)
body_settings.get("Eros").shape_settings = environment_setup.shape.damit_polyhedron(eros)
body_settings.get("Eros").rotation_model_settings = environment_setup.rotation_model.damit(
eros, "ECLIPJ2000", "Eros_fixed"
)
damit_best_fitting_ellipsoid()
gives the best fitting ellipsoid instead of the polyhedron, in the same
body-fixed frame. The DAMIT conventions are described in its
documentation.
Functions¶
|
List the DAMIT models of an asteroid, or of all asteroids. |
- list_damit_models(mpc_number: int | None = None, force_refresh: bool = False) pandas.DataFrame[source]¶
List the DAMIT models of an asteroid, or of all asteroids.
An asteroid can have several models, or none, in which case the returned table is empty. The DAMIT tables are downloaded on the first call, and stored for later use.
- Parameters:
- Returns:
Table of the models, indexed by DAMIT model ID, with the columns of the DAMIT model table and the MPC number of the asteroid (
mpc_number).- Return type:
Classes¶
|
Asteroid model from DAMIT: a polyhedron shape and a rotation about a fixed axis. |
- class DamitModel(vertices: numpy.ndarray, facets: numpy.ndarray, pole_longitude: float, pole_latitude: float, period: float, initial_rotation_angle: float, reference_epoch: float)[source]¶
Bases:
objectAsteroid model from DAMIT: a polyhedron shape and a rotation about a fixed axis.
A model is normally created with
query()orfrom_file(). Shape model settings are created from it withdamit_polyhedron()ordamit_best_fitting_ellipsoid(), and rotation model settings withdamit().The body-fixed frame of the model has its z-axis along the rotation axis, which is assumed to be a principal axis, and its x-axis along the principal axis of minimum moment of inertia in the equatorial plane (for a constant density). The vertices are rotated about the z-axis to this frame, and the rotation angle is changed by the same angle, so that the orientation of the body is unchanged. Body-fixed longitudes therefore differ from those in the frame of the DAMIT shape model by this angle.
The rotation rate is constant: a YORP change of the rotation rate is ignored. For a model from
query()that has one, a warning is given when its rotation is used.- Parameters:
vertices (numpy.ndarray) – Cartesian coordinates of the vertices in the frame of the shape model (m), one row per vertex.
facets (numpy.ndarray) – Indices of the three vertices of each facet (zero-indexed), one row per facet.
pole_longitude (float) – Ecliptic longitude of the rotation axis, w.r.t. ECLIPJ2000 (rad).
pole_latitude (float) – Ecliptic latitude of the rotation axis, w.r.t. ECLIPJ2000 (rad).
period (float) – Sidereal rotation period (s).
initial_rotation_angle (float) – Rotation angle of the frame of the shape model at the reference epoch (rad).
reference_epoch (float) – Reference epoch of the rotation, in seconds since J2000.
- classmethod from_file(spin_file: str | pathlib.Path, shape_file: str | pathlib.Path, diameter: float | None = None)[source]¶
Load a DAMIT model from files in the format of those downloaded from the DAMIT database.
- Parameters:
spin_file (str or pathlib.Path) – Path to the rotation file (spin.txt).
shape_file (str or pathlib.Path) – Path to the shape file, in OBJ format (shape.obj).
diameter (float, optional) – Volume-equivalent diameter (m) to which the shape is scaled. If not given, the vertex coordinates are taken to be in km, which gives a non-physical size for a model that DAMIT gives with unit volume.
- Returns:
DAMIT model from the files.
- Return type:
- classmethod query(*, mpc_number: int | None = None, damit_model_id: int | None = None, diameter: float | None = None, force_refresh: bool = False)[source]¶
Load a DAMIT model by MPC number or by DAMIT model ID.
Exactly one of
mpc_numberanddamit_model_idmust be given. The DAMIT tables and model files are downloaded on first use, and stored for later use.- Parameters:
mpc_number (int, optional) – MPC number of the asteroid. Of its models, the one with the highest quality flag is selected. If several models share the highest flag, the one with the lowest model ID is selected, and their number is given by
number_of_equally_good_models.damit_model_id (int, optional) – DAMIT model ID.
diameter (float, optional) – Volume-equivalent diameter (m) to which the shape is scaled. If not given, the size from the DAMIT tables is used. If DAMIT has no size information for the model, a warning is given, and the size is not physical.
force_refresh (bool, optional) – If True, downloads the DAMIT tables and model files again, replacing the stored ones. Defaults to False.
- Returns:
Selected DAMIT model.
- Return type:
- best_fitting_ellipsoid() list[float][source]¶
Compute the tri-axial ellipsoid with the same moments of inertia as the polyhedron shape.
The axes of the ellipsoid are those of the body-fixed frame, which are principal axes of the polyhedron. With the moments of inertia \(I_A \le I_B\) about the x- and y-axes, \(I_C\) about the z-axis, and the mass \(M\) of the polyhedron, the semi-axes are:
\[a = \sqrt{\frac{5}{2M}\left(I_B + I_C - I_A\right)}, \quad b = \sqrt{\frac{5}{2M}\left(I_A + I_C - I_B\right)}, \quad c = \sqrt{\frac{5}{2M}\left(I_A + I_B - I_C\right)}\]The inertia tensor is computed for a constant density, about the origin of the model, which is assumed to be its center of mass.
- initial_orientation(base_frame: str) numpy.ndarray[source]¶
Compute the rotation matrix from the base frame to the body-fixed frame at the reference epoch.
If DAMIT gives a YORP change in rotation rate for the model, a warning is given, as this change is ignored.
- Parameters:
base_frame (str) – Base frame orientation of the environment:
"J2000"or"ECLIPJ2000".- Returns:
Rotation matrix from the base frame to the body-fixed frame.
- Return type:
- property facets: ndarray¶
read-only
Copy of the indices of the three vertices of each facet (zero-indexed), one row per facet.
- Type:
- property initial_rotation_angle: float¶
read-only
Rotation angle of the body-fixed frame at the reference epoch (rad).
- Type:
- property number_of_equally_good_models: int | None¶
read-only
Number of models of the asteroid (including this one) that share the highest quality flag, if this model was selected by
query()from an MPC number, and None otherwise.- Type:
int | None
- property pole_latitude: float¶
read-only
Ecliptic latitude of the rotation axis, w.r.t. ECLIPJ2000 (rad).
- Type:
- property pole_longitude: float¶
read-only
Ecliptic longitude of the rotation axis, w.r.t. ECLIPJ2000 (rad).
- Type:
- property reference_epoch: float¶
read-only
Reference epoch of the rotation, in seconds since J2000.
- Type: