Package coords :: Module astrodate
[show private | hide private]
[frames | no frames]

Module coords.astrodate

For more information about astronomical date specifications, consult a reference source such as this page provided by the US Naval Observatory.

Constants and formulae in this module were taken from the times.h include file of the tpm package by Jeff Percival, to ensure compatibility.
Classes
BesselDate  
JulianDate  

Function Summary
JulianDate or BesselDate AstroDate(datespec)
AstroDate can be used as a class for managing astronomical date specifications (despite the fact that it was implemented as a factory function) that returns either a BesselDate or a JulianDate, depending on the properties of the datespec.
float byear2jd(byear)
Return julian date
float jd2jyear(jd)
Return decimal Julian year
float jyear2jd(jyear)
Return julian date

Function Details

AstroDate(datespec)

AstroDate can be used as a class for managing astronomical date specifications (despite the fact that it was implemented as a factory function) that returns either a BesselDate or a JulianDate, depending on the properties of the datespec.

AstroDate was originally conceived as a Helper class for the Position function for use with pytpm functionality, but also as a generally useful class for managing astronomical date specifications.

The philosophy is the same as Position: to enable the user to specify the date once and for all, and access it in a variety of styles.
Parameters:
datespec - Date specification as entered by the user. Permissible specifications include:
  • Julian year: 'J1997', 'J1997.325', 1997.325: return a JulianDate
  • Besselian year: 'B1950','B1958.432': return a BesselDate
  • Julian date: 'JD2437241.81', '2437241.81', 2437241.81: return a JulianDate
  • Modified Julian date: 'MJD37241.31': returns a JulianDate

           (type=string, float, or integer)
Returns:
JulianDate or BesselDate
Raises:
ValueError - Raises an exception if the date specification is a string, but begins with a letter that is not 'B','J','JD', or 'MJD' (case insensitive).

To Do:

  • Write tests
  • Add math functions! Addition, subtraction.
  • Is there a need to support other date specifications? eg FITS-style dates?

byear2jd(byear)

Parameters:
byear - decimal Besselian year
           (type=float)
Returns:
Julian date
           (type=float)

jd2jyear(jd)

Parameters:
jd - Julian date
           (type=float)
Returns:
decimal Julian year
           (type=float)

jyear2jd(jyear)

Parameters:
jyear - decimal Julian year
           (type=float)
Returns:
Julian date
           (type=float)

Generated by Epydoc 2.1 on Thu Jan 25 14:09:18 2007 http://epydoc.sf.net