mpc¶
This submodule contains functionality to retrieve optical tracking data from
the Minor Planet Center (MPC) database for asteroids and comets. The
BatchMPC class wraps the MPC interface provided by astroquery [57] and
adds Tudat-specific processing, including optional observation weights based on
Vereš et al. [47] and star-catalog bias corrections based on
Eggl et al. [12].
The read_mpc_data() function is the main interface
for loading the data and converting it to objects that Tudat can process
further; see also
tracking_data. All other functionality in this module is
reserved for better understanding what data is being loaded, and in some cases
manipulating it, before it is processed into Tudat-compatible objects.
For example applications of the MPC interface, see the estimation examples using real observations.
- read_mpc_data(MPCcodes: list[str | int], id_types: list[str | None] | None = None, drop_misc_observations: bool = True, custom_name: str | None = None, add_weights: bool | None = False, add_star_catalog_corrections: bool | None = False, add_ancillary_data: bool | None = False, use_mpc80_format: bool = False)[source]¶
Retrieve MPC observations and return tracking-data containers.
This function is a convenience interface around
BatchMPC, which uses theastroqueryMPC interface to retrieve optical observations for asteroids and comets from the Minor Planet Center. The retrieved data are stored in aBatchMPCinstance and converted throughBatchMPC.to_tracking_dataset(). Optical observations can be augmented with default optical weights based on Vereš et al. [47], star-catalog bias corrections based on Eggl et al. [12], and ancillary metadata.- Parameters:
MPCcodes (list[str | int]) – MPC object identifiers for which observations are retrieved.
id_types (list[str | None] | None, default None) – Optional identifier type for each MPC object identifier.
drop_misc_observations (bool, default True) – Whether to drop MPC records with Note 2 flags for replaced discovery observations (
x,X), roving observers (V,v,W,w), radar observations (R,r,Q,q), offset observations of natural satellites (O), and satellite/space-based records (S,s,T,t). This filtering is based on the MPC Note 2 flag, not on the observatory code.custom_name (str | None, default None) – Optional body name used in the generated tracking data.
add_weights (bool, default False) – Whether to assign the default optical weighing scheme of [47].
add_star_catalog_corrections (bool, default False) – Whether to attach star-catalog bias corrections following [12].
add_ancillary_data (bool, default False) – Whether to attach available optical ancillary metadata.
use_mpc80_format (bool, default False) – Retrieve raw MPC 80-column records and parse them with
parse_80cols_data(). Required for radar (R/r) and space-based (S/s) observations. In this modedrop_misc_observationshas no effect: records with Note 2 flags x, X, V, v, W, w, Q, q, O, T and t are always dropped.
- Returns:
Tracking data objects and supplementary data objects.
- Return type:
Notes
For radar range observation-model time-scale requirements, see
radar_data_to_tracking_data().
Supporting API¶
The class below exposes the intermediate MPC batch used by
read_mpc_data(). It can be used directly to retrieve observations,
inspect the resulting table and metadata, and then convert the batch to Tudat
tracking-data objects. It also provides a method for converting spacecraft
positions from space-based observations into state histories.
- class BatchMPC[source]¶
Bases:
objectInterface between MPC observations and Tudat tracking data.
This class wraps the MPC interface of
astroqueryand provides Tudat-specific processing for optical, space-based and radar observations of asteroids and comets. Optical data optionally receive observation weights based on Vereš et al. [47] and star-catalog bias corrections based on Eggl et al. [12].Notes
Currently, transformations between reference frames are not implemented. As such observations are only returned in the J2000 Frame.
Examples
Basic sequence of usage:
Initialise and retrieve data:
MPCcodes = [1, 4] # Ceres and Vesta batch = BatchMPC() batch.get_observations(MPCcodes)
Transform to Tudat tracking data:
tracking_data, supplementary_data = batch.to_tracking_dataset()
For simple loading, users can call read_mpc_data(…) without explicitly constructing a BatchMPC instance.
- copy() tudatpy.data_input.tracking_data.mpc.mpc.BatchMPC[source]¶
Create a copy of this MPC batch.
- Parameters:
None
- Returns:
Copy of batch.
- Return type:
- filter(bands: list[str] | None = None, catalogs: list[str] | None = None, observation_types: list[str] | None = None, observatories: list[str] | None = None, observatories_exclude: list[str] | None = None, epoch_start=None, epoch_end=None, in_place: bool = True) None | tudatpy.data_input.tracking_data.mpc.mpc.BatchMPC[source]¶
Filter observations in the batch.
This method filters the augmented MPC optical table stored in
tableand the canonical radar table stored inradar_table. Epoch filters are interpreted as UTC seconds since J2000, or as datetime-like objects that can be converted to UTC seconds since J2000.- Parameters:
bands (list[str] | None, default None) – Observation bands to keep.
catalogs (list[str] | None, default None) – Star-catalog codes to keep.
observation_types (list[str] | None, default None) – MPC Note 2 observation types to keep.
"R"keeps all radar observations;"NWayRange"or"DopplerMeasuredFrequency"keeps one radar observable. Radar observations are removed whenbandsorcatalogsis given, since they have neither.observatories (list[str] | None, default None) – Observatory codes to keep.
observatories_exclude (list[str] | None, default None) – Observatory codes to remove.
epoch_start (float | datetime.datetime | None, default None) – Lower epoch bound. See
filter_augmented_optical_table()for accepted epoch formats.epoch_end (float | datetime.datetime | None, default None) – Upper epoch bound. See
filter_augmented_optical_table()for accepted epoch formats.in_place (bool, default True) – Whether to modify this batch. If
False, a filtered copy is returned.
- Returns:
Noneifin_placeisTrue; otherwise a filtered copy.- Return type:
None | BatchMPC
- get_observations(MPCcodes: list[str | int], id_types: list[str | None] | None = None, drop_misc_observations: bool = True, custom_name: str | None = None, use_mpc80_format: bool = False) None[source]¶
Retrieve all observations for a set of MPC listed objects.
This method uses astroquery to retrieve the observations from the MPC. An internet connection is required, observations are cached for faster subsequent retrieval. Removes duplicate observations, and can filter selected MPC Note 2 observation types before the data are converted to the common augmented optical table used by Tudat.
- Parameters:
MPCcodes (list[str | int]) – List of integer or str MPC object codes for minor planets or comets.
id_types (list[str | None] | None, default None) – A list of identification types (‘asteroid_number’, ‘comet_number’, ‘comet_designation’) corresponding to each MPCcode. If an element is None, the type is considered unknown. If the entire list is None, all types are considered unknown.
drop_misc_observations (bool, default True) – Whether to drop MPC records with Note 2 flags for replaced discovery observations (
x,X), roving observers (V,v,W,w), radar observations (R,r,Q,q), offset observations of natural satellites (O), and satellite/space-based records (S,s,T,t). This filtering is based on the MPC Note 2 flag, not on the observatory code.use_mpc80_format (bool, default False) – Retrieve raw MPC 80-column records and parse them with
parse_80cols_data(). Required for radar (R/r) and space-based (S/s) observations. In this modedrop_misc_observationshas no effect: records with Note 2 flags x, X, V, v, W, w, Q, q, O, T and t are always dropped.
- Raises:
ValueError – If a valid identifier (a numbered designation, or a provisional designation) cannot be determined for one of the provided codes, indicating that the code is likely invalid.
- get_satellite_state_history(observatory_code: str) dict[float, numpy.ndarray][source]¶
Return the MPC spacecraft positions of one observatory as a state history.
- Parameters:
observatory_code (str) – MPC observatory code of the spacecraft, e.g.
"250"(HST).- Returns:
TDB seconds since J2000 mapped to geocentric J2000 Cartesian states [m, m/s]. Velocities are finite differences between observation epochs, which can be hours apart; do not rely on them for spacecraft in low orbits.
- Return type:
- Raises:
ValueError – If the batch has no spacecraft positions for this observatory.
- observatories_table(only_in_batch: bool = True, only_space_telescopes: bool = False, exclude_space_telescopes: bool = False, include_positions: bool = False) pandas.DataFrame[source]¶
Return MPC observatory names and observation counts for this batch.
Observatory metadata is retrieved only when this method is called; constructing or loading a batch does not require the station catalog.
- Parameters:
only_in_batch (bool, default True) – Whether to return only observatories present in this batch.
only_space_telescopes (bool, default False) – Whether to return only observatories marked as space telescopes in the MPC observatory catalog.
exclude_space_telescopes (bool, default False) – Whether to remove observatories marked as space telescopes in the MPC observatory catalog.
include_positions (bool, default False) – Retained for compatibility. The current table does not include observatory positions.
- Returns:
Dataframe with columns
Code,Nameandcount.- Return type:
- to_tracking_dataset(add_weights: bool | None = False, add_star_catalog_corrections: bool | None = False, add_ancillary_data: bool | None = False)[source]¶
Convert the current MPC batch to tracking-data containers.
- Parameters:
add_weights (bool, default False) – Whether to assign the default optical weighing scheme of [47].
add_star_catalog_corrections (bool, default False) – Whether to attach star-catalog bias corrections following [12].
add_ancillary_data (bool, default False) – Whether to attach available optical ancillary metadata.
- Returns:
Tracking data objects and supplementary data objects.
- Return type:
Notes
For radar range observation-model time-scale requirements, see
radar_data_to_tracking_data().