Usage

To use MPC Utilities in a project:

import mpcutilities.mpcutilities as MPCU
import mpcutilities.kepcart as kc
import mpcutilities.phys_const as PHYS
import mpcutilities.classes as classes

Kepcart

Details of the functions in the kepcart module for transforming between Keplerian and Cartesian coordinates.

Kepcart Structures

Details of the c-types Structures defined in the classes module that are used for passing information back-and-forth between python & C:

PhysConst

Details of the rotation functions which are currently located in phys_const module (for some reason):


Oct 2018

Payne

Functions related to

  1. Physical Constants
  2. Unit-Conversions

If efficient, might want to replace some of this with the JPL/SPICE stuff

Or novas

Or astropy

Or whatever, doesn’t matter …


mpcutilities.phys_const.rotate_ec_to_eq(arr)[source]

Simple function to rotate input ECLIPTIC coordinates into EQUATORIAL coordinates

mpcutilities.phys_const.rotate_eq_to_ec(arr)[source]

Simple function to rotate input EQUATORIAL coordinates into ECLIPTIC coordinates

mpcutilities.phys_const.rotate_matrix(ecl)[source]

Rotation matrices (general) between ecliptic and equatorial coordinates

obs80

Details of the functions for parsing 80-character-observations (written by Sonia Keys) and located in obs80 module. This also contains “heliocentric-annotation’’ code that used to be in “obs80hc”.

ele220

Details of the functions for parsing 220-character-orbits (written by Sonia Keys) and located in ele220 module.


Nov 2018

  • Payne

Originally written by Sonia Keys

Parsing and formatting for four orbit formats:

  • the 220 column format for minor planets
  • the 90 column format for minor planets
  • the 220 column format for natural satellites of outer planets
  • the 255 column format for comets

Parsing is provided with classes Ele220, Ele90, EleSat, EleComet.

Formatting is provided class EleFields, but currently only implemented for the 220 and 90 column minor planet formats, not for the natural satellite or comet formats.


class mpcutilities.ele220.Ele220[source]

Holds a 220 character element line.

Class Ele220 instantiates on a 220 character line, then methods interpret individual field values. A design assumption is that many applications will not need all fields but only some subset. Instantiation therefore does not do any parsing. Individual methods interpret and return single field values.

Thus depending on the application, Ele220 may not be best for orbit represention but only for parsing. For example you might define an orbit class in some way suitable for computation, then instantiate an Ele220 on a line from an orbit file, then use the methods of the Ele220 object in constrution of your computation-suitable orbit object. This way only the fields you need are parsed; they are parsed once and then the Ele220 object is no longer needed.

Note the methods ma1, argPeri1, node1, inc1, ecc3, and a3 have little computational use. They interpret fields appearing in the 220 column format as “readable” values with reduced precision. Full precision values are either available as other methods or can be computed from other methods.

str : string
220 character element line. Extra length such as a trailing newline is okay.
a3()[source]
float
Semi-major axis in AU, precision limited to three decimal places.
arc()[source]
int
Arc length of observations included in solution (/days)
argPeri1()[source]
float
Argument of perihelion in degrees, precision limited to one decimal place.
comp()[source]
string
Computer name, up to 9 characters, whitespace trimmed
curOppScore()[source]
int
a number from 0 to 9 if present. -1 if not present.
desig()[source]
string
a short designation, no longer than 7 characters, whitespace trimmed. This may be a temporary or packed designation, either permanent or provisional.

designation : Unpacked designation

designation()[source]
string
a non-packed designation, up to 10 characters, whitespace trimmed.

desig : Packed designation

ecc3()[source]
float
Eccentricity, precision limited to three decimal places.
first()[source]
float
Date of first included observation as JD
g()[source]
float
Slope parameter, G
h()[source]
float
Absolute magnitude, H
inc1()[source]
float
Inclination in degrees, precision limited to one decimal place.
last()[source]
float
Date of last included observation as JD
ma1()[source]
float
Mean anomaly in degrees, precision limited to one decimal place.
maEpoch()[source]
float
Epoch JD
node1()[source]
float
Longitude of ascending node in degrees, precision limited to one decimal place.
numObs()[source]
int
Number of observations included in solution
numOpp()[source]
int
Number of oppositions included in solution
numScore()[source]
int
a number from 0 to 219 if present. -1 if not present.
pertCoarse()[source]
string
a string such as ‘M-v’ or ‘’
pertEpoch()[source]
None or float
float is epoch jd
pertScheme()[source]
string
a string such as ‘DE200’, ‘DE403’, ‘DE405’, or ‘’
perturbers()[source]
string
4 character perturber code if present, ‘’ otherwise
ref()[source]
string
Reference, up to 9 characters, whitespace trimmed
rms()[source]
float
r.m.s. fit of included obserations (/”)
u()[source]
int
U value (a number from 0 to 9) if present. 10 if not present. (10 is not a valid U value.)
uNote()[source]
string
single character note from the U field, if one exists, ‘’ otherwise
class mpcutilities.ele220.Ele90[source]

