Table of Contents
jd: Convert date and time to Julian
dateconjd: Convert Julian date to date and
timerdaa: Equatorial to horizon
coordinatesaard: Horizon to celestial
coordinatessidereal.py: PrologueFIRST_GREGORIAN_YEARTWO_PIPI_OVER_12JULIAN_BIASSIDEREAL_A: Sidereal time conversion
factorFLOAT_PAT: Regular expression for a
floating-point numberD_PAT: Degrees codeM_PAT: Minutes codeS_PAT: Seconds codeH_PAT: Hours codeNS_PAT: Latitude suffixEW_PAT: Longitude suffixhoursToRadians(): Convert hours to
radiansradiansToHours(): Convert hours to
radianshourAngleToRA(): Convert an hour
angle to right ascensionraToHourAngle(): Convert a right
ascension to an hour angledayNo(): Date to day numberparseDatetime(): Convert an external
date-time stringparseDate(): Convert an external date
stringparseTime(): Convert an external time
stringparseZone(): Process a time zone
suffixparseFixedZone(): Parse fixed zone
suffixclass FixedZone: Fixed-offset time zoneclass USTimeZone: Time zone with daylight
timezoneCodeMap: Dictionary of time zonesparseAngle(): Convert an external
angle stringparseFloatSuffix: Parse a number followed
by a codeparseFloat(): Parse a floating-point
numberparseRe(): Parse a regular
expressionparseLat(): Convert an external
latitudeparseLon(): Convert an external
longitudeparseHours(): Convert an external
quantity in hoursclass MixedUnits: Operations on
mixed-unit systemsdmsUnits: Mixed-units converterclass LatLon: Observer latitude and
longitudeclass JulianDate: Julian calendar
timestampJulianDate.__init__(): ConstructorJulianDate.__float__(): Convert to a
floatJulianDate.datetime(): Convert to a
datetimeJulianDate.offset(): Move a time by
some number of daysJulianDate.__sub__(): Difference
of two Julian datesJulianDate.__cmp__(): Compare two
Julian datesJulianDate.fromDatetime(): Convert a
datetime to a Julian dateclass SiderealTime: Sidereal timeSiderealTime.__init__():
ConstructorSiderealTime.__str__(): Convert to
stringSiderealTime.utc(): Find Universal
TimeSiderealTime.factorB(): Compute
sidereal time factor B (static method)SiderealTime.gst(): Local to
Greenwich siderealSiderealTime.lst(): Greenwich to
local siderealSiderealTime.fromDatetime(): Convert
UTC to GST (static method)class AltAz: Horizon coordinatescoordRotate(): Rotation of spherical
coordinatesclass RADec: Equatorial
coordinatesAbstract
sidereal.py is a Python module to perform certain astronomical
calculations. This document contains and describes the
implementation of the module.
This publication is available in Web form and also as a PDF document.
Please forward any comments to tcc-doc@nmt.edu.
This document contains the source code for the sidereal.py
module. The technique of embedding the code in a document
that explains its function is called literate
programming; see the
author's Lightweight Literate Programming page.
The reader is assumed to be familiar with the Python programming language, including object-oriented programming. Some familiarity with the problem domain—spherical astronomy—will also be useful.
The primary reference is Peter Duffett-Smith's Practical Astronomy with Your Calculator. For a full citation, see the specification.
Other useful online references:
Documentation for Python's math module.
Documentation for Python's datetime module.
Relevant online files:
sidereal.py: The Python
source for the module.
siderealims.xml: The DocBook
source for this document.