MSR_STARTTIME(3)
π MSR_STARTTIME π
okay bestie, gather round, because we're talking about MSR_STARTTIME(3) from the Library Functions Manual β yes it's a libmseed thing, yes it's about time math, and yes it's lowkey iconic. πβ¨
β¨ NAME β¨
msr_starttime β figuring out the start and end times for MSRecord structures, no cap π
πΈ SYNOPSIS πΈ
#include <libmseed.h>
hptime_t msr_starttime ( MSRecord *msr );
hptime_t msr_starttime_uc ( MSRecord *msr );
hptime_t msr_endtime ( MSRecord *msr );
π DESCRIPTION π
π¦ msr_starttime
msr_starttime hands you back the start time of the record as a high precision epoch time (peep ms_time(3) for the deets π«Ά). Any time correction that's sitting in the fixed section data header gets applied β but only if it hasn't already been applied, we're not out here double-correcting. And if Blockette 1001 is included and parsed, those microseconds it's carrying (field 4, bestie) get applied too. β¨
NOTE: the record start time for aMSRecordstructure is literally right there atMSRecord.starttime. Libmseed based programs should use that start time whenever possible β like, whenever, fr fr. (Fun fact:msr_unpackusesmsr_starttimeto setMSRecord.starttime.) π
π msr_starttime_uc
msr_starttime_uc is the msr_starttime girlie who applies zero time corrections. It's just a basic conversion of the start time values in the fixed section data header. Simple. Clean. No drama. π
π msr_endtime
msr_endtime returns the time of the last sample in the record as a high precision epoch time (seed ms_time(3)). And bestie, listen β this is not the time "covered" by the last sample, it's the actual sample time. Important distinction, don't let anyone tell you otherwise. π
The way it works: it calculates the record start time with msr_starttime, then adds the time covered by the samples in the record, which it works out from the number of samples and the sample rate. Math ate. π₯
msr_endtime will also adjust the end time appropriately if the record is known to contain a positive leap second. If ms_readleapseconds or ms_readleapsecondfile have been called to read a leap second file into an internal list, that list gets checked so it knows when leap seconds occur. And if a leap second list is not available? No worries β the fixed section data header gets checked for a positive leap second indicator instead. π§
β RETURN VALUES β
msr_starttime, msr_starttime_uc and msr_endtime all return a high precision epoch time when things go right, and HPTERROR when they don't. π
π SEE ALSO π
ms_intro(3), ms_time(3) and msr_unpack(3) β go read them, iykyk π
π«Ά AUTHOR π«Ά
Chad Trabant IRIS Data Management Center
and that's the whole page, bestie!! this one's from the Libmseed API, dated 2015/03/02 β vintage but still slaying π stay precise, stay corrected, and remember: HPTERROR is not a personality trait πΈπ
π¦ where this page comes from
- debian bookworm: libmseed-doc 2.19.8-1 Β· LGPL-3.0-or-later
- debian trixie: libmseed-doc 2.19.8-1 Β· LGPL-3.0-or-later
- fedora 43: libmseed-devel 2.19.5-21.fc43 Β· LGPL-3.0-or-later
- fedora 43: libmseed-devel 2.19.5-21.fc43 Β· LGPL-3.0-or-later
- fedora 44: libmseed-devel 2.19.5-22.fc44 Β· LGPL-3.0-or-later
- fedora 44: libmseed-devel 2.19.5-22.fc44 Β· LGPL-3.0-or-later
- ubuntu jammy: libmseed-doc 2.19.6-3 Β· LGPL-3.0-or-later
- ubuntu noble: libmseed-doc 2.19.8-1ubuntu2 Β· LGPL-3.0-or-later
- ubuntu questing: libmseed-doc 2.19.8-1ubuntu2
- ubuntu resolute: libmseed-doc 2.19.8-1ubuntu3 Β· LGPL-3.0-or-later
- ubuntu stonking: libmseed-doc 2.19.8-1ubuntu3 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms