MS_SRCNAME(3)

πŸ’– MS_SRCNAME(3) πŸ’–

okay bestie, welcome to libmseed's little naming factory β€” this page is all about ms_srcname, the routine that figures out source names using the SEED naming nomenclature. it's giving "who even am I" but for seismic data records. πŸŽ€


✨ NAME ✨

ms_srcname β€” determine source names using the SEED naming nomenclature. no cap, that's literally its whole job.


🌸 SYNOPSIS 🌸

#include <libmseed.h>

char  *ms_recsrcname ( char *record, char *srcname, flag quality );

char  *msr_srcname ( MSRecord *msr, char *srcname, flag quality );

char  *mst_srcname ( MSTrace *mst, char *srcname, flag quality );

three whole functions, one tiny little vibe. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so these routines generate a source name using the SEED naming nomenclature in the format 'NET_STA_LOC_CHAN' and store it in the buffer you hand over at srcname. and if the quality flag is true? the data quality character gets appended to the source name too, which gives you 'NET_STA_LOC_CHAN_QUAL'. iconic behavior honestly.

⚠️ the memory pointed to by srcname must have enough room for the resulting string, bestie, i'm serious. as of SEED 2.4 that's a maximum of 18 characters including the terminating NULL. the MSRecord and MSTrace structs are capable of producing a source name of 42 characters (including the terminating NULL), and libmseed commonly allocates 50 characters for the srcname buffer. so like... allocate generously, okay? 🫢
  • ms_recsrcname β€” generates a source name string for the SEED data record at record. if the quality flag is true, the quality character will be appended.
  • msr_srcname β€” generates a source name string for the specified MSRecord struct. if the quality flag is true, the quality character will be appended.
  • mst_srcname β€” generates a source name string in for the specified MSTrace struct. if the quality flag is true and mst->dataquality is not zero, the quality character will be appended. yes, it's a two-condition situation, she's high maintenance but she's worth it. 😌

πŸŽ€ LOCATION IDS AND SPACES πŸŽ€

the source name produced by these routines never include spaces. periodt. the fixed format nature of SEED data records leads to blank or unused location IDs represented by spaces, and such blank location IDs will be collapsed to nothing in the resulting source names. so all that empty space just... vanishes. ✨ manifesting that energy for my room ngl.


πŸ’œ RETURN VALUES πŸ’œ

the routines return a pointer to the resulting string, or NULL on error. that's it. that's the whole thing. πŸ’€


πŸ‘‘ AUTHOR πŸ‘‘

Chad Trabant IRIS Data Management Center


and that's a wrap on the Libmseed API era of 2006/11/27, bestie β€” go forth and name your sources, you absolute main character. πŸ’–βœ¨πŸŒΈπŸ¦‹πŸŽ€πŸ’…πŸ«Ά