Skip to content

Commit 445fb49

Browse files
Fix documentation, add notes about a trace list limitations
1 parent 8d8725d commit 445fb49

File tree

4 files changed

+40
-38
lines changed

4 files changed

+40
-38
lines changed

doc/examples.dox

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ An input file of miniSEED is used as a convenient data source.
8484
::MS3Record containers can be constructed for any arbitrary data and
8585
follow the same pattern of record generation.
8686

87+
@note The ::MS3TraceList data structure is designed as a container of data
88+
sample payloads (integers, floats, text). A trace list does not contain all of
89+
the details of miniSEED records and cannot be used to represent and create
90+
header-only miniSEED records or records with custom header flags.
91+
8792
@include lm_pack_rollingbuffer.c
8893

8994
@section example-lm_sids Working with Source Identifiers

genutils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,7 @@ ms_nstime2time (nstime_t nstime, uint16_t *year, uint16_t *yday, uint8_t *hour,
10341034
*
10351035
* @param[in] nstime Time value to convert
10361036
* @param[out] timestr Buffer for ISO time string
1037+
* @param[in] timestrsize Size of the \a timestr buffer in bytes
10371038
* @param timeformat Time string format, one of @ref ms_timeformat_t
10381039
* @param subseconds Inclusion of subseconds, one of @ref ms_subseconds_t
10391040
*

libmseed.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,8 @@ typedef struct MS3RecordList
556556
557557
Trace lists are a container to organize continuous segments of
558558
data. By combining miniSEED data records into trace lists, the
559-
time series is reconstructed and ready for processing or
560-
summarization.
559+
time series is reconstructed and ready for processing, conversion,
560+
summarization, etc.
561561
562562
A trace list container starts with an ::MS3TraceList, which
563563
contains one or more ::MS3TraceID entries, which each contain one
@@ -576,6 +576,10 @@ typedef struct MS3RecordList
576576
- ...
577577
- ...
578578
579+
@note A trace list does not contain all of the details of a miniSEED
580+
record. In particular details that are not relevant to represent the series
581+
such as header flags, extra headers like event detections, etc.
582+
579583
\sa ms3_readtracelist()
580584
\sa ms3_readtracelist_timewin()
581585
\sa ms3_readtracelist_selection()

tracelist.c

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -712,53 +712,45 @@ _mstl3_addmsr_impl (MS3TraceList *mstl, const MS3Record *msr, MS3RecordPtr **ppr
712712
/** ************************************************************************
713713
* @brief Add data coverage from an ::MS3Record to a ::MS3TraceList
714714
*
715-
* Searching the list for the appropriate ::MS3TraceID and
716-
* ::MS3TraceSeg and either add data to existing entries or create new
717-
* ones as needed.
718-
*
719-
* As this routine adds data to a trace list it constructs continuous
720-
* time series, merging segments when possible. The \a tolerance
721-
* pointer to a ::MS3Tolerance identifies function pointers that are
722-
* expected to return time tolerance, in seconds, and sample rate
723-
* tolerance, in Hertz, for the given ::MS3Record. If \a tolerance is
724-
* NULL, or the function pointers it identifies are NULL, default
725-
* tolerances will be used as follows: - Default time tolerance is 1/2
726-
* the sampling period - Default sample rate (sr) tolerance is
715+
* Searching the list for the appropriate ::MS3TraceID and ::MS3TraceSeg and
716+
* either add data to existing entries or create new ones as needed.
717+
*
718+
* As this routine adds data to a trace list it constructs continuous time
719+
* series, merging segments when possible. The \a tolerance pointer to a
720+
* ::MS3Tolerance identifies function pointers that are expected to return time
721+
* tolerance, in seconds, and sample rate tolerance, in Hertz, for the given
722+
* ::MS3Record. If \a tolerance is NULL, or the function pointers it identifies
723+
* are NULL, default tolerances will be used as follows: - Default time
724+
* tolerance is 1/2 the sampling period - Default sample rate (sr) tolerance is
727725
* abs(1‐sr1/sr2) < 0.0001
728726
*
729-
* In recommended usage, the \a splitversion flag is \b 0 and
730-
* different publication versions of otherwise matching data are
731-
* merged. If more than one version contributes to a given source
732-
* identifier's segments, its ::MS3TraceID.pubversion will be the set to
733-
* the largest contributing version. If the \a splitversion flag is
734-
* \b 1 the publication versions will be kept separate with each
735-
* version isolated in separate ::MS3TraceID entries.
736-
*
737-
* If the \a autoheal flag is true, extra processing is invoked to
738-
* conjoin trace segments that fit together after the ::MS3Record
739-
* coverage is added. For segments that are removed, any memory at
740-
* the ::MS3TraceSeg.prvtptr will be freed.
741-
*
742-
* The lists are always maintained in a sorted order. An
743-
* ::MS3TraceList is maintained with the ::MS3TraceID entries in
744-
* ascending alphanumeric order of SID. If repeated SIDs are present
745-
* due to splitting on publication version, they are maintained in
746-
* order of ascending version. A ::MS3TraceID is always maintained
747-
* with ::MS3TraceSeg entries in data time time order.
727+
* In recommended usage, the \a splitversion flag is \b 0 and different
728+
* publication versions of otherwise matching data are merged. If more than one
729+
* version contributes to a given source identifier's segments, its
730+
* ::MS3TraceID.pubversion will be the set to the largest contributing version.
731+
* If the \a splitversion flag is \b 1 the publication versions will be kept
732+
* separate with each version isolated in separate ::MS3TraceID entries.
733+
*
734+
* @note The ::MS3TraceList data structure is designed as a container of data
735+
* sample payloads (integers, floats, text) unrelated to miniSEED records. Many
736+
* of the details in a miniSEED record that are not relevant to represent the
737+
* series are not stored in the trace list, and therefore, will not be included
738+
* in an output such as miniSEED produced by mstl3_pack().
739+
*
740+
* While header-only miniSEED records, with no data payload, can be added to a
741+
* trace list they will be represented as empty segments with no time coverage
742+
* for informational purposes.
748743
*
749744
* @param[in] mstl Destination ::MS3TraceList to add data to
750745
* @param[in] msr ::MS3Record containing the data to add to list
751-
* @param[in] pprecptr Pointer to pointer to a ::MS3RecordPtr for @ref record-list
752746
* @param[in] splitversion Flag to control splitting of version/quality
753747
* @param[in] autoheal Flag to control automatic merging of segments
754748
* @param[in] flags Flags to control optional functionality (unused)
755749
* @param[in] tolerance Tolerance function pointers as ::MS3Tolerance
756750
*
757751
* @returns a pointer to the ::MS3TraceSeg updated or NULL on error.
758752
*
759-
* \sa mstl3_addmsr_recordptr()
760-
* \sa mstl3_readbuffer()
761-
* \sa ms3_readtracelist()
753+
* \sa mstl3_addmsr_recordptr() \sa mstl3_readbuffer() \sa ms3_readtracelist()
762754
*
763755
* \ref MessageOnError - this function logs a message on error
764756
***************************************************************************/
@@ -770,7 +762,7 @@ mstl3_addmsr (MS3TraceList *mstl, const MS3Record *msr, int8_t splitversion, int
770762
}
771763

772764
/** ************************************************************************
773-
* @copydoc mstl3_pack()
765+
* @copydoc mstl3_addmsr()
774766
*
775767
* This function is identical to mstl3_addmsr() but with the additional \a
776768
* pprecptr parameter:

0 commit comments

Comments
 (0)