MSTL_INIT(3)

NAME
mstl_init - Adding MSRecord data coverage to and MSTraceList structure

SYNOPSIS
#include <libmseed.h>

MSTraceSeg *mstl_addmsr ( MSTraceList *mstl, MSRecord *msr,
                          flag dataquality, flag autoheal,
                          double timetol, double sampratetol );

DESCRIPTION
mstl_addmsr adds the data coverage in a MSRecord structure to the specified MSTraceList structure. If data samples are associated with the MSRecord they will also be added to the MSTraceList. New MSTraceID and MSTraceSeg sub-structures will be created and added to the MSTraceList as needed.

Each MSTraceList contains a list of trace IDs as MSTraceID structures each of which contain a list of time segments as MSTraceSeg structures. This routine will maintain the list of trace IDs in alphanumeric sort order and the subsequent time segments in time order.

If the dataquality flag is true traces will be grouped by quality in addition to the source name identifiers, in short differentiate using quality or not.

If the autoheal flag is true any two trace segments which would fit together due to the addition of the new MSRecord coverage will be merged. The only reason to set this option to false (0) is if the prvtptr pointer member of the MSTraceSeg structures is being used since libmseed has no knowledge how such data should be merged.

RETURN VALUES
mstl_addmsr returns NULL on error and a pointer to the MSTraceSeg structure to which the data coverage was added on success.

SEE ALSO
mstl_init(3) and mstl_free(3).

AUTHOR
Chad Trabant
IRIS Data Management Center