MST_GROUPSORT(3)

πŸ’– MST_GROUPSORT(3) πŸ’–

okay bestie, welcome to mst_groupsort(3) β€” it lives in the Library Functions Manual and it's literally here to wrangle your MSTrace segments inside a MSTraceGroup. yes, the whole group chat. let's get into it 🫢


✨ NAME ✨

mst_groupsort β€” Manipulate MSTrace segments in a MSTraceGroup. she sorts, she heals, she's the group mom fr fr πŸ’…


🌸 SYNOPSIS 🌸

#include <libmseed.h>

MSTrace  *mst_groupsort ( MSTraceGroup *mstg, flag quality );

MSTrace  *mst_groupheal ( MSTraceGroup *mstg, double timetol,
                          double sampratetol );

πŸ¦‹ DESCRIPTION πŸ¦‹

the sort one πŸŽ€

mst_groupsort will sort the MSTrace segments in a MSTraceGroup, and the way it does it is so extra, I'm obsessed. the order is:

  1. first on the source name (as returned by mst_srcname)
  2. then on start time
  3. then on descending end time
  4. and finally on sample rate

and the quality flag? it's passed directly to mst_srcname, so it controls the addition of the quality indicator to the source name β€” which means it also controls the addition of sorting on the quality indicator. but lowkey only if the MSTrace has an associated quality, okay? see mst_srcname(3) for more details. iykyk ✨

the heal one 🧚

mst_groupheal will attempt to heal MSTrace segments in a MSTraceGroup if they fit within the specified time and sample rate tolerance (timetol and sampratetol respectively). it's giving group therapy for your traces πŸ’–

this is useful when, for whatever reason, the MSTraceGroup has separate MSTrace segments which belong together. and ngl, this usually only happens when data is added to a MSTraceGroup in random data time order β€” chaos behavior, truly 😭

before attempting to heal the MSTraces, the MSTraceGroup will be sorted using mst_groupsort. so it sorts first, heals second. main character sequence fr.

okay so the defaults, listen up: - if sampratetol is -1.0, the default tolerance of abs(1-sr1/sr2) is used. - if timetol is -1.0, the default time tolerance of 1/2 the sample period will be used.

πŸ‘‘ RETURN VALUES πŸ‘‘

  • mst_groupsort returns 0 on success and -1 on error. iconic, zero drama.
  • mst_groupheal returns the number of MSTrace segments merged on success and -1 on error. periodt. πŸ’…

🌈 SEE ALSO 🌈

ms_intro(3) and mst_srcname(3). go read them bestie, they're right there 🫢


⭐ AUTHOR ⭐

Chad Trabant IRIS Data Management Center


and that's the whole page, no cap. this little baddie comes to you from the Libmseed API, dated 2007/04/12 β€” so she's vintage but she still ate πŸ’œβœ¨