|
TECA
The Toolkit for Extreme Climate Analysis
|
A threadsafe port of the calcalcs library. More...
Functions | |
| TECA_EXPORT int | set_current_calendar (const char *calendar, const char *units) |
| TECA_EXPORT int | is_leap_year (const char *calendar, const char *units, int year, int &leap) |
| TECA_EXPORT int | days_in_month (const char *calendar, const char *units, int year, int month, int &dpm) |
| TECA_EXPORT int | date (double val, int *year, int *month, int *day, int *hour, int *minute, double *second, const char *dataunits, const char *calendar_name) |
| TECA_EXPORT int | coordinate (int year, int month, int day, int hour, int minute, double second, const char *user_unit, const char *calendar_name, double *value) |
A threadsafe port of the calcalcs library.
| TECA_EXPORT int teca_calcalcs::coordinate | ( | int | year, |
| int | month, | ||
| int | day, | ||
| int | hour, | ||
| int | minute, | ||
| double | second, | ||
| const char * | user_unit, | ||
| const char * | calendar_name, | ||
| double * | value | ||
| ) |
given a year, month, day, hour, minute, second and calendar find the floating point offset. returns 0 upon success.
| TECA_EXPORT int teca_calcalcs::date | ( | double | val, |
| int * | year, | ||
| int * | month, | ||
| int * | day, | ||
| int * | hour, | ||
| int * | minute, | ||
| double * | second, | ||
| const char * | dataunits, | ||
| const char * | calendar_name | ||
| ) |
Given a floating point offset in the given calendar return year, month, day, hour, minute, seconds. returns 0 upon success.
| TECA_EXPORT int teca_calcalcs::days_in_month | ( | const char * | calendar, |
| const char * | units, | ||
| int | year, | ||
| int | month, | ||
| int & | dpm | ||
| ) |
Returns the days per month for the given year/month. Note that during the month that transitions from a Julian to a Gregorian calendar, this might be a strange number of days. this wraps ccs_dpm such that initialization is automatically handled and optimizes for repeat calls. returns 0 on success.
| TECA_EXPORT int teca_calcalcs::is_leap_year | ( | const char * | calendar, |
| const char * | units, | ||
| int | year, | ||
| int & | leap | ||
| ) |
Determine if the specified year is a leap year in the specified calendar. this wraps ccs_isleap such that initialization is automatically handled and optimizes for repeat calls.
| TECA_EXPORT int teca_calcalcs::set_current_calendar | ( | const char * | calendar, |
| const char * | units | ||
| ) |
high level thread safe initialize the library and select a calendar to use in subsequent calls. return 0 upon success