Squirrel command line tool manual¶
The squirrel command line tool is a front-end to the Squirrel data access infrastructure.
It offers functionality to
inspect various aspects of a data collection.
pre-scan / index file collections.
download data from online sources (FDSN web services, earthquake catalogs).
convert large data collections (file format and directory layout)
manage separate (isolated, local) environments for different projects.
manage persistent selections to speed up access to very large datasets.
Please read the Tutorial to get started with the squirrel
command line tool.
Command reference¶
The squirrel
tool and its subcommands are self-documenting with the
--help
option. Run squirrel
without any options to get the list of
available subcommands. Run squirrel SUBCOMMAND --help
to get details about
a specific subcommand, e.g. squirrel scan --help
.
- squirrel
- squirrel check - Check dataset consistency.
- squirrel codes - Get summary of available station/channel codes.
- squirrel coverage - Report time spans covered.
- squirrel database - Database inspection and maintenance.
- squirrel database env - Show current Squirrel environment.
- squirrel database stats - Show information about cached meta-data.
- squirrel database files - Show paths of files for which cached meta-data is available.
- squirrel database nuts - Dump index entry summaries.
- squirrel database cleanup - Remove leftover volatile data entries.
- squirrel database remove - Remove cached meta-data of files matching given patterns.
- squirrel dataset - Dataset managment.
- squirrel files - Lookup files providing given content selection.
- squirrel init - Create local environment.
- squirrel jackseis - Convert waveform archive data.
- squirrel nuts - Search indexed contents.
- squirrel operators - Print available operator mappings.
- squirrel persistent - Manage persistent selections.
- squirrel remove - Remove entries from selection or database.
- squirrel response - Print instrument response information.
- squirrel scan - Scan and index files and directories.
- squirrel snuffler - Experimental Squirrel-powered Snuffler.
- squirrel stationxml - Export station metadata as StationXML.
- squirrel summon - Fill local cache.
- squirrel template - Print configuration snippets.
- squirrel update - Update remote sources inventories.
Common options¶
Options shared between subcommands are grouped into three categories:
General options include
--loglevel
to select the program’s verbosity and--progress
to control how progress status is indicated. These are provided by all of Squirrel’s subcommands.Data collection options control which files and other data sources should be aggregated to form a dataset. Use the
--add
option to add files and directories. Further options are available to include/exclude files by regular expression patterns, to restrict to use selected content kinds only (waveform, station, channel, response, event), to create persistent data selections and more. Finally, the--dataset
option is provided to configure the dataset conveniently in a YAML file rather than repeatedly with the many command line options. Using--dataset
includes the possibility to add online data sources.Data query options are used to restrict processing/presentation to a subset of a data collection. They have no influence on the data collection itself, only on what is shown. It is possible to query by time interval (
--tmin
,--tmax
,--time
), channel/station code pattern (--codes
), and content kinds (--kinds
).
Examples¶
Renaming waveform channel codes¶
I have waveforms with channels named p0
, p1
and p2
. I would like to
rename them to HHZ
, HHN
, and HHE
, respectively:
squirrel jackseis --add data/old --out-sds-path data/new --rename-channel 'p0:HHZ,p1:HHN,p2:HHE'
This will create a new directory hierarchy in SDS layout under data/new
with the modified waveforms.
For further possibilities, look for --rename-channel
in the output of
squirrel jackseis --help
.
Set network code on a set of waveforms¶
I have waveforms where the network code is partially missing and partially incorrect. I would like to set it for all waveforms to XX:
squirrel jackseis --add data/old --out-sds-path data/new --rename-network XX
Convert raw waveforms to instrument-corrected ground velocity¶
I would like to convert raw waveforms to ground velocity in m/s. I have continuous waveforms and I don’t want to have any gaps in the output:
squirrel jackseis --add data/raw meta/stations.xml --out-sds-path data/velocity \
--quantity velocity --band 0.1,10
This will restitute the seismograms to ground velocity in the frequency band
0.1 to 10 Hz. It uses pyrocko.trace.Trace.transfer()
under the hood.
The frequency taper involved is flat between 0.1 and 10 Hz and decays to zero
at 0.1/2 and 10*2 Hz.
Reducing memory consumption when converting data with squirrel jackseis
¶
Data is processed in time blocks matching the time increment given with
--tinc
(plus padding). All available data in the current block is loaded
into memory. This may lead to excessive memory usage when lots of channels are
available in the dataset.
Add --traversal sensor
to process the dataset sensor by sensor. It will run
a loop over time for each sensor in the dataset and thus use less memory.