MS_SPLITSRCNAME(3)
β¨ MS_SPLITSRCNAME β¨
okay bestie, so this is a page from the Library Functions Manual β it's ms_splitsrcname(3), and she's here to help you take a source name apart like it's a lil friendship bracelet π
π NAME π
ms_splitsrcname β splits source names into the SEED naming nomenclature. literally her whole job, no cap π
πΈ SYNOPSIS πΈ
#include <libmseed.h>
char *ms_splitsrcname ( char *srcname, char *net, char * sta,
char * loc, char *chan, char *qual );
π¦ DESCRIPTION π¦
so the ms_splitsrcname routine parses SEED channel naming components out of a source name string, and the format it's expecting is exactly this:
"NET_STA_LOC_CHAN[_QUAL]"
The first four components are required to uniquely identify a SEED channel β generally these are always present in a srcname. The Quality code is normally optional in a source name, so she's the β¨bonusβ¨ one.
The arguments for the first four components (net, sta, loc & chan) are treated as strings, but the quality code (qual) is treated as a pointer to a single character. bestie, one (1) character. that's it.
π«Ά Memory for the requested component strings must already be allocated. she is not gonna allocate anything for you, that's on you, queen.
If a component pointer is NULL it will not be parsed from the string β so you can just be like "no thanks π" to any part you don't want.
Source names in the expected format are created, for example, by the ms_recsrcname(3), msr_srcname(3) and mst_srcname(3) routines. so if you ever wonder where these strings come fromβ¦ them. π
π LOCATION IDS AND SPACES π
The source name should never include spaces. The fixed format nature of SEED data records leads to blank or unused location IDs represented by spaces β and in a source name, such blank location IDs should be collapsed to nothing in the resulting sources names.
A blank location ID is parsed from a source name as an empty string (not two spaces). like, she ate that space and left no crumbs π
π EXAMPLES π
This usage will result in net="IU", sta="ANMO", loc="00", chan="BHZ" and qual will remain unchanged (because it was not contained in the input srcname):
ms_splitsrcname("IU_ANMO_00_BHZ", net, sta, loc, chan, qual);
This usage will limit the parsing to only the network and station components, with net="IU", sta="ANMO":
ms_splitsrcname("IU_ANMO_00_BHZ", net, sta, NULL, NULL, NULL);
The following usage illustrates a blank location ID and an included quality code:
ms_splitsrcname("IU_ANMO__BHZ_Q", net, sta, loc, chan, qual);
The result is:
net = "IU"
sta = "ANMO"
loc = ""
chan = "BHZ"
qual = 'Q'
the double underscore is doing the heavy lifting there and she's serving exactly what she's supposed to serve π
β RETURN VALUES β
Return 0 on success and -1 on error. short, sweet, iconic.
π SEE ALSO π
ms_recsrcname(3), msr_srcname(3) and mst_srcname(3).
π AUTHOR π
Chad Trabant IRIS Data Management Center
and that's the whole page bestie!! this dropped on 2009/12/19, and it's part of the Libmseed API β go forth and split those source names, you absolute main character π«Άβ¨
π¦ 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