histastro.datetime module

Date and time functions for HistAstro.

histastro.datetime.DeltaT(jd)[source]

Return the value of DeltaT through interpolation.

For the date range -700 - now, the value for Delta T is obtained by interpolation of known historical

values. Outside this range, a lenghtening of the day of 1.8 ms/century is assumed, as well as that the minimum of the parabola is DeltaT=12s in 1820.

Parameters:

jd (float) – Julian day (days).

Returns:

Delta T (s).

Return type:

float

References

histastro.datetime.DeltaT1820(jd)[source]

Return a rough estimate for the value of Delta T.

A lenghtening of the day of 1.8 ms/century is assumed, as well as and that the minimum of the parabola is DeltaT=12s in 1820.

Parameters:

jd (float) – Julian day (days).

Returns:

Delta T (s).

Return type:

float

References

histastro.datetime.gmst(jd)[source]

Calculate Greenwich Mean Sidereal Time for any instant, in radians.

Parameters:

jd (float) – Julian day (days).

Returns:

gmst: Greenwich mean sidereal time (rad).

Return type:

float

References

  • Explanatory Supplement to the Astronomical Almanac, 3rd ed, Eq. 6.66 (2012).

histastro.datetime.jd2cal(jd, julian=None)[source]

Compute the calendar date from a given Julian Day.

Notes

  • Date and time are expressed in UT.

  • Decimals can be returned in the day to indicate the time of day, e.g. 1.0 for midnight and 1.5 for noon on the first day of the month.

Parameters:
  • jd (float) – Julian day (days).

  • julian (bool) – Force Julian (True) or Gregorian calendar (False). Default: None: Julian before 1583, else Gregorian.

Returns:

Tuple containing (year, month, day):

  • year (int): Year CE (UT). Note that year=0 indicates 1 BCE.

  • month (int): Month number of year (UT; 1-12).

  • day (float): Day of month with fraction (UT; 1.0-31.999).

Return type:

tuple (int,int,float)

histastro.datetime.jd2tjc(jd)[source]

Compute the time in Julian centuries since 2000.0.

Parameters:

jd (float) – Julian day (days).

Returns:

tjc: Time in Julian centuries since 2000.0 (UT).

Return type:

float

histastro.datetime.jd2tjm(jd)[source]

Compute the time in Julian millennia since 2000.0.

Parameters:

jd (float) – Julian day (days).

Returns:

tjm: Time in Julian millennia since 2000.0 (UT).

Return type:

float

histastro.datetime.jd2year(jd)[source]

Compute a year with fraction from a given Julian Day.

Parameters:

jd (float) – Julian day (days).

Returns:

Year CE, with decimals. Note that year=0 indicates 1 BCE.

Return type:

float

histastro.datetime.julianDay(year, month, day, julian=None)[source]

Compute the Julian Day for a given year, month and day.

Notes

  • Date and time are expressed in UT.

  • Decimals can be used in the day to take into account the time of day other than midnight, e.g. 1.5 for noon on the first day of the month.

Parameters:
  • year (int) – Year CE (UT). Note that year=0 = 1 BCE.

  • month (int) – Month number of year (UT; 1-12).

  • day (float) – Day of month with fraction (UT; 1.0-31.999).

  • julian (bool) – Force Julian (True) or Gregorian calendar (False). Default: None: Julian before 1583, else Gregorian.

Returns:

jd: Julian day (days).

Return type:

float