You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

259 lines
14 KiB
HTML

<!DOCTYPE html>
<html >
<head>
<meta charset="utf-8" />
<title>tabinvmodifier &#8212; SeisComP Release documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/seiscomp.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css" />
<script type="text/javascript" src="../_static/seiscomp.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Messaging" href="../toc/messaging.html" />
<link rel="prev" title="tab2inv" href="tab2inv.html" />
</head>
<body>
<div class="header">
<div class="container">
<div class="brand">
<img class="logo" src="../_static/brands/seiscomp/text/white.svg"/>
<!-- span class="title">SeisComP Release</span -->
<span class="version">5.3.0</span>
</div>
</div>
</div>
<div class="nav">
<div class="container">
<div class="content"><a class="pull-right" id="sidebar-toggle">TOC</a>
<div class="related" role="navigation" aria-label="related navigation">
<ul>
<li class="right">
<a href="../genindex.html" title="General Index"
accesskey="I">
index
</a>
</li>
<li class="right">
<a href="../toc/messaging.html" title="Messaging"
accesskey="N">
next
</a>
</li>
<li class="right">
<a href="tab2inv.html" title="tab2inv"
accesskey="P">
previous
</a>
</li>
<li class="nav-item nav-item-0">
<a href="../index.html">Home</a>
</li>
<li class="nav-item nav-item-1">
<a href="../modules.html" >Modules</a>
</li>
<li class="nav-item nav-item-2">
<a href="../toc/inventory.html" accesskey="U">Inventory</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="fitted content" id="anchors-container">
<div class="body" role="main">
<div class="section" id="tabinvmodifier">
<span id="id1"></span><h1>tabinvmodifier<a class="headerlink" href="#tabinvmodifier" title="Permalink to this headline"></a></h1>
<p><strong>tab-based inventory modifier</strong></p>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<p>Sometimes small tweaks need to be made to inventory.
The tabinvmodifier program reads a <em>rules file</em> (a network tab file without any station lines) and applies network and station attributes to existing inventory. This method can be used to modify attributes in inventory that originate from dataless SEED or other sources. It can change inventory at the network, station, location, and channel level; it can also change sensor and datalogger attributes (Ia lines).
Currently (2016) changes to station groups (virtual networks) arent supported.</p>
<p>For details of what can go in a tab file, see
<a class="reference external" href="http://www.seiscomp.org/wiki/doc/special/nettabv2">NETTAB File Format Description</a>.</p>
<p>tabinvmodifier can either write directly to the inventory in an SC3 database, or dump its output as an XML file.
If output is as an XML file, typically this would then be moved to ~/seiscomp/etc/inventory, and then loaded into the database with <cite>seiscomp update-config</cite>.</p>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<ol class="arabic">
<li><p>Set network-level attributes. Suppose the file <cite>ge.rules</cite> contains</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>Nw: GE <span class="m">1993</span>/001
Na: <span class="nv">Description</span><span class="o">=</span><span class="s2">&quot;GEOFON Program, GFZ Potsdam, Germany&quot;</span>
Na: <span class="nv">Remark</span><span class="o">=</span><span class="s2">&quot;Access to Libyan stations and Spanish HH streams limited&quot;</span>
Na: <span class="nv">Type</span><span class="o">=</span>VBB
</pre></div>
</div>
<p>The first line (Nw:) specifies the network, including its start date, that these rules apply to.
The following lines starting with Na: provide values for the description, remark, and type attributes to be written into the new inventory.
Note the capital letter on the attributes Description, Remark, Type, etc.</p>
<p>We can use this rules file to change attributes of the GE network:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># Apply changes to database directly</span>
$ tabinvmodifier -r ge.rules
<span class="c1"># Apply changes to XML file</span>
$ tabinvmodifier -r ge.rules --inventory-db ge.xml -o ge-mod.xml
</pre></div>
</div>
<p>The resulting inventory now contains:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt">&lt;network</span> <span class="na">publicID=</span><span class="s">&quot;Network#20130513163612.389203.2&quot;</span> <span class="na">code=</span><span class="s">&quot;GE&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;start&gt;</span>1993-01-01T00:00:00.0000Z<span class="nt">&lt;/start&gt;</span>
<span class="nt">&lt;description&gt;</span>GEOFON Program, GFZ Potsdam, Germany<span class="nt">&lt;/description&gt;</span>
<span class="nt">&lt;institutions&gt;</span>GFZ/partners<span class="nt">&lt;/institutions&gt;</span>
<span class="nt">&lt;region&gt;</span>euromed global<span class="nt">&lt;/region&gt;</span>
<span class="nt">&lt;type&gt;</span>VBB<span class="nt">&lt;/type&gt;</span>
<span class="nt">&lt;netClass&gt;</span>p<span class="nt">&lt;/netClass&gt;</span>
<span class="nt">&lt;archive&gt;</span>GFZ<span class="nt">&lt;/archive&gt;</span>
<span class="nt">&lt;restricted&gt;</span>false<span class="nt">&lt;/restricted&gt;</span>
<span class="nt">&lt;shared&gt;</span>true<span class="nt">&lt;/shared&gt;</span>
<span class="nt">&lt;remark&gt;</span>access to Libyan stations and Spanish HH streams limited<span class="nt">&lt;/remark&gt;</span>
<span class="nt">&lt;station</span> <span class="na">publicID=</span><span class="s">&quot;Station#20130620185450.488952.190&quot;</span> <span class="na">code=</span><span class="s">&quot;MSBI&quot;</span> <span class="na">archiveNetworkCode=</span><span class="s">&quot;GE&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;start&gt;</span>2013-06-16T00:00:00.0000Z<span class="nt">&lt;/start&gt;</span>
</pre></div>
</div>
<p>Other attributes present in inventory are left unchanged.</p>
</li>
<li><p>Changing location codes. (Thanks to Andres H. for this example.)
To replace an empty location code for station “KP.UPNV” with location code “00”, together with its description and place.
The rules file is:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>Nw: KP <span class="m">1980</span>/001
Sa: <span class="nv">Description</span><span class="o">=</span><span class="s2">&quot;GLISN Station Upernavik, Greenland&quot;</span> UPNV
Sa: <span class="nv">Place</span><span class="o">=</span><span class="s2">&quot;Upernavik, Greenland&quot;</span> UPNV
Sa: <span class="nv">Code</span><span class="o">=</span><span class="s2">&quot;00&quot;</span> UPNV,
</pre></div>
</div>
<p>The resulting inventory now contains:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt">&lt;network</span> <span class="na">publicID=</span><span class="s">&quot;Network#20140603153203.17936.2&quot;</span> <span class="na">code=</span><span class="s">&quot;KP&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;start&gt;</span>1980-01-01T00:00:00.0000Z<span class="nt">&lt;/start&gt;</span>
...
<span class="nt">&lt;station</span> <span class="na">publicID=</span><span class="s">&quot;Station#20140603153203.179738.3&quot;</span> <span class="na">code=</span><span class="s">&quot;UPNV&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;start&gt;</span>2013-08-01T00:00:00.0000Z<span class="nt">&lt;/start&gt;</span>
<span class="nt">&lt;description&gt;</span>GLISN Station Upernavik, Greenland<span class="nt">&lt;/description&gt;</span>
<span class="nt">&lt;latitude&gt;</span>72.7829<span class="nt">&lt;/latitude&gt;</span>
<span class="nt">&lt;longitude&gt;</span>-56.1395<span class="nt">&lt;/longitude&gt;</span>
<span class="nt">&lt;elevation&gt;</span>38<span class="nt">&lt;/elevation&gt;</span>
<span class="nt">&lt;place&gt;</span>Upernavik, Greenland<span class="nt">&lt;/place&gt;</span>
<span class="nt">&lt;affiliation&gt;</span>GLISN<span class="nt">&lt;/affiliation&gt;</span>
...
<span class="nt">&lt;sensorLocation</span> <span class="na">publicID=</span><span class="s">&quot;SensorLocation#20140603153203.181119.4&quot;</span> <span class="na">code=</span><span class="s">&quot;00&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;start&gt;</span>2013-08-01T00:00:00.0000Z<span class="nt">&lt;/start&gt;</span>
...
<span class="nt">&lt;/station&gt;</span>
<span class="nt">&lt;/network&gt;</span>
</pre></div>
</div>
</li>
</ol>
</div>
<div class="section" id="command-line-options">
<h2>Command-Line Options<a class="headerlink" href="#command-line-options" title="Permalink to this headline"></a></h2>
<p><strong class="program">tabinvmodifier { -r | --rules } {rules file} [options]</strong></p>
<div class="section" id="options">
<h3>Options<a class="headerlink" href="#options" title="Permalink to this headline"></a></h3>
<dl class="option">
<dt id="cmdoption-tabinvmodifier-r">
<code class="sig-name descname">-r</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--rules</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-tabinvmodifier-r" title="Permalink to this definition"></a></dt>
<dd><p>Input filename of the rules file. A rules file is mandatory.</p>
</dd></dl>
<dl class="option">
<dt id="cmdoption-tabinvmodifier-e">
<code class="sig-name descname">-e</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--relaxed</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-tabinvmodifier-e" title="Permalink to this definition"></a></dt>
<dd><p>Relax rules for matching NSLC items</p>
</dd></dl>
<dl class="option">
<dt id="cmdoption-tabinvmodifier-o">
<code class="sig-name descname">-o</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--output</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-tabinvmodifier-o" title="Permalink to this definition"></a></dt>
<dd><p>Output XML filename. Without an output file, tabinvmodifier will attempt to write to the local SeisComp3 database.</p>
</dd></dl>
<dl class="option">
<dt id="cmdoption-tabinvmodifier-inventory-db">
<code class="sig-name descname">--inventory-db</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-tabinvmodifier-inventory-db" title="Permalink to this definition"></a></dt>
<dd><p>Input file containing inventory. If this option is given, an output file must be provided with <cite>output</cite>.</p>
</dd></dl>
</div>
</div>
</div>
<div id="anchors-bottom"></div>
</div>
<div class="sidebar" role="navigation" aria-label="main navigation">
<div id="anchors-top"></div>
<div id="anchors" class="content">
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
<h3><a href="../index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">tabinvmodifier</a><ul>
<li><a class="reference internal" href="#description">Description</a></li>
<li><a class="reference internal" href="#examples">Examples</a></li>
<li><a class="reference internal" href="#command-line-options">Command-Line Options</a><ul>
<li><a class="reference internal" href="#options">Options</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="tab2inv.html"
title="previous chapter">tab2inv</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="../toc/messaging.html"
title="next chapter">Messaging</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/apps/tabinvmodifier.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<div class="container">
<div class="horizontal layout content">
<a class="fade-in" href="https://www.gempa.de" target="_blank">
<img class="brand" src="../_static/brands/gempa.svg"/>
</a>
<div class="stretched align-center fitted content">
<div>
Version <b>5.3.0</b> Release
</div>
<div class="copyright">
Copyright &copy; gempa GmbH, GFZ Potsdam.
</div>
</div>
<a class="fade-in" href="https://www.gfz-potsdam.de" target="_blank">
<img class="brand" src="../_static/brands/gfz.svg"/>
</a>
</div>
</div>
</div>
</body>
</html>