.. highlight:: rst .. _invextr: ####### invextr ####### **Extracts channels from inventory.** Description =========== invextr extracts or removes networks, stations and channels from an inventory XML file. It takes basically three important parameters: 1. channel ID list 2. input file 3. output file whereas the output file defaults to stdout and the input file to stdin if not given. A channel ID is a simple string that is matched against the final channel ID in the inventory. This final channel ID is constructed by joining the codes of all stages with a dot where the stages are network, station, location and channel. Examples -------- Suppose an inventory with network GE, a station MORC and several channels: .. code-block:: sh network GE station MORC location __ channel BHZ ID: GE.MORC..BHZ channel BHN ID: GE.MORC..BHN channel BHE ID: GE.MORC..BHE channel LHZ ID: GE.MORC..LHZ channel LHN ID: GE.MORC..LHN channel LHE ID: GE.MORC..LHE The IDs are matched against what is passed with --chans. .. code-block:: sh invextr --chans "GE*" inv.xml Nothing is filtered because GE* matches all available IDs. .. code-block:: sh invextr --chans "*MORC*" inv.xml Nothing is filtered again because *MORC* matches all available IDs. .. code-block:: sh invextr --chans "GE.MORC" inv.xml Everything is filtered because GE.MORC does not match with any ID. To make it work, an asterisk needs to be appended: GE.MORC* or GE.MORC.*. To extract all vertical components, use: .. code-block:: sh invextr --chans "*Z" inv.xml To extract BHN and LHZ, use: .. code-block:: sh invextr --chans "*BHN,*LHZ" inv.xml To remove all HH and SH channels, use: .. code-block:: sh invextr --rm --chans "*HH?,*SH?" inv.xml .. _invextr_configuration: Configuration ============= | :file:`etc/defaults/global.cfg` | :file:`etc/defaults/invextr.cfg` | :file:`etc/global.cfg` | :file:`etc/invextr.cfg` | :file:`~/.seiscomp3/global.cfg` | :file:`~/.seiscomp3/invextr.cfg` invextr inherits :ref:`global options`. Command-line ============ .. program:: invextr :program:`invextr [OPTIONS] [input=stdin] [output=stdout]` Generic ------- .. option:: -h, --help show help message. .. option:: -V, --version show version information .. option:: --config-file arg Use alternative configuration file. When this option is used the loading of all stages is disabled. Only the given configuration file is parsed and used. To use another name for the configuration create a symbolic link of the application or copy it, eg scautopick \-> scautopick2. .. option:: --plugins arg Load given plugins. .. option:: -D, --daemon Run as daemon. This means the application will fork itself and doesn't need to be started with \&. Verbosity --------- .. option:: --verbosity arg Verbosity level [0..4]. 0:quiet, 1:error, 2:warning, 3:info, 4:debug .. option:: -v, --v Increase verbosity level \(may be repeated, eg. \-vv\) .. option:: -q, --quiet Quiet mode: no logging output .. option:: --component arg Limits the logging to a certain component. This option can be given more than once. .. option:: -s, --syslog Use syslog logging back end. The output usually goes to \/var\/lib\/messages. .. option:: -l, --lockfile arg Path to lock file. .. option:: --console arg Send log output to stdout. .. option:: --debug Debug mode: \-\-verbosity\=4 \-\-console\=1 .. option:: --log-file arg Use alternative log file. Extract ------- .. option:: --chans arg A comma separated list of channel ids to extract which can contain wildcards. Example: invextr \-\-chans \"GE.\*.\*.BHZ,GE.MORC.\*.\*\" inv.xml .. option:: --rm arg Removes all channels given with '\-\-chans' instead of extracting them. Example: invextr \-\-rm \-\-chans \"GE.\*\" inv.xml .. option:: -f, --formatted Enables formatted XML output.