mseed2ts
Shortcut: HOW TO retrieve one day of SCG
records at 1 Sps from Quanterra Q330HR
USAGE:
mseed2ts
[-N] <mseed-file> [<mseed-file>
...]
PURPOSE:
converts many mseed-files to BIN-ts via SAC.
Prefer to
launch from ~/Seismo/mseed
OPTIONS:
-N renew the
SAC-files
else
the mseed-to-sac conversion is skipped.
-S Only do the
mseed2sac conversion.
The
names of the sac-files will be printed.
-K Keep the
sac-files.
-D <dr> - put results into
subdirectories.
If <dr> ends in `%´
,
name
root <dr> will be trailed by the date
<dr>-<YYYY>-<MM>-<DD>/
Default is the current dir.
-report - Include a short report in the
stdout for every ts-file produced
-v
- verbose; print selected results using tslq.
-vv - verbose; print
a lot more
-vt - don't exec,
show the commands instead
-tso "tslist-options"
- can be
repeated, e.g. when quote signs cannot be used.
N.B.
If an option starts with -Un
( -Un#nos
, number of samples),
1-hour files will be made. Then, an output
file name must be given (option -o) that contains
a
`%´-sign where the start time will be injected.
Preferably specify nos > 360000 in order
to
guarantee overlaps for filtering.
Use
the -T option to completely extract all
mseed samples.
Hourly
processing:
-bh #b - Under -tso
-Un#nos : Start processing at hour b
-nh #n - Under -tso
-Un#nos : Limit the number of hours to n.
-calibrated
-
Use the environment value of $MSEED_CALVAL
(default the hard-wired value $calval in this script)
to
scale the output. The default value will scale the
output at
nm/s2 compliant with our standard factor
-774.421 nm/s2/V
-cal <value>
-
Calibrate (multiply with) value.
-T - with
splitting into 1-hour files:
Default is to leave a spill less than
the
given amount of samples in the -Un option.
-T
will exhaust the mseed-file completely.
-o <out-ts>
-O:label { <out-mc> | -
}
-
Significant `-´ for default output file name.
A
single `%´ in the file name will be replaced by date and
time.
If
the output file contains a symbol `%%%´ and the mseed-file
name
contains
a known component mark (e.g. `HGZ´), it will replace
the symbol;
if
the component mark is unknown, `%%%´ will be
replaced by XXX or by cm
-cm <cm> ... if given.
ENVIRONMENT:
MSEED_CALVAL Default =
0.0002099
EXAMPLES:
Splitting hourly, length happens to exhaust the mseed file:
cd ~/Seismo/mseed
mseed2ts -D SG.OSO/ -N -o SG.OSO.%%%.%.ts
-tso -Un366000 DT0013SG.HGN
Result:
h[hgs]~/Seismo/mseed> ls -lR
SG.OSO/*
SG.OSO/2016-03-01:
total 20020
-rw-rw-r-- 1 hgs hgs 2928084 Mar 2 16:53
SG.OSO.HGN.2016:03:01:06:32:35.ts
-rw-rw-r-- 1 hgs hgs 2928084 Mar 2 16:53
SG.OSO.HGN.2016:03:01:07:32:35.ts
-rw-rw-r-- 1 hgs hgs 2928084 Mar 2 16:53
SG.OSO.HGN.2016:03:01:08:32:35.ts
-rw-rw-r-- 1 hgs hgs 2928080 Mar 2 16:53
SG.OSO.HGN.2016:03:01:09:32:35.ts
-rw-rw-r-- 1 hgs hgs 2928084 Mar 2 16:53
SG.OSO.HGN.2016:03:01:10:32:35.ts
-rw-rw-r-- 1 hgs hgs 2928084 Mar 2 16:53
SG.OSO.HGN.2016:03:01:11:32:35.ts
-rw-rw-r-- 1 hgs hgs 2928084 Mar 2 16:53
SG.OSO.HGN.2016:03:01:12:32:35.ts
From shuttle earthworm/mseedfiles/ :
mseed2ts -D SG.OSO/ -N -o
SG.OSO.HGE.%.ts -calibrated -tso -Un366000
SG.OSO.2016-06-26/OSO.SG.SG.HGE.2016.178
Result:
h[hgs]~/Seismo/mseed> ll
SG.OSO/*HGE*
-rw-rw-r-- 1 hgs hgs 2928084 Dec 9 12:04
SG.OSO/SG.OSO.HGE.2016:12:08:00:00:00.ts
-rw-rw-r-- 1 hgs hgs 2928084 Dec 9 12:04
SG.OSO/SG.OSO.HGE.2016:12:08:01:00:00.ts
-rw-rw-r-- 1 hgs hgs 2928084 Dec 9 12:04
SG.OSO/SG.OSO.HGE.2016:12:08:02:00:00.ts
...
mseed2ts -N -D SG.OSO/ -o
SG.OSO.%%%.%.ts -nh 1 -calibrated -tso -Un366000
SG.OSO.2018-10-01-/OSO.SG.SG.HG?.2018.27?
Calibration value, the script's default with option
-calibrated:
set calval=0.0002099
HOW
TO retrieve one day of SCG records at 1 Sps from Quanterra
Q330HR miniseeds stored on shuttle
Instructions by example.
Assume that the mseed file for day 2018.280 is complete (copy it
earliest on the day after)
(1) Matching the UIPC-data as far as timing is
concerned. The Z-series should match the G1-files exactly provided
the scale factor is precise.
The MOVE 60 below is to match the
Agilent Voltmeter delay 600 ms
cd ~/Seismo/mseed
set dnr=280
scpm -m '/OSO.SG.SG.HG?.2018.${dnr}*' SG.OSO.2018-10-01/
mseed2ts -D SG.OSO/ -N -o SG.OSO.%%%.%.ts
-calibrated -tso -Un366000
SG.OSO.2018-10-01/OSO.SG.SG.HG?.2018.$dnr
set ymd=`jdc -::: -DD 2018.$dnr`
mkdir -p SG.OSO/d
foreach c ( E N Z )
set ofs = ( )
foreach f (
SG.OSO/SG.OSO.HG$c.${ymd}:??:00:00.ts )
set f1 = `echo $f | sed
's/\.ts//'`-10Hz.ts
set f10 = `echo $f | sed
's/\.ts//'`-1s.ts
setenv MOVE
60
tslist $f -I -E
resmp.tse,S10 -o $f1
unsetenv MOVE
tslist $f1 -I
-E resmp.tse,S10 -o $f10
set ofs = ( $ofs $f10
)
end
tslist-app -I -o SG.OSO/d/SG.OSO.HG$c.$ymd-1s.ts
+ $ofs
end
(2) Resampling to 10 Sps, keeping its
Quanterra->ForbrigerFilterFlavour
Proceed like under (1)
until mkdir , then do instead:
mkdir -p SG.OSO/q
foreach c ( E N Z )
set ofs = ( )
foreach f (
SG.OSO/SG.OSO.HG$c.${ymd}:??:00:00.ts )
set f1 = `echo $f | sed
's/\.ts//'`-10Hz.ts
tslist $f -I -E
resmp.tse,S10 -o $f1
set ofs = ( $ofs $f1 )
end
tslist-app -I -o SG.OSO/q/SG.OSO.HG$c.$ymd-10Hz.ts
+ $ofs
end
or
scpm ...
mseed2ts-10 yyyy doy
.bye