optical_utilities¶
This submodule contains functionality to load tracking data from optical
astrometry tables that already exist as pandas or astropy tables. The
read_optical_data() function is the main interface for loading the data
and converting it to objects that Tudat can process further; see also
tracking_data. The optical-data conversion can assign the default
optical weighting scheme of Vereš et al. [47] and star-catalog bias
corrections following Eggl et al. [12]. 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.
- read_optical_data(table: pandas.DataFrame | astropy.table.table.QTable | astropy.table.table.Table, in_degrees: bool = True, frame: str = 'J2000', custom_name: str | None = None, add_weights: bool | None = False, add_star_catalog_corrections: bool | None = False, add_ancillary_data: bool | None = False, weighing_scheme: str | None = '')[source]¶
Read optical astrometry from a table into TrackingData objects.
The table must contain the standard optical astrometry columns used by the Tudat optical-data pipeline. pandas and astropy tables are both accepted; source-specific file parsing is handled by the dedicated MPC and 80-column readers. Depending on the input type, this function dispatches to
read_pandas_optical_data()orread_astropy_optical_data(). Those functions create the augmented optical table withcreate_augmented_optical_table()and convert it to Tudat optical tracking data withoptical_table_to_tracking_data().- Parameters:
table (pandas.DataFrame | astropy.table.QTable | astropy.table.Table) – Optical astrometry table to read.
in_degrees (bool, default True) – Whether right ascension and declination are provided in degrees.
frame (str, default "J2000") – Reference frame of the input observations.
custom_name (str | None, default None) – Optional target name assigned to all observations.
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.
weighing_scheme (str, default "") – Weighing scheme that is to be used for the observations:
"VFCC17"(see [47]),"ADES"(weights computed from the rmsRA and rmsDec uncertainties of each observation) or"ADES_NIGHT"(as"ADES", but with the weights divided by the number of observations of the same target, from the same observatory, in the same local night, as defined for"VFCC17"). The weights are computed when the observation collection is created. If empty, no weights are assigned.
- Returns:
Tracking data objects and supplementary data objects.
- Return type:
Supporting API¶
The functions below implement the shared optical-data conversion pipeline used by the MPC, 80-column and table-based readers. They are useful for validating, augmenting, filtering or inspecting optical astrometry tables before they are converted to Tudat-compatible tracking-data objects.
- read_astropy_optical_data(table: astropy.table.table.QTable | astropy.table.table.Table, in_degrees: bool = True, frame: str = 'J2000', custom_name: str | None = None, add_weights: bool | None = False, add_star_catalog_corrections: bool | None = False, add_ancillary_data: bool | None = False, weighing_scheme: str | None = '')[source]¶
Read optical astrometry from an astropy table into TrackingData objects.
This is a supporting table-specific reader. In the typical Tudat workflow for already-loaded optical tables, call
read_optical_data()instead.- Parameters:
table (astropy.table.QTable | astropy.table.Table) – Optical astrometry table to read.
in_degrees (bool, default True) – Whether right ascension and declination are provided in degrees.
frame (str, default "J2000") – Reference frame of the input observations.
custom_name (str | None, default None) – Optional target name assigned to all observations.
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.
weighing_scheme (str, default "") – Weighing scheme that is to be used for the observations:
"VFCC17"(see [47]),"ADES"(weights computed from the rmsRA and rmsDec uncertainties of each observation) or"ADES_NIGHT"(as"ADES", but with the weights divided by the number of observations of the same target, from the same observatory, in the same local night, as defined for"VFCC17"). The weights are computed when the observation collection is created. If empty, no weights are assigned.
- Returns:
Tracking data objects and supplementary data objects.
- Return type:
- read_pandas_optical_data(table: pandas.DataFrame, in_degrees: bool = True, frame: str = 'J2000', custom_name: str | None = None, add_weights: bool | None = False, add_star_catalog_corrections: bool | None = False, add_ancillary_data: bool | None = False, weighing_scheme: str | None = '')[source]¶
Read optical astrometry from a pandas table into TrackingData objects.
This is a supporting table-specific reader. In the typical Tudat workflow for already-loaded optical tables, call
read_optical_data()instead.- Parameters:
table (pandas.DataFrame) – Optical astrometry table to read.
in_degrees (bool, default True) – Whether right ascension and declination are provided in degrees.
frame (str, default "J2000") – Reference frame of the input observations.
custom_name (str | None, default None) – Optional target name assigned to all observations.
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.
weighing_scheme (str, default "") – Weighing scheme that is to be used for the observations:
"VFCC17"(see [47]),"ADES"(weights computed from the rmsRA and rmsDec uncertainties of each observation) or"ADES_NIGHT"(as"ADES", but with the weights divided by the number of observations of the same target, from the same observatory, in the same local night, as defined for"VFCC17"). The weights are computed when the observation collection is created. If empty, no weights are assigned.
- Returns:
Tracking data objects and supplementary data objects.
- Return type:
- optical_table_to_tracking_data(table: pandas.DataFrame, add_weights: bool | None = False, add_star_catalog_corrections: bool | None = False, add_ancillary_data: bool | None = False, weighing_scheme: str | None = '')[source]¶
Convert an augmented optical table to TrackingData and supplementary data lists.
This is a supporting conversion utility used by the optical readers. In the typical Tudat workflow, call
read_optical_data()or a source-specific optical reader instead.- Parameters:
table (pandas.DataFrame) – Augmented optical astrometry table to convert.
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.
weighing_scheme (str, default "") – Weighing scheme that is to be used for the observations:
"VFCC17"(see [47]),"ADES"(weights computed from the rmsRA and rmsDec uncertainties of each observation) or"ADES_NIGHT"(as"ADES", but with the weights divided by the number of observations of the same target, from the same observatory, in the same local night, as defined for"VFCC17"). The weights are computed when the observation collection is created. If empty, no weights are assigned.
- Returns:
Tracking data objects and supplementary data objects.
- Return type:
- create_augmented_optical_table(table: astropy.table.table.QTable | astropy.table.table.Table | pandas.DataFrame, in_degrees: bool = True, frame: str = 'J2000', custom_name: str | None = None) pandas.DataFrame[source]¶
Create the shared augmented optical table used by all optical sources.
This is a supporting utility for inspecting or preparing optical tables. In the typical Tudat workflow, call
read_optical_data()or a source-specific optical reader instead.- Parameters:
table (astropy.table.QTable | astropy.table.Table | pandas.DataFrame) – Optical astrometry table to augment.
in_degrees (bool, default True) – Whether right ascension and declination are provided in degrees.
frame (str, default "J2000") – Reference frame of the input observations.
custom_name (str | None, default None) – Optional target name assigned to all observations.
- Returns:
Augmented optical astrometry table.
- Return type:
- filter_augmented_optical_table(table: pandas.DataFrame, epoch_start=None, epoch_end=None, observatories: list[str | int] | None = None, observatories_exclude: list[str | int] | None = None) pandas.DataFrame[source]¶
Filter an augmented optical astrometry table.
This is a supporting utility for inspecting or manipulating already augmented optical data. It is not part of the typical Tudat workflow for loading and processing tracking data.
Epoch filters are interpreted as UTC seconds since J2000, or as Python datetimes that are converted to UTC seconds since J2000.
- Parameters:
table (pandas.DataFrame) – Augmented optical astrometry table to filter.
epoch_start (float | datetime.datetime | None, default None) – Optional lower epoch bound.
epoch_end (float | datetime.datetime | None, default None) – Optional upper epoch bound.
observatories (list[str | int] | None, default None) – Optional list of observatory identifiers to keep.
observatories_exclude (list[str | int] | None, default None) – Optional list of observatory identifiers to remove.
- Returns:
Filtered augmented optical astrometry table.
- Return type:
- standardize_optical_dataframe(df: pandas.DataFrame) pandas.DataFrame[source]¶
Ensure IDs are strings and observatory codes are zero-padded.
This is a supporting utility for inspecting or preparing optical tables. In the typical Tudat workflow, call
read_optical_data()or a source-specific optical reader instead.- Parameters:
df (pandas.DataFrame) – Optical astrometry table to standardize.
- Returns:
Standardized copy of the input table.
- Return type:
- validate_optical_table(table: astropy.table.table.QTable | astropy.table.table.Table | pandas.DataFrame, frame: str) None[source]¶
Validate the common optical astrometry table input.
This is a supporting utility used by the optical readers. In the typical Tudat workflow, call
read_optical_data()or a source-specific optical reader instead.- Parameters:
table (astropy.table.QTable | astropy.table.Table | pandas.DataFrame) – Optical astrometry table to validate.
frame (str) – Reference frame of the input observations.
- Returns:
The function returns
Noneif validation succeeds.- Return type:
None
- datetime_to_utc_seconds(epoch) float[source]¶
Convert an epoch to UTC seconds since J2000.
- Parameters:
epoch (float | DateTime | Time | datetime.datetime) – Epoch as UTC seconds since J2000, a Tudat
DateTimeorTime, or a Python datetime interpreted as UTC.- Returns:
UTC seconds since J2000.
- Return type:
- load_bias_file(filepath: str, Nside: int | None = None, catalog_flags: list | None = None) tuple[pandas.DataFrame, int][source]¶
Load a HEALPix star-catalog debias file.
This is a supporting utility for inspecting or applying optical star-catalog bias corrections. It is not part of the typical Tudat workflow for loading and processing tracking data.
The file is processed into a dataframe, and the NSIDE parameter is retrieved automatically when possible. The debias files are used for star-catalog bias corrections following [12].
- Parameters:
- Returns:
Dataframe with biases in multi-index format ((Npix x Ncat) x Nvals) and the NSIDE value.
- Return type:
- Raises:
ValueError – If NSIDE cannot be retrieved automatically.
- get_biases_EFCC18(mpc_table: pandas.DataFrame, bias_file: str | None = '/home/docs/.tudat/resource/star_catalog_biases/debias_2018/bias.dat', Nside: int | None = None, catalog_flags: list[str] | None = None) tuple[numpy.ndarray, numpy.ndarray][source]¶
Calculate and return star catalog bias values as described by Eggl et al. [12].
This is a supporting utility for inspecting or applying optical star-catalog bias corrections. It is not part of the typical Tudat workflow for loading and processing tracking data.
Uses the regular bias set by default. A high-resolution version of the bias map can be retrieved from the paper and selected using the
bias_fileparameter.- Parameters:
mpc_table (pd.DataFrame) – Table retrieved by calling the mpc.BatchMPC.table property. Must contain ‘RA’, ‘DEC’, ‘epoch_seconds_UTC’ and ‘catalog’ columns.
bias_file (str | None, optional) – Optional bias file location, used to load alternative debias coefficients. By default, coefficients are retrieved from Tudat resources.
Nside (int | None, optional) – Optional NSIDE value. This can usually be left as None.
catalog_flags (list[str] | None, optional) – List of catalog values to use. This can usually be left at its default value.
- Returns:
Right ascension corrections and declination corrections.
- Return type:
tuple[np.ndarray, np.ndarray]