MSR_NORMALIZE_HEADER(3)

πŸ’– MSR_NORMALIZE_HEADER(3) πŸ’–

okay bestie, welcome to the msr_normalize_header page, straight outta the Library Functions Manual πŸŽ€ this one's a libmseed API situation and it's honestly lowkey iconic once you get what it's doing.


✨ NAME ✨

msr_normalize_header β€” Normalize or synchronize the header fields of an MSRecord structure.


🌸 SYNOPSIS 🌸

#include <libmseed.h>

int  msr_normalize_header ( MSRecord *msr, flag verbose);

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, bestie: msr_normalize_header updates the SEED structures that live inside an MSRecord structure β€” that's MSRecord.fsdh and the blockette chain sitting at MSRecord.blkts β€” and it fills them in with the primary values stored up at the MSRecord level (think MSRecord.starttime, MSRecord.samprate, etc.). ✨

The long explanation, since you know I'm gonna give it to you fr fr: certain key values β€” start time, sample rate, the whole squad β€” are duplicated inside a given MSRecord structure. Like, the start time lives at MSRecord.starttime and also in the BTIME structure in the FSDH at MSRecord.fsdh. The base values at the MSRecord level (e.g. MSRecord.starttime) are always the primary values πŸ‘‘. But before the data record can be packed, those values have to be translated back into the SEED structures. And for all these duplicated values, that's literally the job of msr_normalize_header β€” it does the translation. πŸ’…

Normally this routine gets called via internal functions when msr_pack is called, but ngl you can also use it to synchronize the header values when they've been directly modified. 🫢


⭐ RETURN VALUE ⭐

msr_normalize_header returns the header length in bytes on success, and -1 on error. no in-between, it's giving all-or-nothing πŸ’€


🌈 SEE ALSO 🌈

ms_intro(3), msr_pack(3) and msr_pack_header(3). go read those next bestie, they're all connected iykyk 🧚


πŸ‘‘ AUTHOR πŸ‘‘

Chad Trabant IRIS Data Management Center


and that's the whole page, periodt ✨ this was the Libmseed API edition, dated 2007/04/28, so yeah she's an elder but she still eats πŸ’–πŸ¦‹πŸŽ€