MST_ADDMSR(3)
π MST_ADDMSR(3) β the libmseed girlies' guide to feeding your MSTrace π
okay bestie, so this is a page from the Library Functions Manual, and it's literally all about the mst_addmsr family β four little functions that glue time coverage and data samples onto MSTrace structures. no cap, it's giving "plumbing but make it cute" π«Ά
β¨ NAME β¨
mst_addmsr β adds time coverage and data samples to MSTrace structures. that's it, that's the vibe π
πΈ SYNOPSIS πΈ
#include <libmseed.h>
int *mst_addmsr ( MSTrace *mst, MSRecord *msr, flag whence );
int mst_addspan ( MSTrace *mst, hptime_t starttime, hptime_t endtime,
void *datasamples, int64_t numsamples,
char sampletype, flag whence );
MSTrace *mst_addmsrtogroup ( MSTraceGroup *mstg, MSRecord *msr,
flag dataquality, double timetol,
double sampratetol );
MSTrace *mst_addtracetogroup ( MSTraceGroup *mstg, MSTrace *mst );
likeβ¦ four functions, four signatures, all of them iconic in their own way β¨
π¦ DESCRIPTION π¦
so these routines are basically different flavors of "add time coverage to your MSTrace objects". and a very common way to organize MSTrace objects is with a MSTraceGroup β think of it like a group chat but for traces π¬. and mst_addmsrtogroup is the convenience queen that lets you add MSRecord data into a MSTraceGroup while hiding, like, so many of the messy details of MSTrace matching and bookkeeping. she does the admin work for you, periodt π
mst_addmsr adds the time coverage from a MSRecord to a MSTrace. the start or end time gets updated, and data samples get copied if they exist. and here's the tea: no checking is done to verify that the record matches the trace in any way. none. zero. it's giving "trust fall" π. if whence is 1, the MSRecord coverage gets added at the end of the MSTrace. if whence is 2, the MSRecord coverage gets added at the beginning of the MSTrace.
mst_addspan does the exact same thing as msr_addmsr except that time coverage and data samples are explicitly provided by you. you'll wanna peek at ms_time(3) for the deets on the high precision epoch time format needed for starttime and endtime. and for how data samples are represented, check the Waveform Data section of ms_intro(3) π.
mst_addmsrtogroup adds time coverage from the specified MSRecord to the first adjacent MSTrace found in the specified MSTraceGroup. if the dataquality flag is true, traces get grouped by quality in addition to the source name identifiers (yes, both, she's thorough π
). mst_findadjacent(3) is used with the specified sample rate and time tolerances to find an adjacent trace β go read mst_findadjacent(3) for further details, iykyk. and if no adjacent MSTrace is found? a brand new MSTrace gets added to the MSTraceGroup. slay, growth mindset π±
mst_addtracetogroup adds a MSTrace structure to a MSTraceGroup structure. the MSTrace is added at the end of the MSTrace chain. simple. clean. iconic.
π RETURN VALUES π
mst_addmsrandmst_addspanreturn0on success and-1on error. that's the whole mood β zero for yes, negative one for nope πmst_addmsrtogroupreturns a pointer to theMSTraceupdated, or0on error.mst_addtracetogroupreturns a pointer to theMSTraceadded, or0on error.
fr fr, watch those0returns on the pointer-returning ones β0here means error, not "a trace that is literally zero". don't get got π
π SEE ALSO π
ms_intro(3), mst_init(3), mst_findadjacent(3) and ms_time(3).
like go read those too, bestie, they're the supporting cast and they ate π
π AUTHOR π
Chad Trabant IRIS Data Management Center
okay and that's the whole page!! written by the libmseed API girlies, dated 2013/05/17, and yeah it's the Libmseed API version of MST_ADDMSR(3). stay hydrated, read your manpages, and remember: no checking is done to verify that the record matches the trace in any way π
β¨π¦
π¦ 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