holds a 90 character element line.

str : string
The 90 character element line. A trailing newline is okay.

Ele220

desig()[source]
string
a short designation, no longer than 7 characters, whitespace trimmed. This may be a temporary or packed designation, either permanent or provisional.

designation : Unpacked designation

first()[source]
float
Date of first included observation as JD
h()[source]
float
Absolute magnitude, H, if field is filled
None
if field is blank
last()[source]
float
Date of last included observation as JD
class mpcutilities.ele220.EleSat[source]

Holds a 220 character element line for a natural satellite

Class EleSat instantiates on a 220 character line, then methods interpret individual field values. A design assumption is that many applications will not need all fields but only some subset. Instantiation therefore does not do any parsing. Individual methods interpret and return single field values.

str : string
220 character element line. Extra length such as a trailing newline is okay.
a3()[source]
float
Semi-major axis in AU, precision limited to three decimal places.
arc()[source]
int
Arc length of observations included in solution
argPeri1()[source]
float
Argument of perihelion in degrees, precision limited to one decimal place.
comp()[source]
string
Computer name, up to 9 characters, whitespace trimmed
curOppScore()[source]
int
a number from 0 to 9 if present. -1 if not present.
designation()[source]
string
unpacked designation.
ecc3()[source]
float
Eccentricity, precision limited to three decimal places.
first()[source]
float
Date of first included observation as JD
h()[source]
float
Absolute magnitude, H
inc1()[source]
float
Inclination in degrees, precision limited to one decimal place.
last()[source]
float
Date of last included observation as JD
ma1()[source]
float
Mean anomaly in degrees, precision limited to one decimal place.
maEpoch()[source]
float
Epoch JD
node1()[source]
float
Longitude of ascending node in degrees, precision limited to one decimal place.
numObs()[source]
int
Number of observations included in solution
numScore()[source]
int
a number from 0 to 219 if present. -1 if not present.
permDesig()[source]
string
permanent designation, 4 characters if present, ‘’ if not present.
pertCoarse()[source]
string
a string such as ‘M-v’ or ‘’
pertEpoch()[source]
float
epoch jd
pertScheme()[source]
string
a string such as ‘DE200’, ‘DE403’, ‘DE405’, or ‘’
perturbers()[source]
string
4 character perturber code if present, ‘’ otherwise
ref()[source]
string
Reference, up to 9 characters, whitespace trimmed
rms()[source]
float
r.m.s. fit of included obserations
tempDesig()[source]
string
temporary designation, 7 characters if present, ‘’ if not present.
class mpcutilities.ele220.EleComet[source]

holds a 256 character comet element line.

str : string
The 256 character element line. A trailing newline is okay.
comp()[source]
string
Orbit computer name. The first character can be ‘@’, which means it can be expanded with an external list, comet_computers.txt.
first()[source]
float or None
Date of first included observation as JD if valid, None otherwise
frag()[source]
string
1 or 2 character fragment identifer if present. ‘’ if not present.
last()[source]
float or None
Date of last included observation as JD if valid, None otherwise
name()[source]
string
Comet name
nonGrav()[source]
None or tuple
None if no non-grav parameters present, otherwise: 3-tuple of (style, a1, a2), or 4-tuple of (style, a1, a2, a3) where style is a single character and a1-a3 are floats
notes()[source]
string
up to two note codes.
numObs()[source]
int
Number of observations used in orbit solution.
numObsAN()[source]
string
‘A’ or ‘N’ where one of these characters appears before numObs.
numObsPlus()[source]
bool
True if a ‘+’ appears following numObs.
permDesig()[source]
string
permanent designation, 5 characters if present, ‘’ if not.
pertCoarse()[source]
string
a string such as ‘M-v’ or ‘’
pertEpoch()[source]
None or float
float is epoch jd
pertScheme()[source]
string
a string such as ‘DE200’, ‘DE403’, ‘DE405’, or ‘’
perturbers()[source]
string
4 character perturber code if present, ‘’ otherwise
pub()[source]

string

pubVol()[source]

string

pubYear()[source]

string

rms()[source]
float
r.m.s. fit of included obserations if rms is present. -1 if rms is not present.
tempDesig()[source]
string
temporary designation, including leading orbit type character, 8 characters altogether if present, ‘’ if not present.
timeScale()[source]
string
Either “TT/TDT” or “UTC”.

leapsec module

Archaic / Unused leap-second functionality: documentation included in case it needs to be tracked-down


Nov 2018

Payne

Original code by Sonia Keys

Provides leap second information by year. It requires a file of leap second data in the format prepared by Judah Levine at NIST. See https://www.ietf.org/timezones/data/leap-seconds.list for example.

* Payne: I believe this code to be unnecessary / unused *

* Payne: I am keeping it for archival purposes *


obscode module

Archaic / Unused obscode functionality: documentation included in case it needs to be tracked-down