Project

General

Profile

Mini-SEED Modifier - perform stream-based Mini-SEED modifications

(man page 2008/12/19)

Synopsis

msmod [options] file1 [file2 file3 ...]

Description

msmod is a general purpose Mini-SEED modification processor. Mini-SEED records are read from each input file and modified as specified and written back out in a serial-manner. Each modification is applied to all processed records.

If '-' is specified standard input will be read. Multiple input files will be processed in the order specified.

The header of each record processed is repacked regardless of selected modifications, this repacking includes normalization of the sampling rate fields (e.g. a factor of 32760 and multiplier of -819 will be converted to a factor of 40 and multiplier of 1). The repacking might also change the offsets to any included blockettes if they were not packed in tight sequence, the order of the blockettes will be preserved.

When a input file is full SEED including both SEED headers and data records all of the headers will be skipped and completely unprocessed.

Options

-V

Print program version and exit.

-h/-H

Print program usage and exit, if -H is specified additional details regarding output to user-defined archive structures (see -A).

-v

Be more verbose. This flag can be used multiple times ("-v -v" or "-vv") for more verbosity.

-s

Print a basic summary including the number of records and the number of samples they included after processing all input records.

-ts time

Limit processing to Mini-SEED records that start after time. The format of the time arguement is: 'YYYY[,DDD,HH,MM,SS,FFFFFF]' where valid delimiters are either commas (,), colons (:) or periods (.).

-te time

Limit processing to Mini-SEED records that end before time. The format of the time arguement is: 'YYYY[,DDD,HH,MM,SS,FFFFFF]' where valid delimiters are either commas (,), colons (:) or periods (.).

-M match

Limit processing to Mini-SEED records that match the match regular expression. For each input record a source name string composed of 'NET_STA_LOC_CHAN_QUAL' is created and compared to the regular expression.

-R reject

Limit processing to Mini-SEED records that do not match the reject regular expression. For each input record a source name string composed of 'NET_STA_LOC_CHAN_QUAL' is created and compared to the regular expression.

-i

Modify input records in-place by writing modified records back to the input files.

-o outfile

Write all processed Mini-SEED records to outfile.

-A format

All output records will be written to a directory/file layout defined by format. All directories implied in the format string will be created if necessary. The option may be used multiple times to write input records to multiple archives. See the Archive Format section below.

--net code

Specify a new network code.

--sta code

Specify a new station code.

--loc id

Specify a new location id.

--chan codes

Specify new channel codes. A dot (.) will be interpreted as the same character as the input channel name, for example, "L.." can be specified to only replace the first code with 'L' and leave the other two codes as they are.

--quality [DRMQ]

Specify a new header/quality identifier, can be either 'D', 'R', 'M', or 'Q'.

--timeshift secs

Specify a time shift in seconds to apply to record start times. This value can be positive or negative and is not stored in the record as a time correction.

--timecorr secs

Change the value of the time correction field in the headers and apply the correction to the record start times. This is similar to --timecorr except that the correction is stored in the header and bit 1 of the activity flags (field 12) will be set to indicate the correction has been applied.

--timecorrval secs

Change the value of the time correction field in the headers without applying the change to the record start times. Bit 1 of the activity flags (field 12) will not be changed.

--applytimecorr

Apply the time correction value to the record start time if it has not previously been applied and set bit 1 of the activity flags (field 12) to indicate the correction has been applied.

--samprate sps

Specify new sampling rate in samples per second. This will be applied to both the nominal and actual (if present) sampling rate fields.

--actflags bit,value

Specify an activity flag by indicating the bit to change and it's value. Valid bit ranges are 0 to 6 and valid bit values are 0 and 1. Activity flags are defined in the SEED 2.4 manual as follows:

  *[Bit 0]* : Calibration signals preset
  *[Bit 1]* : Time correction applied
  *[Bit 2]* : Beginning of an event, station trigger
  *[Bit 3]* : End of the event, station detriggers
  *[Bit 4]* : A positive leap second happended during this record
  *[Bit 5]* : A negative leap second happended during this record
  *[Bit 6]* : Event in progress

--ioflags bit,value

Specify an I/O flag by indicating the bit to change and it's value. Valid bit ranges are 0 to 5 and valid bit values are 0 and 1. I/O flags are defined in the SEED 2.4 manual as follows:

  *[Bit 0]* : Station volume parity error possibly present
  *[Bit 1]* : Long record read (possibly no problem)
  *[Bit 2]* : Short record read (record padded)
  *[Bit 3]* : Start of time series
  *[Bit 4]* : End of time series
  *[Bit 5]* : Clock locked

--dqflags bit,value

Specify a data quality flag by indicating the bit to change and it's value. Valid bit ranges are 0 to 7 and valid bit values are 0 and 1. Data quality flags are defined in the SEED 2.4 manual as follows:

  *[Bit 0]* : Amplifier saturation detected (station dependent)
  *[Bit 1]* : Digitizer clipping detected
  *[Bit 2]* : Spikes detected
  *[Bit 3]* : Glitches detected
  *[Bit 4]* : Missing/padded data preset
  *[Bit 5]* : Telementry synchronization error
  *[Bit 6]* : A digital filter may be charging
  *[Bit 7]* : Time tag is questionable

--b1000encoding encoding

Chanage the Blockette 1000 data encoding format field. Valid values are included in the SEED manual documentation for Blockette 1000.

--b1001tqual percent

Chanage the Blockette 1001 timing quality field, valid values are 0 to 100 percent. Further description is included in the SEED manual documentation for Blockette 1001.

Archive Format

An archive format is expanded for each record using the following substitution flags:

  n : network code, white space removed
  s : station code, white space removed
  l : location code, white space removed
  c : channel code, white space removed
  Y : year, 4 digits
  y : year, 2 digits zero padded
  j : day of year, 3 digits zero padded
  H : hour, 2 digits zero padded
  M : minute, 2 digits zero padded
  S : second, 2 digits zero padded
  F : fractional seconds, 4 digits zero padded
  q : single character record quality indicator (D, R, Q)
  L : data record length in bytes
  r : sample rate (Hz) as a rounded integer
  R : sample rate (Hz) as a float with 6 digit precision
  % : the percent (%) character
  # : the number (#) character

The flags are prefaced with either the '%' or '#' modifier. The '%' modifier indicates a defining flag while the '#' indicates a non-defining flag. All records with the same set of defining flags will be written to the same file. Non-defining flags will be expanded using the values in the first record for the resulting file name.

Time flags are based on the start time of the given record.

Archive Format Examples

The format string for the predefined BUD layout:

/archive/%n/%s/%s.%n.%l.%c.%Y.%j

would expand to day length files named something like:

/archive/NL/HGN/HGN.NL..BHE.2003.055

As an example of using non-defining flags the format string for the predefined CSS layout:

/data/%Y/%j/%s.%c.%Y:%j:#H:#M:#S

would expand to:

/data/2003/055/HGN.BHE.2003:055:14:17:54

resulting in day length files because the hour, minute and second are specified with the non-defining modifier. The hour, minute and second fields are from the first record in the file.

Author

Chad Trabant
IRIS Data Management Center