MSR_NORMALIZE_HEADER(3)

DESCRIPTION
Normalize or synchronize the header fields of an MSRecord structure.

SYNOPSIS
#include <libmseed.h>
int  msr_normalize_header ( MSRecord *msr, flag verbose);

DESCRIPTION
msr_normalize_header updates the SEED structures associated with an MSRecord structure (MSRecord.fsdh and the blockette chain at MSRecord.blkts) with primary values stored at the MSRecord level (e.g. MSRecord.starttime, MSRecord.samprate, etc.). The long explanation is that certain key values (start time, sample rate, etc.) are duplicated in a given MSRecord structure. For example the start time is stored at both MSRecord.starttime and 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 these values must be translated back into the SEED structures. For these duplicated values the msr_normalize_header routine peforms this translation. Normally this routine will be called via internal functions when msr_pack is called, it could also be used to synchronize the header values when they are directly modified.

RETURN VALUE
msr_normalize_header returns the header length in bytes on success and -1 on error.

SEE ALSO
ms_intro(3), msr_pack(3) and msr_pack_header(3).

AUTHOR
Chad Trabant
IRIS Data Management Center