MPC#
A function for parsing an MPC observations file.
- jorbit.utils.mpc.packed_to_unpacked_designation(code)[source]#
Convert a packed designation to an unpacked designation.
Useful for translating between the leftmost and rightmost columns of a mpcorb file. Correctly handles provisional designations, low-numbered objects, medium-numbered objects, and high-numbered objects.
- Parameters:
code (
str) – The packed designation. 5 characters for numbered objects, 7 for provisional.- Returns:
The unpacked designation.
- Return type:
str
- jorbit.utils.mpc.read_mpc_file(mpc_file)[source]#
Read an MPC observations file and extract the relevant data.
Haven’t checked on this in a while - it may be out of date.
- Parameters:
mpc_file (
str) – Path to the MPC observations file.- Returns:
A tuple containing the following elements. (SkyCoord, The observed coordinates; list[Time], The times of observation; list[str], The observatory locations; list[u.Quantity], The astrometric uncertainties)
- Return type:
tuple[SkyCoord,list[Time],list[str],list[Quantity]]
- jorbit.utils.mpc.unpack_epoch(epoch_str)[source]#
Convert a packed epoch string from the MPCORB format to an astropy Time object.
- Return type:
Time- Parameters:
epoch_str (str)
- jorbit.utils.mpc.unpacked_to_packed_designation(number_str)[source]#
Convert an unpacked designation to a packed designation.
Useful for translating between the leftmost and rightmost columns of a mpcorb file. Correctly handles provisional designations, low-numbered objects, medium-numbered objects, and high-numbered objects.
- Parameters:
number_str (
str) – The unpacked designation. If is 7 digits and begins with a letter, it’s assumed to be a provisional designation and is returned unchanged. Otherwise it’s assumed to be a numbered object and will be packed into a 5 digit form.- Returns:
The packed designation.
- Return type:
str