Utility Functions

Note

The functions in this module are not in the coord namespace. They are in the coord.util namespace. To use them, you need to write, e.g.:

jd = coord.util.date_to_julian_day(datetime.datetime.now())
coord.util.sun_position_ecliptic(date)[source]

Helper routine to calculate the position of the sun in ecliptic coordinates given a python datetime object.

It is most precise for dates between 1950-2050, and is based on

Parameters

date – The date as either a datetime.datetime instance or a datetime.date instance.

:returns the angular position of the sun along the ecliptic.

coord.util.date_to_julian_day(date)[source]

Helper routine to return the Julian day for a given date.

If date is a datetime.datetime instance, then it uses the full time info. If date is a datetime.date, then it does the calculation for noon of that day.

Returns

the (possibly fractional) Julian day for the given date.

coord.util.ecliptic_obliquity(epoch)[source]

Helper routine to return the obliquity of the ecliptic for a given date.

Parameters

epoch – The epoch at which to calculate the obliquity.

:returns the obliquity as an Angle instance