libmseed 3.1.3
The miniSEED data format library
|
Utilities for handling leap seconds. More...
Data Structures | |
struct | LeapSecond |
Leap second list container. More... | |
Functions | |
int | ms_readleapseconds (const char *envvarname) |
Read leap second file specified by an environment variable. | |
int | ms_readleapsecondfile (const char *filename) |
Read leap second from the specified file. | |
Variables | |
LeapSecond * | leapsecondlist |
Utilities for handling leap seconds.
The library contains functionality to load a list of leap seconds into a global list, which is then used to determine when leap seconds occurred, ignoring any flags in the data itself regarding leap seconds. This is useful as past leap seconds are well known and leap second indicators in data are, historically, more often wrong than otherwise.
The library uses the leap second list (and any flags in the data, if no list is provided) to adjust the calculated time of the last sample in a record. This allows proper merging of continuous series generated through leap seconds.
Normally, calling programs do not need to do any particular handling of leap seconds after loading the leap second list.
struct LeapSecond |
Leap second list container.
Data Fields | ||
---|---|---|
nstime_t | leapsecond | Time of leap second as epoch since 1 January 1900. |
int32_t | TAIdelta | TAI-UTC difference in seconds. |
struct LeapSecond * | next | Pointer to next entry, NULL if the last. |
|
extern |
Read leap second file specified by an environment variable.
Leap seconds are loaded into the library's global leapsecond list.
[in] | envvarname | Environment variable that identifies the leap second file |
-1 | on file read error |
-2 | when the environment variable is not set |
MessageOnError - this function logs a message on error
|
extern |
Read leap second from the specified file.
Leap seconds are loaded into the library's global leapsecond list.
The file is expected to be in NTP leap second list format. Some locations where this file can be obtained are indicated in RFC 8633 section 3.7: https://www.rfc-editor.org/rfc/rfc8633.html#section-3.7
[in] | filename | File containing leap second list |
-1 | on error |
MessageOnError - this function logs a message on error
|
extern |
Global leap second list