Next / Previous / Contents / TCC Help System / NM Tech homepage

Table of Contents

1. Introduction
2. Coordinate systems used
2.1. Terrestrial coordinates
2.2. Altazimuth coordinates
2.3. Equatorial coordinates
3. Standalone scripts
3.1. Specifying dates and times on command lines
3.2. Specifying angles on command lines
3.3. Specifying latitude and longitude on command lines
3.4. Specifying hours on command lines
3.5. jd: Convert to Julian date
3.6. conjd: Convert from Julian date
3.7. rdaa: Equatorial to horizon coordinates
3.8. aard: Horizon to equatorial coordinates
4. Constants
5. Functions
5.1. hoursToRadians(): Convert hours to radians
5.2. radiansToHours(): Convert radians to hours
5.3. hourAngleToRA(): Convert an hour angle to right ascension
5.4. raToHourAngle(): Convert a right ascension to an hour angle
5.5. dayNo(): Date to day number
5.6. parseDatetime(): Parse external date/time
5.7. parseDate(): Parse external date
5.8. parseTime(): Parse external time
5.9. parseAngle(): Parse external angle
5.10. parseLat(): Parse latitude
5.11. parseLon(): Parse longitude
5.12. parseHours(): Parse a quantity in hours
6. class MixedUnits: Handling mixed unit systems
6.1. MixedUnits.__init__(): Constructor
6.2. MixedUnits.mixToSingle(): Convert mixed units to a single value
6.3. MixedUnits.singleToMix(): Convert a single value to mixed units
6.4. MixedUnits.format(): Format with truncation
7. dmsUnits: Converter to and from degrees, minutes, and seconds
8. class LatLon: Terrestrial position
8.1. LatLon.__init__(): Constructor
8.2. LatLon.__str__(): Convert to a string
9. class JulianDate: Julian date and time
9.1. JulianDate.__init__(): Constructor
9.2. JulianDate.__float__(): Convert to float
9.3. JulianDate.datetime(): Convert to a datetime instance
9.4. JulianDate.offset(): Move a time by some number of days
9.5. JulianDate.__sub__(): Find the difference between two times
9.6. JulianDate.__cmp__(): Comparison
9.7. JulianDate.fromDatetime(): Convert a datetime
10. class SiderealTime
10.1. SiderealTime.__init__(): Constructor
10.2. SiderealTime.__str__(): Convert to a string
10.3. SiderealTime.utc(): Find Universal Time
10.4. SiderealTime.gst(): Local Sidereal Time to Greenwich Sidereal Time
10.5. SiderealTime.lst(): Greenwich Sidereal Time to Local Sidereal Time
10.6. SiderealTime.fromDatetime(): Convert UTC to GST
11. class AltAz: Horizon coordinates
11.1. AltAz.__init__(): Constructor
11.2. AltAZ.raDec(): Convert horizon to equatorial coordinates
11.3. AltAz.__str__(): Convert to a string
12. class RADec: Equatorial coordinates
12.1. RADec.__init__(): Constructor
12.2. RADec.hourAngle(): Find the hour angle of an equatorial coordinate
12.3. RADec.altAz(): Convert to horizon coordinates
12.4. RADec.__str__(): Convert to a string

Abstract

This document describes sidereal.py, a Python module to perform spherical geometry calculations for astronomical applications.

This publication is available in Web form and also as a PDF document. Please forward any comments to tcc-doc@nmt.edu.

1. Introduction

The sidereal.py package is designed to do a few of the simpler astronomical calculations. The mathematical basis of these calculations comes from spherical trigonometry.

Here is the source for formulae used in this package:

Duffett-Smith, Peter. Practical astronomy with your calculator. Second edition. Cambridge, 1981, ISBN 0-521-28411-2.

The reader is assumed to know the Python programming language.

Caution

All astronomical computations are approximations. Refer to Duffett-Smith's book for a discussion of the limitations of these formulae. In particular, they assume that the Earth is a sphere, which it isn't quite.

The actual implementation of this module is shown in the companion document, sidereal.py: Internal maintenance specification, in lightweight literate programming form.