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
- Physical Constants
- 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
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.
-
argPeri1
()[source]¶ - float
- Argument of perihelion in degrees, precision limited to one decimal place.
-
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
-
node1
()[source]¶ - float
- Longitude of ascending node in degrees, precision limited to one decimal place.
-
class
mpcutilities.ele220.
Ele90
[source]¶ holds a 90 character element line.
- str : string
- The 90 character element line. A trailing newline is okay.
Ele220
-
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.
-
argPeri1
()[source]¶ - float
- Argument of perihelion in degrees, precision limited to one decimal place.
-
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.
-
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
-
rms
()[source]¶ - float
- r.m.s. fit of included obserations if rms is present. -1 if rms is not present.
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