MSTL_INIT(3)

πŸ’– MSTL_INIT(3) β€” Library Functions Manual πŸ’–

okay bestie, welcome to MSTL_INIT(3), the page where we talk about mstl_addmsr and how it slides MSRecord data coverage into an MSTraceList. it's giving library internals, it's giving main character, let's go πŸ¦‹


✨ NAME ✨

mstl_init β€” adding MSRecord data coverage to and MSTraceList structure

(yes the name says mstl_init and the function below is mstl_addmsr, we don't make the rules, we just document them πŸ’…)


🌸 SYNOPSIS 🌸

#include <libmseed.h>

MSTraceSeg *mstl_addmsr ( MSTraceList *mstl, MSRecord *msr,
                          flag dataquality, flag autoheal,
                          double timetol, double sampratetol );

look at her. six arguments. a whole MSTraceSeg * return. iconic πŸ‘‘


πŸ’« DESCRIPTION πŸ’«

so mstl_addmsr takes the data coverage living inside an MSRecord structure and adds it to the MSTraceList structure you point it at. that's the whole vibe. no cap. 🫢

and if data samples are actually hanging out with that MSRecord? they get added to the MSTraceList too. like they're coming along, obviously. 🧚

new MSTraceID and MSTraceSeg sub-structures get created and added into the MSTraceList as needed β€” it just spawns them when it needs them, very self-sufficient of her ⭐

now for the structure tea β˜• every MSTraceList holds a list of trace IDs as MSTraceID structures, and each of those holds a list of time segments as MSTraceSeg structures. this routine keeps the trace ID list in alphanumeric sort order and the time segments that follow in time order. organized. pristine. we love to see it ✨

about that dataquality flag: if it's true, traces get grouped by quality on top of the source name identifiers β€” basically, differentiate using quality or don't, that's the switch πŸŽ€

about that autoheal flag: if it's true, any two trace segments that would fit together because of the new MSRecord coverage getting added will be merged. 🩹

⚠️ the only reason to set autoheal to false (0) is if the prvtptr pointer member of the MSTraceSeg structures is being used β€” because libmseed has zero knowledge of how that data should be merged. so like, don't do it unless you're using prvtptr, fr fr. πŸ’€

πŸ”₯ RETURN VALUES πŸ”₯

  • mstl_addmsr returns NULL on error 😭
  • on success it returns a pointer to the MSTraceSeg structure that the data coverage was added to πŸŽ‰

🌈 SEE ALSO 🌈

mstl_init(3) and mstl_free(3) β€” go read those too, bestie, they're the rest of the friend group πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

Chad Trabant IRIS Data Management Center


and that's the page!! this one's from the <b>Libmseed API</b>, dated <b>2008/11/21</b> β€” vintage but still slaying πŸ’…βœ¨