1MSR_STARTTIME(3)           Library Functions Manual           MSR_STARTTIME(3)
2
3
4

NAME

6       msr_starttime  -  Start  and end time determination for MSRecord struc‐
7       tures
8
9

SYNOPSIS

11       #include <libmseed.h>
12
13       hptime_t  msr_starttime ( MSRecord *msr );
14
15       hptime_t  msr_starttime_uc ( MSRecord *msr );
16
17       hptime_t  msr_endtime ( MSRecord *msr );
18
19

DESCRIPTION

21       msr_starttime returns the start time of the record as a high  precision
22       epoch  time  (see  ms_time(3)).  Any time correction given in the fixed
23       section data header is applied if it has not already been applied.   If
24       Blockette 1001 is included and parsed the microseconds indicated (field
25       4) are also applied.
26
27       NOTE: The record start time  for  a  MSRecord  structure  is  available
28       directly  at  MSRecord.starttime.   Libmseed  based programs should use
29       that start time whenever possible (msr_unpack uses msr_starttime to set
30       MSRecord.starttime).
31
32       msr_starttime_uc  is  a  version  of msr_starttime that applies no time
33       corrections, just a basic conversion of the start time  values  in  the
34       fixed section data header.
35
36       msr_endtime returns the time of the last sample in the record as a high
37       precision epoch time (seed ms_time(3)).  This is *not* the  time  "cov‐
38       ered"  by  the  last sample, but the actual sample time.  This function
39       calculates the record start time with msr_starttime and then  adds  the
40       time  covered by the samples in the record which is calculated from the
41       number of samples and sample rate.
42
43       msr_endtime will adjust the end time appropriately  if  the  record  is
44       known  to contain a positive leap second.  If the ms_readleapseconds or
45       ms_readleapsecondfile routines have been called to read a  leap  second
46       file  into  an internal list, it will be checked to know when leap sec‐
47       onds occur.  If a leap second list is not available the  fixed  section
48       data header is checked for a positive leap second indicator.
49
50

RETURN VALUES

52       msr_starttime, msr_starttime_uc and msr_endtime return a high precision
53       epoch time on success and HPTERROR on error.
54
55

SEE ALSO

57       ms_intro(3), ms_time(3) and msr_unpack(3)
58
59

AUTHOR

61       Chad Trabant
62       IRIS Data Management Center
63
64
65
66Libmseed API                      2015/03/02                  MSR_STARTTIME(3)
Impressum