Module API

Much of this is still missing docstrings, so this is just a rough overview.

If you need help, just shoot me a quick mail to <leslie.polzer@gmx.net> with questions.

Data computation

These functions take an optional Julian day (defaulting to the current point in time) and optional longitudes and latitudes, the latter of which are used for rise/set calculations. You only need to pass latitude and longitude if you want the function’s result to include rise/set data. If you do so, you must pass both latitude and longitude.

The return value of these functions is an OrderedDict.

cerridwen.compute_sun_data(jd=None, observer=None)

Collect data for the sun.

Parameters:
  • jd (float or None) – reference date as Julian day, defaults to jd_now()
  • observer (LatLong or None) – pass the observer position to have the output include rise and set times.
Returns:

a collection of sun data

Return type:

OrderedDict

cerridwen.compute_moon_data(jd=None, observer=None)

Collect data for the moon.

Parameters:
  • jd (float or None) – reference date as Julian day, defaults to jd_now()
  • observer (LatLong or None) – pass the observer position to have the output include rise and set times.
Returns:

a collection of sun data

Return type:

OrderedDict

Date utilities

These functions provide Julian day conversions and printable output.

cerridwen.jd_now()
cerridwen.jd2iso(jd)

Convert a Julian date into an ISO 8601 date string representation