Files
seiscomp-training/share/doc/caps/html/base/examples.html

362 lines
21 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Examples and Recipes &#8212; CAPS: Common Acquisition Protocol Server documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/gempa.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/gempa.css?v=c960eebf" />
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css?v=eafc0fe6" />
<script type="text/javascript" src="../_static/gempa.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js?v=b3ba4146"></script>
<script src="../_static/doctools.js?v=888ff710"></script>
<script src="../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Change Log" href="changelog-server.html" />
<link rel="prev" title="Access Data on a CAPS Server" href="data-retrieval.html" />
</head>
<body>
<div class="header">
<div class="container">
<img class="background" src="../_static/icon.png"/>
<div class="content">
<span class="title">CAPS: Common Acquisition Protocol Server </span>
<span class="version">2025.254#f0c77b29e</span></h1>
</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="changelog-server.html" title="Change Log"
accesskey="N">
next
</a>
</li>
<li class="right">
<a href="data-retrieval.html" title="Access Data on a CAPS Server"
accesskey="P">
previous
</a>
</li>
<li class="nav-item nav-item-0">
<a href="../index.html">Home</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="fitted content" id="anchors-container">
<div class="body" role="main">
<section id="examples-and-recipes">
<span id="sec-caps-examples"></span><h1>Examples and Recipes<a class="headerlink" href="#examples-and-recipes" title="Permalink to this heading"></a></h1>
<section id="retrieve-real-time-data-from-a-caps-server">
<h2>Retrieve real-time data from a CAPS server<a class="headerlink" href="#retrieve-real-time-data-from-a-caps-server" title="Permalink to this heading"></a></h2>
<p>The <a class="reference internal" href="plugins.html#sec-caps-plugins"><span class="std std-ref">listed plugins</span></a> can be used for exchanging real-time data.</p>
<section id="caps-server-to-data-processing-modules">
<span id="sec-caps-data"></span><h3>CAPS server to data processing modules<a class="headerlink" href="#caps-server-to-data-processing-modules" title="Permalink to this heading"></a></h3>
<p>Use this recipe to:</p>
<ul class="simple">
<li><p>Provide data from a Caps server to data processing modules.</p></li>
</ul>
<p>Recipe:</p>
<ol class="arabic">
<li><p>Configure the CAPS server in the module configuration.</p></li>
<li><p>Start the CAPS server</p></li>
<li><p>For data processing use the <a class="reference internal" href="data-retrieval.html#sec-caps-recstream"><span class="std std-ref">caps or capss RecordStream</span></a>
and configure it in the global module configuration:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nv">recordstream</span><span class="w"> </span><span class="o">=</span><span class="w"> </span>caps://localhost:18002
</pre></div>
</div>
</li>
</ol>
</section>
<section id="caps-server-to-seedlink-clients">
<h3>CAPS server to SeedLink clients<a class="headerlink" href="#caps-server-to-seedlink-clients" title="Permalink to this heading"></a></h3>
<p>Use this recipe to:</p>
<ul class="simple">
<li><p>Provide data from a CAPS server to external <span id="id1"><em>seedlink</em> [<a class="reference internal" href="references.html#id288" title="seedlink. Real-time waveform server. URL: https://docs.gempa.de/seiscomp/current/apps/seedlink.html.">19</a>]</span> clients.</p></li>
</ul>
<p>Recipe:</p>
<ol class="arabic">
<li><p>Configure and start the CAPS server to provide the data.</p></li>
<li><p>Configure a new SeedLink instance</p>
<p><strong>Case 1 - CAPS uses SeedLink plugins for data collection:</strong></p>
<p>Configure a SeedLink client instance on a second computer which will act
as a seedlink client and server.</p>
<p><strong>Case 2 - CAPS does not use SeedLink plugins for data collection:</strong></p>
<p>Generate an alias for seedlink on the same computer which will act as a SeedLink
client and server.</p>
</li>
<li><p>Use the plugin <em>caps</em> in the SeedLink bindings and
configure the plugin to connect to the CAPS server,</p></li>
<li><p>Configure the new SeedLink instance,</p></li>
<li><p>Update configuration of the new SeedLink instance (no module selection),</p></li>
<li><p>Start the new SeedLink instance.</p></li>
</ol>
</section>
</section>
<section id="import-data-into-a-caps-server">
<h2>Import data into a CAPS server<a class="headerlink" href="#import-data-into-a-caps-server" title="Permalink to this heading"></a></h2>
<section id="real-time-import-with-seedlink-plugins">
<span id="sec-caps-slink"></span><h3>Real-time import with seedlink plugins<a class="headerlink" href="#real-time-import-with-seedlink-plugins" title="Permalink to this heading"></a></h3>
<p>Use this recipe to:</p>
<ul class="simple">
<li><p>Fetch data from a SeedLink server or from other sources using
standard SeedLink plugins <span id="id2">[<a class="reference internal" href="references.html#id288" title="seedlink. Real-time waveform server. URL: https://docs.gempa.de/seiscomp/current/apps/seedlink.html.">19</a>]</span> of <cite>SeisComP</cite> and provide them to a
CAPS server.</p></li>
</ul>
<p>Recipe:</p>
<ol class="arabic">
<li><p>Configure and start the <a class="reference internal" href="server.html#sec-caps-server"><span class="std std-ref">CAPS server</span></a> to receive the data,</p></li>
<li><p>Choose and configure the seedlink plugin in the SeedLink bindings configuration,</p></li>
<li><p>Uncheck the parameter <em>loadTimeTable</em> in the <span id="id3"><em>seedlink</em> [<a class="reference internal" href="references.html#id288" title="seedlink. Real-time waveform server. URL: https://docs.gempa.de/seiscomp/current/apps/seedlink.html.">19</a>]</span> module
configuration.</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>plugins.chain.loadTimeTable<span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">false</span>
</pre></div>
</div>
</li>
<li><p>Update the configuration.</p></li>
<li><p>Enable and start <a class="reference internal" href="../apps/slink2caps.html#slink2caps"><span class="std std-ref">slink2caps</span></a>.</p></li>
</ol>
</section>
<section id="real-time-import-with-caps-plugins">
<h3>Real-time import with CAPS plugins<a class="headerlink" href="#real-time-import-with-caps-plugins" title="Permalink to this heading"></a></h3>
<p>Use this recipe to:</p>
<ul class="simple">
<li><p>Fetch data from external source using the CAPS-specific
<a class="reference internal" href="plugins.html#sec-caps-acqui-plugins"><span class="std std-ref">CAPS plugins</span></a> and provide them to a CAPS server.</p></li>
</ul>
<p>Recipe:</p>
<ol class="arabic simple">
<li><p>Configure and start the <a class="reference internal" href="server.html#sec-caps-server"><span class="std std-ref">CAPS server</span></a> to receive the data,</p></li>
<li><p>Choose and configure the <a class="reference internal" href="plugins.html#sec-caps-acqui-plugins"><span class="std std-ref">CAPS plugin</span></a> in the
module configuration,</p></li>
<li><p>Enable and start the plugin.</p></li>
</ol>
</section>
<section id="import-offline-data-miniseed-and-other-formats">
<span id="sec-caps-example-offline"></span><h3>Import offline data: miniSEED and other formats<a class="headerlink" href="#import-offline-data-miniseed-and-other-formats" title="Permalink to this heading"></a></h3>
<p>Use this recipe to:</p>
<ul class="simple">
<li><p>Populate a CAPS server with offline miniSEED or other typs of data.</p></li>
</ul>
<p>Recipe:</p>
<p>Besides real-time data exchange, data from offline experiments, offline stations
or from other offline data archives can be fed into the caps data archive
from where they are made available by the caps server.</p>
<p>For example, a set of miniSEED data files (“.mseed”) can be pushed into the caps
archive using <a class="reference internal" href="../apps/rs2caps.html#rs2caps"><span class="std std-ref">rs2caps</span></a> and the <a class="reference internal" href="glossary.html#term-RecordStream"><span class="xref std std-term">RecordStream</span></a> interface “file”
(<code class="docutils literal notranslate"><span class="pre">-I</span> <span class="pre">file://</span></code>, <em>file</em> is default and can be omitted) along with the
<a class="reference internal" href="server.html#sec-caps-server"><span class="std std-ref">CAPS server</span></a>.</p>
<ol class="arabic">
<li><p>Input one file (file.miniSEED), accept all streams:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>seiscomp<span class="w"> </span>start<span class="w"> </span>caps
rs2caps<span class="w"> </span>-I<span class="w"> </span>file.mseed<span class="w"> </span>--passthrough
</pre></div>
</div>
</li>
<li><p>Input all files ending with .mseed, accept all streams:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>seiscomp<span class="w"> </span>start<span class="w"> </span>caps
cat<span class="w"> </span>*.mseed<span class="w"> </span><span class="p">|</span><span class="w"> </span>rs2caps<span class="w"> </span>-I<span class="w"> </span>-<span class="w"> </span>--passthrough
</pre></div>
</div>
</li>
<li><p>Input all files ending with .mseed, accept only streams found in the database:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>seiscomp<span class="w"> </span>start<span class="w"> </span>caps
cat<span class="w"> </span>*.mseed<span class="w"> </span><span class="p">|</span><span class="w"> </span>rs2caps<span class="w"> </span>-I<span class="w"> </span>-<span class="w"> </span>-d<span class="w"> </span>mysql://sysop:sysop@localhost/seiscomp<span class="w"> </span>-j<span class="w"> </span><span class="s2">&quot;&quot;</span>
</pre></div>
</div>
</li>
</ol>
</section>
</section>
<section id="real-time-playbacks">
<h2>Real-time playbacks<a class="headerlink" href="#real-time-playbacks" title="Permalink to this heading"></a></h2>
<p>Use this recipe to:</p>
<ul class="simple">
<li><p>Play back sorted miniSEED data as in real time using <span id="id4"><em>msrtsimul</em> [<a class="reference internal" href="references.html#id196" title="msrtsimul. SeisComP module. URL: https://docs.gempa.de/seiscomp/current/apps/msrtsimul.html.">12</a>]</span>.</p></li>
</ul>
<p>Real-time playbacks can be realized using</p>
<ul class="simple">
<li><p>A combination of msrtsimul and the CAPS plugin <a class="reference internal" href="../apps/rs2caps.html#rs2caps"><span class="std std-ref">rs2caps</span></a> or</p></li>
<li><p><span id="id5"><em>seedlink</em> [<a class="reference internal" href="references.html#id288" title="seedlink. Real-time waveform server. URL: https://docs.gempa.de/seiscomp/current/apps/seedlink.html.">19</a>]</span>.</p></li>
</ul>
<p>When using rs2caps the data can be stored in the CAPS archive or not.
When using seedlink then data a kept in the seedlink buffer and
<span id="id6"><em>slarchive</em> [<a class="reference internal" href="references.html#id298" title="slarchive. SeisComP module. URL: https://docs.gempa.de/seiscomp/current/apps/slarchive.html.">20</a>]</span> can be used to store the data in the SDS archive.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>For playbacks, the input data must be <strong>sorted by end time</strong>.</p>
<p>Real-time playback will create <strong>events with fake times</strong>, e.g creationTime, eventTime.
Therefore, they should be
executed on production system only in exceptional cases, e.g. for whole system
validation. Better use dedicated SeisComP3 machines. Starting msrtsimul with
the option <em>-m historic</em> preserves the time of the data records, thus the pick times.
Instead, using <strong>offline playbacks based on XML files</strong> may be the faster and better
option to create parameters from historic events.</p>
</div>
<section id="procedure-using-caps-rs2caps">
<h3>Procedure using CAPS / rs2caps<a class="headerlink" href="#procedure-using-caps-rs2caps" title="Permalink to this heading"></a></h3>
<ol class="arabic">
<li><p>Retrieve miniSEED data from CAPS archive using <a class="reference internal" href="../apps/capstool.html#capstool"><span class="std std-ref">capstool</span></a> or
other methods.</p></li>
<li><p>Sort miniSEED records by endtime using <span class="xref std std-ref">scmssort</span>:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>scmssort<span class="w"> </span>-E<span class="w"> </span>miniSEED_file<span class="w"> </span>&gt;<span class="w"> </span>miniSEED_file_sorted
</pre></div>
</div>
</li>
<li><p>Stop <a class="reference internal" href="../apps/caps.html#caps"><span class="std std-ref">caps</span></a>, <a class="reference internal" href="../apps/slink2caps.html#slink2caps"><span class="std std-ref">slink2caps</span></a>, <a class="reference internal" href="../apps/rs2caps.html#rs2caps"><span class="std std-ref">rs2caps</span></a> and all other active data
acquisition. This will stop the real-time data acquisition.</p></li>
<li><p>Execute caps on the command line without archiving the data:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>caps<span class="w"> </span>--read-only
</pre></div>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>As the data are not archived, processing of playback data will be impossible
after stopping caps. Only in dedicated playback systems, caps should be
used normally without any additional option.</p>
</div>
</li>
<li><p>Playback the sorted miniSEED data using msrtsimul:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>msrtsimul<span class="w"> </span>-v<span class="w"> </span>-c<span class="w"> </span>miniSEED_file_sorted<span class="w"> </span><span class="p">|</span><span class="w"> </span>rs2caps<span class="w"> </span>-I<span class="w"> </span>-<span class="w"> </span>--passthrough
</pre></div>
</div>
<p>The option <code class="docutils literal notranslate"><span class="pre">--passthrough</span></code> ensures that all data are passed to caps.</p>
</li>
<li><p>Stop caps after the playback and the evaluation are finished</p></li>
<li><p>Start caps and all other real-time data acquisition modules.</p></li>
</ol>
</section>
<section id="procedure-using-seedlink">
<h3>Procedure using seedlink<a class="headerlink" href="#procedure-using-seedlink" title="Permalink to this heading"></a></h3>
<ol class="arabic">
<li><p>Retrieve miniSEED data from CAPS archive using <a class="reference internal" href="../apps/capstool.html#capstool"><span class="std std-ref">capstool</span></a>.</p></li>
<li><p>Sort miniSEED records by endtime using <span class="xref std std-ref">scmssort</span>:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>scmssort<span class="w"> </span>-E<span class="w"> </span>miniSEED_file<span class="w"> </span>&gt;<span class="w"> </span>miniSEED_file_sorted
</pre></div>
</div>
</li>
<li><p>Activate msrtsimul and activate loadTimeTable in the seedlink configuration:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nv">msrtsimul</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">true</span>
plugins.chain.loadTimeTable<span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">true</span>
</pre></div>
</div>
</li>
<li><p>Configure the <a class="reference internal" href="glossary.html#term-RecordStream"><span class="xref std std-term">RecordStream</span></a> with seedlink:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nv">recordstream</span><span class="w"> </span><span class="o">=</span><span class="w"> </span>slink://localhost:18000
</pre></div>
</div>
</li>
<li><p>Start seedlink and restart the modules that use the RecordStream interface:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>seiscomp<span class="w"> </span>update-config
seiscomp<span class="w"> </span>start<span class="w"> </span>seedlink
seiscomp<span class="w"> </span>restart<span class="w"> </span>scautopick<span class="w"> </span>scamp
</pre></div>
</div>
</li>
<li><p>Playback the sorted miniSEED data using msrtsimul:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>msrtsimul<span class="w"> </span>-v<span class="w"> </span>miniSEED_file_sorted
</pre></div>
</div>
</li>
<li><p>Revert all changes after the playback.</p></li>
</ol>
</section>
</section>
</section>
<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" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
<div>
<h3><a href="../index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Examples and Recipes</a><ul>
<li><a class="reference internal" href="#retrieve-real-time-data-from-a-caps-server">Retrieve real-time data from a CAPS server</a><ul>
<li><a class="reference internal" href="#caps-server-to-data-processing-modules">CAPS server to data processing modules</a></li>
<li><a class="reference internal" href="#caps-server-to-seedlink-clients">CAPS server to SeedLink clients</a></li>
</ul>
</li>
<li><a class="reference internal" href="#import-data-into-a-caps-server">Import data into a CAPS server</a><ul>
<li><a class="reference internal" href="#real-time-import-with-seedlink-plugins">Real-time import with seedlink plugins</a></li>
<li><a class="reference internal" href="#real-time-import-with-caps-plugins">Real-time import with CAPS plugins</a></li>
<li><a class="reference internal" href="#import-offline-data-miniseed-and-other-formats">Import offline data: miniSEED and other formats</a></li>
</ul>
</li>
<li><a class="reference internal" href="#real-time-playbacks">Real-time playbacks</a><ul>
<li><a class="reference internal" href="#procedure-using-caps-rs2caps">Procedure using CAPS / rs2caps</a></li>
<li><a class="reference internal" href="#procedure-using-seedlink">Procedure using seedlink</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div>
<h4>Previous topic</h4>
<p class="topless"><a href="data-retrieval.html"
title="previous chapter">Access Data on a CAPS Server</a></p>
</div>
<div>
<h4>Next topic</h4>
<p class="topless"><a href="changelog-server.html"
title="next chapter">Change Log</a></p>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/base/examples.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<div class="container">
<div class="content">
Release <b></b> version <b>2025.254#f0c77b29e</b>
<div class="copyright">
&copy; Copyright <a href="https://www.gempa.de">2013, gempa GmbH.</a>
</div>
</div>
</div>
</div>
</body>
</html>