![]() |
SuperNOVAS v1.3
The NOVAS C library, made better
|
Functions | |
int | cal_date (double tjd, short *restrict year, short *restrict month, short *restrict day, double *restrict hour) |
double | julian_date (short year, short month, short day, double hour) |
double | novas_jd_from_date (enum novas_calendar_type calendar, int year, int month, int day, double hour) |
int | novas_jd_to_date (double tjd, enum novas_calendar_type calendar, int *restrict year, int *restrict month, int *restrict day, double *restrict hour) |
Various functions to convert between calendar date and Julian days.
int cal_date | ( | double | tjd, |
short *restrict | year, | ||
short *restrict | month, | ||
short *restrict | day, | ||
double *restrict | hour | ||
) |
This function will compute a broken down date on the astronomical calendar for given the Julian day input. Input Julian day can be based on any UT-like time scale (UTC, UT1, TT, etc.) - output time value will have same basis.
NOTES:
The Gregorian calendar was introduced on 15 October 1582 only (corresponding to 5 October of the previously used Julian calendar). Prior to it this function returns Julian/Roman calendar dates, e.g. the day before the reform is 1582 October 4. You can use novas_id_to_calendar()
instead to convert JD days to dates in specific calendars.
REFERENCES:
tjd | [day] Julian date | |
[out] | year | [yr] Astronomical calendar year. It may be NULL if not required. B.C. years are represented as <=0, i.e. 1 B.C. as 0 and X B.C. as (1 - X) |
[out] | month | [month] Astronomical calendar month [1:12]. It may be NULL if not required. |
[out] | day | [day] Day of the month [1:31]. It may be NULL if not required. |
[out] | hour | [h] Hour of day [0:24]. It may be NULL if not required. |
References NOVAS_ASTRONOMICAL_CALENDAR, and novas_jd_to_date().
double julian_date | ( | short | year, |
short | month, | ||
short | day, | ||
double | hour | ||
) |
Returns the Julian day for a given astronomical calendar date. Input time value can be based on any UT-like time scale (UTC, UT1, TT, etc.) - output Julian day will have the same basis.
NOTES:
The Gregorian calendar was introduced on 1582 October 15 only. Prior to that, astronomical dates are Julian/Roman dates, so the day before the reform was 1582 October 4. You can also use novas_jd_from_date()
to convert dates with more flexibility.
B.C. dates are indicated with years <=0 according to the astronomical and ISO 8601 convention, i.e., X B.C. as (1-X), so 45 B.C. as -44.
REFERENCES:
year | [yr] Astronomical calendar year. B.C. years can be simply represented as <=0, e.g. 1 B.C. as 0, and X B.C. as (1 - X). |
month | [month] Astronomical calendar month [1:12] |
day | [day] Astronomical day of month [1:31] |
hour | [hr] Hour of day [0:24] |
References NOVAS_ASTRONOMICAL_CALENDAR, and novas_jd_from_date().
double novas_jd_from_date | ( | enum novas_calendar_type | calendar, |
int | year, | ||
int | month, | ||
int | day, | ||
double | hour | ||
) |
Returns the Julian day for a given calendar date. Input time value can be based on any astronomical time scale (UTC, UT1, TT, etc.) - output Julian date will have the same basis.
The input date is the conventional calendar date, affected by the Gregorian calendar reform of 1582. Thus, the input date is for the Gregorian calendar for dates starting 15 October 1582, and for the Julian (Roman) calendar (introduced in 45 B.C.) for dates prior to that.
NOTES:
B.C. dates are indicated with years <=0 according to the astronomical and ISO 8601 convention, i.e., X B.C. as (1-X), so 45 B.C. as -44.
REFERENCES:
calendar | The type of calendar to use: NOVAS_ASTRONOMICAL_CALENDAR, NOVAS_GREGORIAN_CALENDAR, or NOVAS_ROMAN_CALENDAR. |
year | [yr] Calendar year. B.C. years can be simply represented as negative years, e.g. 1 B.C. as -1. |
month | [month] Calendar month [1:12] |
day | [day] Day of month [1:31] |
hour | [hr] Hour of day [0:24] |
References NOVAS_ASTRONOMICAL_CALENDAR, NOVAS_GREGORIAN_CALENDAR, NOVAS_JD_START_GREGORIAN, and NOVAS_ROMAN_CALENDAR.
int novas_jd_to_date | ( | double | tjd, |
enum novas_calendar_type | calendar, | ||
int *restrict | year, | ||
int *restrict | month, | ||
int *restrict | day, | ||
double *restrict | hour | ||
) |
This function will compute a broken down date on the specified calendar for given the Julian day input. Input Julian day can be based on any astronomical time scale (UTC, UT1, TT, etc.) - output time value will have same basis.
NOTES:
REFERENCES:
tjd | [day] Julian day. | |
calendar | The type of calendar to use: NOVAS_ASTRONOMICAL_CALENDAR, NOVAS_GREGORIAN_CALENDAR, or NOVAS_ROMAN_CALENDAR. | |
[out] | year | [yr] Calendar year. B.C. years are represented as negative values, e.g. -1 corresponds to 1 B.C. It may be NULL if not required. |
[out] | month | [month] Calendar month [1:12]. It may be NULL if not required. |
[out] | day | [day] Day of the month [1:31]. It may be NULL if not required. |
[out] | hour | [h] Hour of day [0:24]. It may be NULL if not required. |
References NOVAS_ASTRONOMICAL_CALENDAR, NOVAS_GREGORIAN_CALENDAR, NOVAS_JD_START_GREGORIAN, and NOVAS_ROMAN_CALENDAR.