MSR_SAMPRATE(3)

πŸ’– MSR_SAMPRATE(3) πŸ’–

ok so bestie, welcome to the msr_samprate page from the Library Functions Manual β€” she's a libmseed girlie and she's about to tell you how to pull a sample rate out of an MSRecord ✨


🌸 NAME 🌸

msr_samprate β€” determine sample rate from an MSRecord structure


πŸŽ€ SYNOPSIS πŸŽ€

#include <libmseed.h>

double  msr_samprate ( MSRecord *msr );

double  msr_nomsamprate ( MSRecord *msr );

πŸ¦‹ DESCRIPTION πŸ¦‹

ok so msr_samprate is the main character here πŸ’… she calculates a double precision sample rate, in samples per second, using the header values sitting inside the MSRecord you hand her.

and here's the tea on how she does it πŸ‘‡ if a Blockette 100 is included, she'll return the "Actual sample rate" (that's field 3 btw), otherwise she'll calculate a nominal sample rate from the sample rate factor and multiplier in the fixed section data header. either way you get your number, no cap 🫢

NOTE: the sample rate for a MSRecord structure is available directly at MSRecord.samplerate. libmseed based programs should use that sample rate whenever possible β€” and yes, that's a real flex, msr_unpack uses msr_samprate to set MSRecord.samplerate 😌 so like, she's literally the blueprint.

and msr_nomsamprate? she's the simpler sister 🌈 she calculates a double precision sample rate in samples per second using the sample rate factor and multiplier in the fixed section data header. that's it, that's the whole vibe, she doesn't do the Blockette 100 thing πŸ™ˆ


⭐ RETURN VALUES ⭐

  • msr_samprate returns a double precision sample rate on success, and -1.0 on error πŸ’€
  • msr_nomsamprate returns a double precision sample rate on success, and -1.0 on error πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

ms_intro(3) and msr_unpack(3). go read those next bestie, iykyk πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

Chad Trabant IRIS Data Management Center


and that's the whole page, gorgeous ✨ this iconic lil manual came to you from the <strong>Libmseed API</strong>, dated <strong>2006/02/27</strong> β€” yeah she's vintage and she ATE πŸŽ€πŸ’– bye bestie, go unpack some records πŸ¦‹