.. highlight:: rst .. _ccloc: ##### ccloc ##### **Event detector based on template matching by waveform cross-correlation.** Description =========== ccloc detects events by template matching. It finds similarities of recored waveforms with templates from pre-defined master events based on cross-correlation of :ref:`characteristic functions `. ccloc declares a :ref:`new origin ` if the :ref:`detection parameters ` parameters are above the :ref:`configured thresholds `. The origin location and depth are taken from the matched master event whereas the origin time is determined from the processed time window. **An efficient configuration strategy is described in the section** :ref:`Getting started `. .. hint:: ccloc in versions higher than 2022.258#92f623e can process data on multiple threads in parallel or on the GPU. The benefit is a significant speed up and the option to use many more templates. Section :ref:`sec-ccloc-compute-resources` provides the related information. Event type ---------- The new origin contains the event type of the master event as a comment. The type comment is evaluated by the :ref:`evccloc ` plugin for :cite:t:`scevent`. When applying this plugin the type of the event is set according to the type of the master event. In this way, ccloc can also be used for event discrimination. .. _sec-ccloc-magnitudes: Magnitudes ---------- The magnitude is computed from the ratio of :term:`PGV` amplitudes measured on the continuous data to the :term:`PGV` amplitudes measured on the data of the master event: .. math:: :label: M M = M_{master} + \frac{1}{N} \sum_{i=1}^{N} \log_{10} \frac{PGV_{continuous_i}}{PGV_{master_i}} Modes of operation ------------------ ccloc can run in real time as a daemon module or on the commandline or offline for playbacks. See the :ref:`examples ` for some applications. Workflow ======== The full workflow consists of #. :ref:`Data processing`, #. :ref:`Cross-correlation detection` :cite:p:`pcc`, #. :ref:`Declaration of origins`, #. :ref:`Optional pick refinement`. ccloc subscribes to all streams (channels) for which the master event has picks. 3-component data are considered if :confval:`use3C` is enabled. On each received record the common time window of all channels is computed. If sufficient data is available, the time windows are processed. .. figure:: media/stepping.png :width: 8cm :align: center Processing of a data time window of continuous channels. The step of each processing step is the time of one sample. See :ref:`sec-ccloc-processing` for the processing of each each time window. Each processed time window is :ref:`matched ` with the master event. If the overall fit exceeds the :confval:`configured threshold `, the detector is started searching for the maximum fit within the :confval:`configured time window `. The timestamp of the maximum fit is taken as event time and an origin with a :ref:`magnitude ` is sent to the messaging. .. _sec-ccloc-processing: Data processing =============== The data processing before applying cross-correlation consists of #. :ref:`Data selection ` #. Computation of the :ref:`characteristic function ` used for detection. For increased speed the data are processed according to the configuration in the time domain. The schema is illustrated below. .. figure:: media/processing.png :width: 8cm :align: center Processing schema in the time domain. **data** are the template waveforms and continuous raw input waveforms corrected for sensitivity. .. note:: The processing is equally applied to waveforms template events and waveforms on which detection are sought. Processing is done in the time domain as it is much faster than in the frequency domain. .. _sec-ccloc-data-selection: Data selection -------------- The waveform data of the master event template and of the matched input data, e.g. real-time waveforms, are selected and loaded according to the streams corresponding to the picks defined by the :ref:`master event `. The parameter :confval:`use3C` configured in the ccloc binding profile controls whether the data from all available stream components are loaded or only for the stream component on which a pick was defined. By default, :confval:`use3C` is enabled and all stream components are used. If disabled and the S-wave picks are defined on one horizontal component then the other complementary component is considered as well. If the S pick is defined on the vertical component, then only vertical-component data are considered. .. _sec-ccloc-characteristic-func: Characteristic functions ------------------------ Supported characteristic functions are: #. :ref:`Processed waveforms ` where the processing can comprise any |scname| :cite:t:`filter `. #. :ref:`Envelopes ` formed from processed waveforms. #. :ref:`Logarithm ` applied to processed waveforms. .. note:: Envelope functions can also be formed by |scname| filters and added to the first filter stage instead of activating the envelope in the second stage. Read section :ref:`sec-ccloc-envelope` for the details. .. _sec-ccloc-proc-wf: Processed waveforms ................... Processed waveforms can be used as characteristic function. Here, any available |scname| :cite:t:`filter ` or filter chains can be provided by configuring the parameter :confval:`processing.filter.definition`. In this way more complex characteristic functions such as STALTA or user-defined envelopes can be formed. Bandstops at 50 Hz and 100 Hz are applied when enabling :confval:`processing.filter.bandStop`. As filter chains can be applied to waveforms and viewed in :cite:t:`scolv` or scrttv, they can be interactively designed and tested before. .. _sec-ccloc-envelope: Envelope ........ The cross-correlation can be computed on the processed (filtered) seismograms or on the envelopes of the :ref:`processed waveforms `. Using the envelope of seismograms instead of the seismograms themselves, the cross-correlation becomes less sensitive to small changes in the source location and in source mechanism between master signal and the earthquake to be detected. For envelope computation enable :confval:`processing.envelope.enable`. ccloc computes the envelope in the time domain using a running root mean square: .. math:: :label: eq:EnvRT \hat{y}_i^j = \sqrt{ \frac{2}{N} \sum_{k = i-N}^i (y_k^j)^2 } Here y\ :sub:`i`\ :sup:`j` is the output signal of the single trace operation, which in this case is the envelope of the signal. y\ :sub:`k`\ :sup:`j` is the input signal of the single trace operation, which in this case is the filtered seismogram. *i* and *j* are counters for time and trace number, respectively. *N* is the number of samples used for the RMS. *N* is calculated as: .. math:: :label: eq:N N = \frac{\text{processing.envelope.samplingFrequency}}{\text{processing.envelope.hiFreq}} *N* will be set to 1 for a :confval:`processing.envelope.hiFreq` value less than or equal to 0. The parameters :confval:`processing.envelope.samplingFrequency` and :confval:`processing.envelope.hiFreq` are configurable. Due to :eq:`eq:EnvRT` envelope functions can also be formed from |scname| :cite:t:`filters ` and configured in :confval:`processing.filter.definition` like .. code-block:: properties self()^2>>AVG(T)^0.5 where *T* can be calculated from :confval:`processing.envelope.samplingFrequency` and :confval:`processing.envelope.hiFreq` inserting :eq:`eq:N`. .. math:: :label: eq:AVGT T &= \frac{N}{\text{processing.envelope.samplingFrequency}}\\ &= \frac{\text{processing.envelope.samplingFrequency}}{\text{processing.envelope.hiFreq} * \text{processing.envelope.samplingFrequency}} \\ &= \frac{1}{\text{processing.envelope.hiFreq}} .. note:: Currently, resampling is only available along with forming envelopes and :confval:`processing.envelope.enable` *= true*. In the future, resampling may become an independent processing step. .. _sec-ccloc-logarithm: Logarithm ......... The logarithm trace can be computed from the :ref:`processed waveforms ` or from :ref:`envelopes `. By enabling :confval:`processing.logarithm.enable` the logarithm is computed and used as the characteristic function: .. math:: :label: Log y_i^j = sgn(y_i^j) \: ln|y_i^j| Application of this single trace operation will generally amplify the noise level with respect to the signals from events. This may be an unwanted effect. On the other hand using this option increases the importance of small-amplitude waves like coda waves in comparison to direct P- and S-waves. It may also increase the importance of recordings at distant stations in comparison with close stations (if the network cross-correlation is applied). Noise removal ------------- If we use seismogram envelopes, the constant background noise level causes a problem in the computation of the cross-correlation. Even if we remove the mean value in the seismograms, a constant offset appears in the envelopes. This offset value in the envelopes corresponds to the standard deviation of noise in the original seismograms. Correlating a constant (noise) trace with the master event results in a large correlation coefficient possibly causing wrong detections. A simple solution to this problem is to remove the noise level from the master event traces as well as from the current time window traces. We estimate the noise level y\ :sup:`j` in a time window j before the potential signal at envelope trace y\ :sub:`i`\ :sup:`j`: .. math:: :label: Noise \overline{y^j} = \frac{1}{N_n}\sqrt{\sum_{i=1}^{N_n} y_i^j} Here i is the counter for time samples, N\ :sub:`n` is the number of time samples in the time window to estimate the noise level, and j is a counter for the traces (seismometers times components). Then we remove the noise level, which is a constant offset in the envelopes: .. math:: :label: NoiseRM \hat{y}_i^j = y_i^j - \overline{y^j} Here, the time window, where we remove the offset (and where we later compute the correlation) is generally different from the time window, where we estimate the noise level. .. _sec-ccloc-cross-correlation: Detection by cross correlation ============================== After data processing, the processed waveform templates are cross-correlated :cite:p:`pcc` with the measured waveform data searching for new detections. A detection is declared and a new origin is created if **all** of the configurable thresholds are reached: * :confval:`detector.channelThreshold`: minimum cross-correlation coefficient per :ref:`single stream channel `. When the value is reach a match on this channel is declared, * :confval:`detector.threshold`: minimum :ref:`network cross-correlation coefficient `, * :confval:`detector.minimumChannelRatio`: minimum ratio of number of channels reaching :confval:`detector.channelThreshold` vs.\ number of all considered channels, * :confval:`detector.minimumStationRatio`: minimum ratio of number of stations with at least one matching channel vs.\ number of all considered stations. .. _sec-ccloc-cross-correlation-single: Single trace correlation ------------------------ In a first step we compute the single trace cross-correlation coefficient with zero lag at channel j: .. math:: :label: Rj R^j = \frac{1}{\sqrt{(\sum_{i=1}^N x_i^j x_i^j) \: (\sum_{i=1}^N y_i^j y_i^j)}} \: \sum_{i=1}^N x_i^j y_i^j Here i is the sample index of the channel, N is the number of time samples in the used correlation time window, x\ :sup:`j` is the filtered seismogram or envelope of the master event after single trace operations described in :ref:`sec-ccloc-processing`, y\ :sup:`j` is the filtered seismogram or envelope of the current time window after applying the same operations as to the master traces, and j is a counter for the traces (seismometers times components). This cross-correlation coefficient is computed for all traces j=1,...,J, where J/3 is the total number of stations of the master event, if we use three-component seismograms. Using three-component seismograms is controlled by parameter :confval:`use3C` defined in the ccloc binding profile. The first condition for a detection is, that .. math:: :label: cond1 R^j > R_1, for at least J\ :sub:`min` channels. R\ :sup:`j` is defined in equation :eq:`Rj`. R\ :sub:`1` is the configurable input threshold :confval:`detector.channelThreshold`. It is typically chosen in the order of R\ :sub:`1` ≈ 0.6 - 0.8. J\ :sub:`min` is the minimum number of matched seismograms, that is where the event is detected. j>=J\ :sub:`min` is required. J\ :sub:`min` is implicitly given through :confval:`detector.minimumChannelRatio` as the minimum ratio between matched and available channels. In other words: This condition requires that the current time window and the master event show similar waveforms (R\ :sup:`j` > R\ :sub:`1`) for at least J\ :sub:`min` seismograms. We use the parameter J\ :sub:`min` to account for the fact that some seismograms may show large local noise (R\ :sup:`j` < R\ :sub:`1`), when a small earthquake occurs. When the data transmission of some sensors is interrupted the respective correlation coefficient is set to zero: R\ :sup:`j` = 0 < R\ :sub:`1` and the result is similar to a local noise disturbance. A detection is only possible if the number of noisy or otherwise disturbed traces does not exceed J - J\ :sub:`min`. .. _sec-ccloc-cross-correlation-network: Network correlation ------------------- In the next step ccloc computes the network cross-correlation with zero lag, where two normalization options are available. They are selected with :confval:`processing.normalization`: * **trace** normalization: ccloc computes the average single trace cross-correlation coefficient of the J\ :sub:`min` traces with the highest single trace cross-correlation coefficient: .. math:: :label: RA R_{trace} &= \frac{1}{J_{min}} \sum_{j=1}^{J_{min}} R^j \\ &= \frac{1}{J_{min}} \sum_{j=1}^{J_{min}} \frac{1}{\sqrt{(\sum_{i=1}^N x_i^j x_i^j) \: (\sum_{i=1}^N y_i^j y_i^j)}} \: \sum_{i=1}^N x_i^j y_i^j * **total** normalization: ccloc computes the matrix cross-correlation with zero lag, where one dimension of the matrix is time and the other dimension is the different traces: .. math:: :label: RB R_{total} = \frac{1}{\sqrt{(\sum_{j=1}^{J_{min}} \sum_{i=1}^N x_i^j x_i^j) (\sum_{j=1}^{J_{min}} \sum_{i=1}^N y_i^j y_i^j)}} \sum_{j=1}^{J_{min}} \sum_{i=1}^N x_i^j y_i^j The major difference between R\ :sub:`trace` and R\ :sub:`total` is that in equation :eq:`RA` the relative amplitudes between stations and components are neglected. They are taken into account in equation :eq:`RB`, meaning that only events of similar magnitude are detected. The second condition for a detection is either .. math:: :label: cond2a R_{trace} > \text{detector.threshold} or: .. math:: :label: cond2b R_{total} > \text{detector.threshold} Here :confval:`detector.threshold` is a configurable threshold, which judges the similarity across the network and should be set roughly :confval:`detector.threshold` ≈ 0.6 - 0.8. .. note:: The network cross-correlation is only computed if the ratio of time window traces and master event traces does not fall below :confval:`detector.minimumChannelRatio` and if the ratio of time window stations and master event stations does not fall below :confval:`detector.minimumStationRatio`. Otherwise the network cross-correlation is set to 0. Travel-time uncertainties ------------------------- When the template and the new event share an identical hypocenter, the travel times to the stations are equal and the relative phase arrival times of the template and the new event are the same for all stations. Generally, the hypocenters are not identical and differences in travel-times occur. This will degenerate the network correlation and prevent a detection if the differences are not tolerated. The parameter to control the tolerance for travel-time differences is :confval:`detector.fitWindow`. Set :confval:`detector.fitWindow` large enough to account for travel-time differences between new events and the template (see figure below). Very small values will confine the detections to events very close to the template hypocenter. Once a detection is made, travel-time differences can be further accounted for by :ref:`refining phase picks`. .. hint:: :confval:`detector.fitWindow` **is a crucial module configuration parameter.** It can be overridden per template event. .. figure:: media/ccloc-windows.png :width: 12cm :align: center Window parameters. window: :confval:`detector.window`, fitWindow: :confval:`detector.fitWindow`. signal window is the time window defined per template event by :confval:`event.$name.signalBegin` and :confval:`event.$name.signalEnd`. Relative time of matches may differ from relative arrivals predicted by the template. The beginning of :confval:`detector.fitWindow` and :confval:`detector.window` is defined by the first match. Waveform complexity ------------------- Processed waveforms may be more complex than waveforms of template events. Some reasons are: * Noise, * Doublet events of overlapping signals due to multiple events, * Complex or long source time functions. In such situations, ccloc may find multiple detections witin very short intervals which often belong to the same event. ccloc will select the best matching detection within a time window defined by :confval:`detector.window` and will only deliver one detection within this time window. :confval:`detector.window` refers to a shift in the assumed source time allowing to shift the template across the wave forms (see figure above). .. hint:: Configure :confval:`detector.window` large enough to account for waveform complexity, e.g. the length of a source time function, but small enough to avoid overlapping with subsequent events. The choice of the value is driven by the expected signal durations and inter-event times. .. _sec-ccloc-origins: Declaration of origins ---------------------- Once the :ref:`detector thresholds ` are met, a new origin is created containing * **Origin time and hypocenter location:** The hypocenter and the time of the new origin are not found by locating but are derived from the time of the master template and the time of the processed time window, the time of the detection. * **Origin status:** The status of the origin is by default *preliminary* which can be configured by :confval:`output.origins.status`. Relocate the origin for more precise parameters. For relocation provide the origin to other modules such as :cite:t:`scanloc`, :cite:t:`screloc` or use :cite:t:`scolv` for interactive analysis. * **Event type** of the template event as an origin comment. * **Picks and arrivals:** The pick times are derived from the traveltimes of the master event added to the origin time of the detection. They are further :ref:`refined by the AIC method ` unless deactivated by :confval:`repicking.enableAIC`. In case of larger differences in source location, the matched and the real arrivals may be significantly different. The matched picks may hence be of limited accuracy and of limited use for relocating. Therefore, the picks somewhat represent theoretical onsets and are flagged by adding a **T** to the beginning of the phase hint, e.g. **TP** and **TS** for **P** and **S** phases, respectively. Hereby, the original phase names, e.g. P, S, Pn, Sg, etc., originating from the template event are preserved. All arrivals starting with **T** are given a weight of 0. Therefore, they cannot be used for relocation, e.g. by scanloc or screloc as typically no corresponding traveltime tables exist. Viewing these picks in scrttv or scolv provides more advanced control over the functioning of ccloc. Apply :ref:`repicking ` to refine the picks by the AIC method and make the refined picks applicable to locator routines. When repicking, a :confval:`minimum score ` based on the repicked phases may be defined as a threshold which must be exceeded before sending the origins. .. note:: The origins found by template matching can only have phase detections/arrivals for which the template event also has arrivals. Thus, * if the template event misses, e.g., a P arrival at a station, then the found origin cannot have P, TP or AP arrivals for this station, * if :confval:`use3C` is active and the template misses arrivals on the horizontal components but only the horizontal components, not the vertical, have matches, then the new origin will have 0 arrivals. The same applies for the vertical component. .. _sec-ccloc-pickrefinement: Pick refinement =============== The **T**-picks found from template matching may be inaccurate. Therefore they should be re-picked by a second-stage :term:`AIC` picker. Once the AIC can find a pick exceeding the configured minimum :term:`SNR`, the leading T of the phase name is removed and the arrival is given a weight of 1. The re-picked phase picks are typically more accurate and can now be used for re-locating. AIC picks not exceeding the minimum SNR receive trailing **A**, e.g. **APg** instead of **Pg** and a weight of 0. When repicking is enabled, sending the **T** and **A** picks is disabled by default. However, they may be useful for debugging or manual analysis. To enable the sending of **T** or **A** picks configure in the module configuration: * :confval:`repicking.sendTheoreticalPicks` for **T** picks. * :confval:`repicking.sendAICPicks` for **A** picks. Then, one station may deliver two different picks for the same phase type with different given phase hints, e.g. *P* and **TP** or **AP**. As for the **T** picks the **A** picks cannot be used automatically for re-locating e.g. by :program:`scanloc` or :program:`screloc` as typically no corresponding travel-time tables exist. .. note:: Sending all T- and A-type picks (see below) may results in an unnecessary and large amount of output and is therefore disabled by default. On the other hand, the **A** picks may be considered by operators. Simply adjusting the phase names to supported ones allows to use them by SeisComP locators. AIC setup --------- The AIC method is enabled by default with :confval:`repicking.enableAIC`. The AIC parameters are configured in the ccloc binding configuration: #. Create a new or use an existing processing profile. #. **P-type phases:** Set the :confval:`profile.$name.ppicker.AIC.*` parameters. The time window parameters are use with respect to the TP picks. Ensure that AIC windows for P wave do not overlap with S phases. #. **S-type phases:** Set the :confval:`profile.$name.spicker.AIC.*` parameters. The time window parameters are use with respect to the TS picks. Interaction ----------- The picks can be shown in scolv or scrttv: * Red for automatically re-picked picks with weight 1. * Gray for arrivals with weight 0: **T** or **A** picks. Viewing these picks provides more advanced control over the functioning of ccloc. .. figure:: media/ccloc_scolv_arrivals.png :width: 12cm :align: center scolv picker window with TP, TS, P and S picks. To use the **T** or the **A** picks for re-locating, the phase names can be replaced interactively in the arrival table of :program:`scolv`. .. figure:: media/ccloc_scolv_main.png :width: 12cm :align: center scolv main window with arrival information from TP, TS, P and S phases. .. _sec-ccloc-getting-started: Configuration: Getting started ============================== **This section describes the main steps to configure ccloc.** Stations participating in template matching must have ccloc bindings with :confval:`detecEnable` being activated. At least one master event must be configured. :ref:`Multiple master events ` can be defined and processed in parallel to account for different waveforms or seismicity regions. For a verification of the configuration read the section :ref:`ccloc-confiugration-verify`. ccloc can be configured with the following hierarchy, the last read parameter value takes priority: * Module configuration: * general parameters * mandatory: template event parameters * data processing * event detection * Bindings configuration: * mandatory: data processing profile(s) * template event parameters * AIC re-picker parameters To get started, it is sufficient to define a master template and a few general parameters. #. **Create the new event template** to generate the miniSEED data and event XML files defining the template. .. hint:: While larger events can be detected clearly at many stations, small events will be often visible only at nearby stations. For detecting many small events it can be advisable to generate the template from very few nearby stations only with clear signals. a. Choose the event in :program:`scolv`, re-pick P and S phases and disable picks (remove arrival) from stations which shall not participate in template matching. Only streams for which picks exist are considered for template matching. **Therefore, phases should be picked on the component on which they can be observed best and on which the automatic picks are made**, e.g. by :program:`scautopick`. .. note:: When picks for the **same phase** type from ccloc and other pickers such as scautoloc exist but they are made on different streams, e.g. HHN and HHZ, they may both be associated to the same origin and bias the solution. Therefore, the picks provided with the master event must match in component with the picks from the other phase pickers. #. Relocate the origin. #. Set the event type of the template event to automatically set the event type of detection. This step required the plugin :ref:`evccloc ` to be configured in :cite:t:`scevent`. #. Commit the solution, note the originID and the eventID: expand the event in the :program:`scolv` Events list and read the IDs #. Dump the event XML using :cite:t:`scxmldump`. #. Dump the related template waveform into a miniSEED file. You can use a combination of scevtstreams and capstool or scart. #. Create a subdirectory of @DATADIR@ and save the XML and the miniSEED file therein. E.g.: .. code-block:: sh mkdir -p $SEISCOMP_ROOT/share/ccloc/[eventID] cp [XML file] [miniSEED file] $SEISCOMP_ROOT/share/ccloc/[eventID] .. note:: When regularly clearing the database or the waveform archive, the master event information may get lost. In this case it is recommended to store the master event information and waveforms in files. Check above for the procedure. .. hint:: You may write a skript and configure one of the configurable buttons in :program:`scolv` to extract the template interactively by a mouse click. **Example script**, e.g. :file:`@DATADIR@/ccloc/configure-ccloc-template.sh`: .. code-block:: sh #!/bin/bash cclocConfig="$SEISCOMP_ROOT/share/ccloc" # Get the event and origin ID eventID=$2 originID=$1 # database db="-d mysql://sysop:sysop@localhost/seiscomp" mkdir -p $cclocConfig/$eventID cd $cclocConfig/$eventID # Prepare template, provide miniSEED records sorted by time! scxmldump -E $eventID -PAMf -vvvv $db > $eventID.xml scevtstreams -i $eventID.xml -E $eventID -m 120 -vvvv -L 0 > $eventID.list scart -I caps://localhost:18002 --list $eventID.list --stdout | scmssort -u -E > $eventID.mseed if [ `stat --format %s $eventID.mseed` == 0 ]; then echo "no data found" rm -r $eventID.mseed fi echo "generated template files in " $cclocConfig/$eventID echo "files: " $eventID.xml $eventID.list $eventID.mseed echo "use the files to configure ccloc" echo "event ID: " $eventID echo "origin ID: " $originID **Example scolv configuration** in :file:`scolv.cfg`: .. code-block:: properties # Label of button that triggers user defined script0. button0 = MakeCclocTemplate # Full path to the script executed when hitting the button labeled with button0. scripts.script0 = "@DATADIR@/ccloc/configure-ccloc-template.sh" Start :program:`scolv` with ``--debug`` for information on the template when hitting the new button. #. **Configure the event template** in the module configuration: #. Choose an existing :program:`ccloc` instance for adding the template events or :ref:`create a new ccloc instance`. #. Create an event profile for the new template in the module configuration. The name of the event profile is typically the eventID. For the new profile configure at least: * :confval:`event.$name.baseID` for the ID of the event if the event parameters are read from the *seiscomp* database. * :confval:`event.$name.originID` for the ID of the considered origin associated to the event. By default, the preferred origin is selected. However, the preferred origin may change by reprocessing or other origins may be specifically prepared for template matching. Therefore, it is recommended to provide a unique originID. * :confval:`event.$name.noiseBegin` and :confval:`event.$name.noiseEnd` defining the noise window and to account for any effects due to filtering. * :confval:`event.$name.signalBegin` and :confval:`event.$name.signalEnd` according to the waveform of the master event template. :confval:`event.$name.signalBegin` and :confval:`event.$name.signalEnd` are relative to the first picked P and the first picked S arrivals, respectively. .. note :: If the master event contains no P or not S arrival for a station, then the P or the S arrival time, respectively, is predicted from the first S or P arrival assuming v\ :sub:`p`/v\ :sub:`s` = 1.73. * :confval:`event.$name.processing.filter.definition` for the filter to be applied before template matching. Remove long- and short-period noise! * :confval:`processing.envelope.samplingFrequency` to resample the envelope if :confval:`processing.envelope.enable` = true. Resampling is performed by simply removing or adding samples. Downsampling boosts the performance of ccloc in terms of speed. * Detection thresholds: * :confval:`event.$name.detector.channelThreshold` * :confval:`event.$name.detector.threshold` * :confval:`event.$name.detector.minimumChannelRatio` * :confval:`event.$name.detector.minimumStationRatio` .. note:: Events may have several P and S picks on the same station, e.g. Pg, Pn, Sg or Sn. Currently only the first arriving P and the first arriving S picks are used. Late P and S arrivals are currently not considered. c. Configure :confval:`events` using the name of the event profile. #. **Configure general module configuration parameters:** The general parameters are inherited by the event profiles and the processing profiles where some can be overwritten. Configure * :confval:`computeResources.numThreads` or :confval:`computeResources.useGPU` deciding whether to compute on one or multiple threads or on the GPU to speed up processing. Read section :ref:`sec-ccloc-compute-resources` for more details on multi-threading. * :confval:`detector.fitWindow` to allow searching for matches on all waveforms from all stations within that time window. This parameter is important to account for hypocentre differences with respect to the master event which will result in traveltime differences. * :confval:`detector.window` to search for more detections after the initial trigger. ccloc will aggregate all found detections within :confval:`detector.window` and select the detection with the best overall match to create a new origin. All other detections will be ignored. * **Re-picking:** Decide if matched phases should be refined by using an AIC repicker. Configure :confval:`repicking.enableAIC` accordingly. If :confval:`repicking.enableAIC` is enabled the :ref:`AIC parameters ` must be configured in the ccloc bindings profiles. .. note:: Some general parameters can be overridden by the template event profiles and the profiles in the module and the bindings configration. The last occurrence takes higest priority. Once configured in any instance, the default values do not apply. #. **Configure ccloc bindings:** Only stations with ccloc bindings will be considered. Therefore, create at least one profile and configure the AIC parameters for the re-picker if activated. #. **Update** the bindings configration of the configured :program:`ccloc` instance, e.g. .. code-block:: sh seiscomp update-config ccloc #. **First test:** execute ccloc on the command line for matching the template event to its own waveforms. Use an :ref:`offline playback ` for testing. * The event must be found by its own template with a high match. The match is printed to the command line. * To compare the results, use the option ``--ep`` and redirect the output to a XML file which can be opened in :program:`scolv`. * Inspect the waveform files. Dump them with the command line option ``--dump``. Important other parameters -------------------------- * **Data processing:** * Set parameter :confval:`use3C` in the ccloc binding profile to decide whether or not to use 3 components for matching. If disabled, only the component for which the selected origin of the master event has an arrival will be considered. * Adjust :confval:`event.$name.procMargin` controlling how much data is added before :confval:`event.$name.noiseBegin` in order to compensate for the any artefact due to filtering and other data processing. Data in this range will not be considered for template matching. * **Event specific parameters:** * :confval:`event.$name.group` defining the membership of the master template to a group. The origins resulting from templates belonging to the same group are jointly evaluated if they were created within a timespan defined in :confval:`processing.interval`. Only the resulting origin with the highest overall match is sent to the messaging. .. _ccloc-mutliple-master-events: Multiple template events ------------------------ Multiple template events can be :ref:`defined ` in order to account for events of different sources for the same or for different regions. * Different sources in **the same region and with similar procssing**: Add all template events to the same :program:`ccloc` instance. Adjust the configuration parameters separately for each template in the module and binding configuration. * Sources in **different regions or with different processing**: :ref:`Create a new ccloc instance ` for each region or add to a existing instance. Configure individually. One new event may be detected by several template event of the same :program:`ccloc` instance. In this case keeping only the best solution with the highest overall fit instead of all may be desired. To keep only the best solution, template events can be grouped by :confval:`event.$name.group`. The best solution will then be selected from all solutions found from the template events of the same group arriving within a configured time window configured by :confval:`detector.window`. .. note:: Grouping is only possible within one :program:`ccloc` instance. .. _ccloc-confiugration-verify: Verification ------------ A first verification test should include to find the master event itself by template matching: Verify that time windows and data processing is appropriate. Filter effects must not disturb the data signal used for cross-correlation. 1. Run ccloc on the command line in dump mode on a dataset that contains the template event with all waveforms. In dump mode ccloc will generate output files from all processing steps in the ${event} directory which is created for all considered master events. * set dump output directory: :confval:`output.dump.directory` = ${DUMP_PATH} * enable dumping with the command line option ``--dump`` **Example:** a. assume simple configuration for the master event gempa2018abcd: .. code-block:: properties events = gempa2018abcd event.gempa2018abcd.data = gempa2018abcd.mseed output.dump.directory = /tmp/ccloc/ b. run ccloc: .. code-block:: sh ccloc -d localhost -I gempa2018abcd.mseed --dump --ep > /tmp/origins_ccloc.xml .. note:: The output files may be very large. To minimize the file sizes we recommended to use small input files. The output files are created in :confval:`output.dump.directory` for the template and the processed signal. Indices indicate the content: 0: raw waveforms 1: waveforms without gain 2: waveforms with subtracted mean 3: filtered waveforms 4: enveloped waveforms 5: resampled waveforms 6: logarithm of waveforms 7: prepared waveforms 8: data used for cross-correlation #. Verify the time window settings a. Display filtered template waveforms of the master event on top of filtered input data. .. code-block:: sh scrttv ${DUMP_PATH}/${event}/real/3_filtered.mseed ${DUMP_PATH}/${event}/master/3_filtered.mseed #. Navigate to the master template and check for differences between the signal of the master event template and the input signal * in scrttv press 4 to sort the traces and zoom into the individual channels * the template waveforms include the configured time windows of the noise and the signal * the overlapping of the template and the input signal is indicated in scrttv in pink * note that yellow areas indicate gaps which are expected in the order of one sample due uncertainties when cutting out the time windows * depending on the configured filter, differences at the beginning of the master template within the noise window are normal * however, make sure that the differences do not reach the signal window which is considered for template matching * decrease parameter event.${event}.noiseBegin until you are satisfied with the results .. code-block:: sh scrttv /tmp/ccloc/gempa2018abcd/real/3_filtered.mseed /tmp/ccloc/gempa2018abcd/master/3_filtered.mseed .. figure:: media/verify_windows.png :width: 12cm :align: center Template and signal with noise and signal windows optimized for filtering. #. Verify filter, envelope and time window settings. a. Run ccloc in dump mode as described above. #. Display raw and signal data of the master template side by side. .. code-block:: sh $ scrttv ${DUMP_PATH}/${event}/master/0_raw.mseed ${DUMP_PATH}/${event}/master/8_signal.mseed * ccloc uses location code '09' to highlight the signal data used for cross-correlation * press 4 to bring related channels close to each other * load picks of master event (File -> Open XML) * verify that the envelopes created by ccloc match your expectations (make sure P- and S-waves are covered correctly) * adjust parameters event.${event}.signalBegin and event.${event}.signalEnd until you are satisfied with the results .. figure:: media/verify_signal-windows.png :width: 12cm :align: center Envelope of template correct and too short signal windows. #. Review matching results. a. Run ccloc in dump mode as described above. #. Compare envelopes of template with real data. .. code-block:: sh scrttv ${DUMP_PATH}/${event}//master/4_enveloped.mseed ${DUMP_PATH}/${event}/real/4_enveloped.mseed #. navigate to a location where you expect a match in both windows #. compare the envelopes with each other - both should match .. _sec-ccloc-pipeline: Pipeline or multi-area application ================================== ccloc can be applied in different processing pipelines and for different purposes simultaneously. In order to avoid clashes in configuration parameters for such applications or to separate the processing, different instances of ccloc can be configured and executed. E.g. for a new instance named "l1" create a ccloc alias and treat it separately. .. code-block:: sh seiscomp alias create l1ccloc ccloc .. note:: Using aliases in separated pipelines can be most powerful when sending all phase picks, amplitudes, magnitudes and origins to a new message group as defined by :confval:`connection.primaryGroup`. The message group must be generated by configuration of :cite:t:`scmaster`. The sent origins, picks, etc. can then be received by other modules such as :cite:t:`scanloc` or :cite:t:`scolv` or :cite:t:`scrttv` when configuring :confval:`connection.subscriptions` for these modules. .. _sec-ccloc-evaluation: Origin evaluation ================= ccloc adds a comment field to the new origins containing the match parameters of the origin. These informations are also written to the log files of ccloc at output level 4 (debug) or on the commandline when starting ccloc with the option ``--debug``. The comment field can be shown in the Events tab of :program:`scolv` and the other event lists. To show the comment configure a custom column in the :program:`scolv` configuration :file:`scolv.cfg`: .. code-block:: properties # Default value to display if the specified origin or event comment id was not # found. eventlist.customColumn.default = "-" # Define the comment id to be used eventlist.customColumn.originCommentID = configID # Define the column header label eventlist.customColumn = ccloc-config To view the comment values in :program:`scolv`, expand the event entry in the Events table and list the origins. The origins created with ccloc will show the comment values in the configured custom column: * overall (mean) fit calculated from the fit values of all matched channels. * number of traces which have match vs. number of tested traces * number of stations which have a match vs. number of tested stations. .. figure:: media/ccloc-scolv-customncolumn.png :width: 12cm :align: center Events table with ccloc custom column in the :program:`scolv` main window. .. _sec-ccloc-compute-resources: Compute resources ================= ccloc supports CPU multi-threading and GPU processing. The number of CPU threads can be configured with option :confval:`computeResources.numThreads`. By default, only a single CPU thread is used. GPU processing requires CUDA support by the GPU. GPU processing can be enabled with the option :confval:`computeResources.useGPU` disabling CPU processing and ignoring :confval:`computeResources.numThreads`. Due to major refactorings, the single-threaded implementation ccloc in the current version is up to 3 times faster than in versions 2022.258#92f623e. The benchmark tests show that a significant speed-up is achieved by multi-threading and GPU computation. .. figure:: media/benchmark.png :align: center :width: 12 cm Benchmarking of the effect of multi-threading and GPU computation based on a single master event. Left: Short signal but many channels were defined by the master event. Right: Long signal but few channels were defined by the master event. The benchmark tests were executed on an Intel Core i7-2600K processor (3.40GHz, 4 Cores, 8 Threads) and an NVIDIA GeForce GTX 980 Ti graphics card. The results may differ on other systems and due to different CPU load. .. _sec-ccloc-examples: Examples ======== #. Print the command-line **help** of ccloc: .. code-block:: sh ccloc -h #. **Real-time applications** * Run ccloc in real time on the command line with descriptive debug output and configured values: .. code-block:: sh ccloc --debug * Run ccloc in real time as a daemon whenever seiscomp is started: .. code-block:: sh seiscomp enable ccloc seiscomp start ccloc * Run ccloc in real time on demand line while reading the binding configuration from a dedicated database on a specific host: .. code-block:: sh ccloc -d mysql:/sysop:sysop@localhost/seiscomp ccloc -d localhost #. **Non-real-time applications** You may process waveforms by ccloc at any time in non-real-time applications with or without connection to a messaging system. * Execute ccloc offline with a multiplexed :term:`miniSEED` volume. Get the inventory from the database or an inventory and a bindings configuration XML file. No messaging connection is required. The resulting origin parameters are printed to stdout and can be redirected to an XML file. Examples .. code-block:: sh ccloc --ep -I test-sorted.mseed -d localhost > /tmp/origins_ccloc.xml ccloc --ep -I test-sorted.mseed --inventory-db inventory.xml --config-db config.xml > /tmp/origins_ccloc.xml The inventory and config XML files can be generated by :cite:t:`scxmldump`. The results can be treated in :option:`--ep` playbacks by modules such as :cite:t:`scanloc`, :cite:t:`screloc`, :cite:t:`scamp`, :cite:t:`scmag` or :cite:t:`scevent`. Send the results to the messaging for automatic processing by connected modules or dump them to the database without further processing. Example: .. code-block:: sh scdispatch -i /tmp/origins_ccloc.xml -H localhost scdb -i /tmp/origins_ccloc.xml -d localhost * Execute ccloc offline with a multiplexed miniSEED volume. Do not generate any XML output but only information on the processing. A messaging system is not required and the inventory and bindings can be read from the database or XML files as in the example above. Example: .. code-block:: sh ccloc --offline -d localhost -I test-sorted.mseed Module Configuration ==================== | :file:`etc/defaults/global.cfg` | :file:`etc/defaults/ccloc.cfg` | :file:`etc/global.cfg` | :file:`etc/ccloc.cfg` | :file:`~/.seiscomp/global.cfg` | :file:`~/.seiscomp/ccloc.cfg` ccloc inherits :ref:`global options`. .. note:: Modules/plugins may require a license file. The default path to license files is :file:`@DATADIR@/licenses/` which can be overridden by global configuration of the parameter :confval:`gempa.licensePath`. Example: :: gempa.licensePath = @CONFIGDIR@/licenses .. confval:: events Type: *list:string* Profile names for one or more templates defined in the events section. It can be a single name or a list of event profile names. In a list the names are separated by comma. .. confval:: profiles Type: *list:string* Add one or more available processing profiles defined in the profile section below. It can be a single name or a list of profile names. Processing profiles can be created and used for processing with different templates. Profiles must be registered here for further use. Note: This option is deprecated. Please configure per channel properties in the ccloc bindings. .. confval:: before Default: ``0`` Unit: *s* The timespan in seconds before now to start processing. Use \-1 to let ccloc choose a timespan to speed up the initial window filling. .. note:: **computeResources.\*** *Configuration of compute resources.* .. confval:: computeResources.numThreads Default: ``1`` Type: *int* Number of CPU threads used for processing. Only relevant if GPU processing is disabled. .. confval:: computeResources.useGPU Default: ``false`` Type: *boolean* Enables GPU processing. If enabled, 'numThreads' will be ignored. .. note:: **restart.\*** *ccloc can save its state on module shutdown to be able to continue* *seamlessly after a restart. This section provides options to configure* *the restart behavior.* .. confval:: restart.maxTimeGap Default: ``0`` Unit: *min* Type: *double* Defines the maximum time duration between last shutdown and current restart that is tolerated by ccloc. The saved state will be reset if this threshold is exceeded. Missed events may get lost. Use a value of 0 to disable stateful restarts entirely. .. note:: **processing.\*** *Data processing before correlation detection.* *Many of these parameters can be overwritten per template event in* *the module configuration and per processing profile in the ccloc* *bindings.* .. confval:: processing.bufferSize Default: ``600`` Unit: *s* Type: *int* Data buffer size \(integer values\). This parameter is important when testing with record volumes where records are not ordered by time. .. confval:: processing.interval Default: ``0`` Unit: *s* Type: *int* Processing interval \(integer values\). If records are received, it will process the data every n seconds and not more often. 0 disables the interval and starts processing whenever a new record is received and enough data is available. .. confval:: processing.maximumLatency Default: ``30`` Unit: *s* Type: *double* Defines the maximum data latency in seconds tolerated by the detector. If data latency is higher than this value, processing is triggered without this particular channel. .. confval:: processing.maximumStepFrequency Default: ``0`` Type: *int* The maximum frequency of processing steps per time window. If the data sampling frequency is much higher, this parameter reduces processing time by increasing the time steps. A value of zero derives the time steps from the data or envelopes sampling frequency. Please note: Changing this parameter might have a strong negative impact on the matching results. Choose carefully. .. confval:: processing.maxAllowedGap Default: ``0.5`` Unit: *s* Type: *double* Sets the maximum allowed gap between two samples. This parameter can be overwritten per template. .. confval:: processing.maxAllowedOverlap Default: ``0.5`` Unit: *s* Type: *double* Sets the maximum allowed overlap between two samples. This parameter can be overwritten per template. .. confval:: processing.normalization Default: ``trace`` Type: *string* Flag for normalization: trace or total. .. confval:: processing.filter.definition Type: *string* Filter applied to the raw waveforms. Make sure to define a margin by 'procMargin' per event profile which is large enough allowing to compensate for all filter artefacts before the beginning of the noise and signal windows. Filtering can be overwritten per template event and processing profile. .. confval:: processing.filter.bandStop Default: ``false`` Type: *boolean* Enables a bandstop filter at 50Hz and 100Hz. For more specific frequencies use the SeisComP filter BW_BS\(\). This parameter can be overwritten per template event and processing profile. .. note:: **processing.envelope.\*** *Waveform envelopes can be used as characteristic functions.* *Envelopes are formed from pre-processed data.* .. confval:: processing.envelope.enable Default: ``true`` Type: *boolean* Use envelope as characteristic function for fitting. This parameter can be overwritten per template and processing profile. .. confval:: processing.envelope.samplingFrequency Default: ``20`` Unit: *Hz* Type: *int* Sampling frequency of the envelope \(0 \= no resampling\). Low sampling frequencies speed up the computations. Resampling at least twice the upper corner frequency of the filter. This parameter can be overwritten per template and processing profile. .. confval:: processing.envelope.hiFreq Default: ``20`` Unit: *Hz* Type: *double* Frequency for smoothing the envelope \(0 \= no smoothing\). This parameter will be set to the samplingFrequency for values less than or equal to 0. See documentation section \"Envelope\" for details. This parameter can be overwritten per template and processing profile. .. confval:: processing.envelope.resampleAverage Default: ``false`` Type: *boolean* Enables averaging of neighboring samples when downsampling. The width of the kernel is the ratio of SF\/samplingFrequency. SF is the sampling rate of the original data before resampling. This parameter can be overwritten per template and processing profile. .. confval:: processing.logarithm.enable Default: ``false`` Type: *boolean* Use the logarithm of the characteristic function \(either waveforms or envelope\). This parameter can be overwritten per template and processing profile. .. note:: **detector.\*** *Detection by cross-correlation including detection thresholds after* *data pre-processing.* *Many of these parameters can be overwritten per template.* .. confval:: detector.channelThreshold Default: ``0.70`` Type: *double* Minimum channel fit to be reached for declaring a match on the channel. Formed by cross\-correlating with waveforms of the template. Parameter range: 0 \- 1. This parameter can be overwritten per template. .. confval:: detector.threshold Default: ``0.75`` Type: *double* Minimum overall \(mean\) fit of all matched channels. Formed from the channel fits of all matched channels. Needs to be reached to declare a new origin. Parameter range: 0 \- 1. This parameter can be overwritten per template. .. confval:: detector.minimumChannelRatio Default: ``0.60`` Type: *double* Minimum ratio of the number of all matched channels vs. the number of all channels in the template. Needs to be reached to declare a new origin. Parameter range: 0 \- 1. This parameter can be overwritten per template. .. confval:: detector.minimumStationRatio Default: ``0.60`` Type: *double* Minimum ratio of the number of all matched stations vs. the number of stations in the template. A station is matched if it has at least one matched channel. Needs to be reached to declare a new origin. Parameter range: 0 \- 1. This parameter can be overwritten per template. .. confval:: detector.fitWindow Default: ``0.5`` Unit: *s* Type: *double* Time window to search for the best match on all waveforms for a given detection. Important parameter to account for traveltime uncertainties w.r.t. the template. .. confval:: detector.window Default: ``2`` Unit: *s* Type: *double* Time window to search for other detections after triggering. Only the detection with the best overall match is reported. Set this window for avoiding multiple detections on the same event. .. confval:: detector.minimumProcessingWindow Default: ``20`` Unit: *s* Type: *double* Sets the minimum processing time window length to minimize processing steps on each record arrival. With 0s data processing starts as soon as possible. Higher values may increase processing speed in non\-real\-time scenarios. This parameter can be overwritten per template. .. confval:: detector.groupPublicationTimeout Default: ``10`` Unit: *s* Type: *int* If event groups are used and an event is declared which still needs to wait for all other events in the group to be processed, this timeout is used to publish the best event of this group after a certain amount of time regardless of unprocessed events in the group. A negative value disables this feature and a queued event never times out. .. note:: **repicking.\*** *Refinement of picks after detection.* .. confval:: repicking.enableAIC Default: ``true`` Type: *boolean* Run AIC to refine P and S picks found from template matching. The AIC parameters can be configured via ccloc station bindings. This parameter can be overwritten per template. .. confval:: repicking.sendTheoreticalPicks Default: ``false`` Type: *boolean* Send theoretical picks from template matching like TP and TS. .. confval:: repicking.sendAICPicks Default: ``false`` Type: *boolean* Send picks repicked by AIC after template matching which do not reach the minimum SNR as AP, AS, etc.. .. confval:: repicking.score.minScore Default: ``0`` Type: *double* Score to be reached to send origin. .. confval:: repicking.score.pWeight Default: ``1`` Type: *double* Defines the weight of P arrivals for scoring. .. confval:: repicking.score.sWeight Default: ``2`` Type: *double* Defines the weight of S arrivals for scoring. .. note:: **output.\*** *Output origin properties and auxiliary information for debugging and tuning.* .. confval:: output.events.file Type: *string* Output file for reporting matched events. Each match creates a new line with format yyyy mm dd HH MM SS.FFF Lat Long Mag city CF usedPhases \(cha:fit, ...\). If not set, no event file is created. .. confval:: output.origins.status Default: ``preliminary`` Type: *string* Status given to new origins. \"preliminary\" is default since origins by ccloc are not located. Empty value: do not set the status. Possible values: \"\", rejected, reported, preliminary, confirmed, reviewed, final .. note:: **output.dump.\*** *Configuration of waveform dumping. Run ccloc with --dump to enable these* *parameters.* .. confval:: output.dump.directory Type: *string* Define location of dump files as a path to an already existing directory. .. confval:: output.dump.eachStep Default: ``false`` Type: *boolean* Dump each step. An appropriate time window can be configured with parameters output.dump.startTime and output.dump.endTime. Note that this may produce a lot of files. It can be necessary to increase the number of maximum opened files on your system. Enable this option only with small input files or short time windows. .. confval:: output.dump.startTime Type: *string* Time to start dumping of single steps \(requires parameter output.dump.eachStep to be enabled\). Formats: \"YYYY\-MM\-DD hh.mm.ss\", YYYY\-MM\-DDThh.mm.ss. .. confval:: output.dump.endTime Type: *string* Time to stop dumping of single steps \(requires parameter output.dump.eachStep to be enabled\). Formats: \"YYYY\-MM\-DD hh.mm.ss\", YYYY\-MM\-DDThh.mm.ss. .. note:: **event.\*** *Define template events and data processing per template event. Processing* *profiles can be defined and used instead of defining the* *parameters per template.* .. note:: **event.$name.\*** *Defines one template event. The template event contains the eventID,* *the event type (optional), the origin parameters, arrivals* *and picks. The configuration parameters for processing, detector* *and repicking overwrite the module-wide defined values which* *are used otherwise.* $name is a placeholder for the name to be used and needs to be added to :confval:`events` to become active. .. code-block:: sh events = a,b event.a.value1 = ... event.b.value1 = ... # c is not active because it has not been added # to the list of events event.c.value1 = ... .. confval:: event.$name.baseID Type: *string* Defines the event or pick ID to use. event ID: This is the default operating mode. The processing is based on a given origin which is configured by parameter originID. pick ID: In this mode, a single channel template, which is defined by the given pick, will be used for pattern matching on all enabled channels \(pick mode\). As a result, only picks and no origins will be sent out by ccloc. Event or pick will be read from the database if no XML file is defined. Otherwise, the it will be loaded from the XML file. .. confval:: event.$name.xml Type: *string* Defines an event parameter XML file to extract the information from the XML file: eventID, event type, originID, origin time, magnitude, latitude, longitude and depth. Furthermore arrivals and picks are collected to define the arrival times and the phase hints. If xml is not selected, the parameters are read from the SeisComP database. EXAMPLE: \@DATADIR\@\/ccloc\/baseID\/baseID.xml .. confval:: event.$name.originID Default: ``preferred`` Type: *string* Defines the origin ID used to extract the following information from the XML file or the database: origin time, magnitude, latitude, longitude and depth. Furthermore arrivals and picks are collected and used to create the final origin. If not set, the preferred origin is considered. Unused in pick mode. .. confval:: event.$name.magnitudeID Default: ``preferred`` Type: *string* Defines the magnitude ID. The magnitude will be read from the database if no XML file is defined. Otherwise, it will be loaded from the XML file. Unused in pick mode. .. confval:: event.$name.data Type: *string* Defines the data URI for fetching the waveforms. The format is equal to the \-\-record\-url parameter. E.g. it can point to a file, an archive or a server. If not set, the template waveforms are requested using the configured RecordStream. .. confval:: event.$name.procMargin Unit: *s* Type: *double* Defines the begin of the master template relative to the first P arrival. It should be used to add a margin in front of the noise and signal window allowing to compensate for all filter artefacts before detection. The value must be less than noiseBegin and signalBegin. By default, a margin of the same length as the noise window is prepended to the implicitly defined template begin. If procMargin and noise window are unconfigured, 2 seconds are prepended. This parameter can be overwritten in a processing profile. .. confval:: event.$name.noiseBegin Unit: *s* Type: *double* Defines the begin of the noise window. The mean is computed from the noise window and removed from the whole envelope. This value is relative to the first P arrival. If not given, then noiseBegin is set to signalBegin. The minimum mean of both defined noise windows is used finally. This parameter can be overwritten in a processing profile. .. confval:: event.$name.noiseEnd Unit: *s* Type: *double* Defines the end of the noise window. The mean is computed from the noise window and removed from the whole envelope. This value is relative to the first P arrival. If not given, noiseEnd is set to signalBegin + 1. The minimum mean of both defined noise windows is used finally. This parameter can be overwritten in a processing profile. .. confval:: event.$name.noise2Begin Unit: *s* Type: *double* Defines the begin of the second noise window. This value is relative to the first P arrival. If not given, noise2Begin is set to signalBegin. The minimum mean of both defined noise windows is used finally. This parameter is optional and set to noiseBegin if not given. Please note: In most cases it is not necessary to set this parameter. This parameter can be overwritten in a processing profile. .. confval:: event.$name.noise2End Unit: *s* Type: *double* Defines the end of the second noise window. This value is relative to the first P arrival. If not given, noiseEnd is set to signalBegin + 1. The minimum mean of both defined noise windows is used finally. This parameter is optional and set to noiseEnd if not given. Please note: In most cases it is not necessary to set this parameter. This parameter can be overwritten in a processing profile. .. confval:: event.$name.signalBegin Unit: *s* Type: *double* Defines the begin of the signal window used for cross\-correlation. Relative to the first P arrival. Mandatory unless defined in a processing profile. This parameter can be overwritten in a processing profile. .. confval:: event.$name.signalEnd Unit: *s* Type: *double* Defines the end of the signal window used for cross\-correlation. Relative to the first S arrival. Mandatory unless defined in a processing profile. This parameter can be overwritten in a processing profile. .. confval:: event.$name.deltaM Type: *double* Defines a magnitude offset which is applied to the final magnitude. .. confval:: event.$name.enable Default: ``true`` Type: *boolean* Enables or disables processing of template data. If disabled, the data is used as provided. Incoming data are processed in any way. If disabled, the provided data must have been processed the same way as the current configuration. .. confval:: event.$name.profiles Type: *list:string* Assigns a list of processing profiles for processing the current template. The profiles must be defined in the profile configuration section. Note: This option is deprecated. Please configure per channel properties in the ccloc bindings. .. confval:: event.$name.group Type: *string* Defines a group name for detected events. Results from template events belonging to the same group are jointly evaluated. Only the result with the best match is considered. Therefore, only one event of a group can occur at one time. If the group is empty, the event is independent and forms a group containing only this event. Configure groupPublicationTimeout for defining the wait time. .. confval:: event.$name.negative Default: ``false`` Type: *boolean* If enabled, this event is a negative event. Negative event detections don't create an origin. They can be used to suppress false alarms. .. note:: **event.$name.tolerances.\*** *The following options define thresholds used by ccloc to decide whether a* *template should be used even if errors occur.* *Use these options with caution. It should be preferred to use well prepared* *templates to avoid unexpected results.* .. confval:: event.$name.tolerances.maxImproperChannels Default: ``0`` Type: *int* Sets the maximum number of improper channels tolerated by ccloc. Use \-1 to tolerate any number of improper channels. .. confval:: event.$name.tolerances.maxImproperStations Default: ``0`` Type: *int* Sets the maximum number of improper stations tolerated by ccloc. Use \-1 to tolerate any number of improper stations. .. confval:: event.$name.tolerances.minProperChannels Default: ``0`` Type: *int* Sets the minimum required number of properly configured channels. .. confval:: event.$name.tolerances.minProperStations Default: ``0`` Type: *int* Sets the minimum required number of properly configured stations. .. confval:: event.$name.tolerances.ignoreImproperEvent Default: ``false`` Type: *boolean* Defines whether this event should be ignored if classified as improper. If set to 'false', processing will be aborted if this event is not properly configured. .. confval:: event.$name.processing.maxAllowedGap Unit: *s* Type: *double* Sets the maximum allowed gap between two samples. .. confval:: event.$name.processing.maxAllowedOverlap Unit: *s* Type: *double* Sets the maximum allowed overlap between two samples. .. confval:: event.$name.processing.filter.definition Type: *string* Filter applied to the raw waveforms. Make sure to define a margin by procMargin per event profile which is large enough to compensate for all filter artefacts before the beginning of the noise and signal windows. This parameter can be overwritten in a processing profile. .. confval:: event.$name.processing.filter.bandStop Type: *boolean* Enables a bandstop filter at 50Hz and 100Hz. For more specific frequencies use the SeisComP filter BW_BS\(\). This parameter can be overwritten in a processing profile. .. note:: **event.$name.processing.envelope.\*** *Waveform envelopes can be used as characteristic functions.* *Envelopes are formed from pre-processed data.* .. confval:: event.$name.processing.envelope.enable Type: *boolean* Compute envelope to be used for fitting. This parameter can be overwritten in a processing profile. .. confval:: event.$name.processing.envelope.samplingFrequency Unit: *Hz* Type: *int* Defines the target sampling frequency of the envelope \(0 \= no resampling\). This parameter can be overwritten in a processing profile. .. confval:: event.$name.processing.envelope.hiFreq Unit: *Hz* Type: *double* Frequency for smoothing the envelope \(0 \= no smoothing\). This parameter will be set to the samplingFrequency for values less than or equal to 0. See documentation section \"Envelope\" for details. This parameter can be overwritten in a processing profile. .. confval:: event.$name.processing.envelope.resampleAverage Type: *boolean* Enables averaging of neighbor samples when downsampling. The width of the kernel is the ratio of SR\/samplingFrequency. This parameter can be overwritten in a processing profile. .. confval:: event.$name.processing.logarithm.enable Type: *boolean* Use the logarithm of the characteristic function \(either waveforms or envelope\). This parameter can be overwritten in a processing profile. .. note:: **event.$name.detector.\*** *Parameters defining the detection thresholds.* *These parameters overwrite the corresponding entries of* *the global configuration. The general settings are used* *for parameters that are not explicitly defined here.* .. confval:: event.$name.detector.channelThreshold Type: *double* Minimum channel fit to be reached for declaring a match on the channel. Formed by cross\-correlating with the template waveforms. .. confval:: event.$name.detector.threshold Type: *double* Minimum overall \(mean\) fit of all matched channels. Formed from all channel fits. Needs to be reached to declare a new origin. .. confval:: event.$name.detector.minimumChannelRatio Type: *double* Minimum ratio of the number of all matched channels vs. the number of all proper channels in the template. Needs to be reached to declare a new origin. .. confval:: event.$name.detector.minimumStationRatio Type: *double* Minimum ratio of the number of all matched stations vs. the number of proper stations in the template. A station is matched if it has at least one matched channel. Needs to be reached to declare a new origin. .. confval:: event.$name.detector.fitWindow Unit: *s* Type: *double* Time window to search for the best match on all waveforms for a given detection. Important parameter to account for traveltime uncertainties w.r.t. the template. .. confval:: event.$name.detector.minimumProcessingWindow Unit: *s* Type: *double* Sets the minimum processing time window length in seconds to minimize processing steps on each record arrival. With 0s data processing starts as soon as possible. Higher values may increase processing speed in non\-real\-time scenarios. .. confval:: event.$name.repicking.enableAIC Type: *boolean* Run AIC to refine P and S picks found from template matching. The AIC parameters can be configured via the ccloc station bindings. A processing profile is required to change the default filter settings. .. confval:: event.$name.array.referenceLocation Type: *string* Enables array processing and configures the array's reference location. The value must include network, station and sensor location \(\"{net}.{sta}.{loc}\"\). .. note:: **profile.\*** *Processing profiles can be referenced by event profiles allowing* *the same parameters to be used by multiple templates.* *The profile parameters overwrite parameters in the event* *definition.* *Important: Processing profiles are deprecated. Please configure per* *channel properties via the ccloc bindings.* .. note:: **profile.$name.\*** *Defines a profile. Filter options can be overwritten* *on a per stream basis, otherwise the global values are used.* $name is a placeholder for the name to be used and needs to be added to :confval:`profiles` to become active. .. code-block:: sh profiles = a,b profile.a.value1 = ... profile.b.value1 = ... # c is not active because it has not been added # to the list of profiles profile.c.value1 = ... .. confval:: profile.$name.streams Type: *list:string* Defines a list of stream patterns for which filter values shall be overwritten. .. confval:: profile.$name.filter.definition Type: *string* Filter applied to the raw waveforms. Make sure to define a margin by procMargin per event profile which is large enough allowing to compensate for all filter artefacts before the beginning of the noise and signal windows. .. confval:: profile.$name.filter.bandStop Type: *boolean* Enables a bandstop filter at 50Hz and 100Hz. For more specific frequencies use the SeisComP filter BW_BS\(\). Bindings Parameters =================== .. confval:: detecEnable Default: ``true`` Type: *boolean* Enable data processing. If disabled, the station is not considered. .. confval:: use3C Default: ``true`` Type: *boolean* Use all three components for processing. If disabled, ccloc uses only the channel on which the pick in the template was made. .. confval:: profiles Type: *list:string* Add one or more processing profiles defined in the profiles section below. It can be a single name or a list of profile names. Profiles must be defined here for further use. Example: profile1,profile2 .. note:: **profile.\*** *Definition of processing profiles.* *The profile parameters overwrite parameters with the same name* *from the event definition in the module configuration.* *A profile definition is required to set custom AIC filter* *settings.* .. note:: **profile.$name.\*** *Definition of the named profile. Parameters can be overwritten on a per* *stream basis, otherwise the global values are used. Add profile* *name to the list of profiles for using it.* $name is a placeholder for the name to be used and needs to be added to :confval:`profiles` to become active. .. code-block:: sh profiles = a,b profile.a.value1 = ... profile.b.value1 = ... # c is not active because it has not been added # to the list of profiles profile.c.value1 = ... .. confval:: profile.$name.events Default: ``*`` Type: *list:string* Defines a list of events for which parameter values shall be overwritten. Wildcards can be used to declare multiple events per list entry. By default, all defined events will be used. .. confval:: profile.$name.streams Default: ``*`` Type: *list:string* Defines a list of streams for which parameter values shall be overwritten. Wildcards can be used to declare multiple streams per list entry. By default, all available streams will be used. .. confval:: profile.$name.detecEnable Default: ``true`` Type: *boolean* Enable data processing. If disabled, the selected streams are not considered. .. confval:: profile.$name.procMargin Unit: *s* Type: *double* Defines the begin of the master template relative to the first P arrival time. It should be used to add a margin before the noise and the signal window to avoid filter artefacts. The value must be less than the begin of the signal and noise windows. By default, a margin of the same length as the noise window is prepended to the implicitly defined template begin. If procMargin and noise window are unconfigured, 2 seconds are prepended. .. confval:: profile.$name.noiseBegin Unit: *s* Type: *double* Defines the begin of the noise window if envelope is enabled. The mean is computed from the noise window and removed from the whole envelope. This value is relative to the first P arrival. If not given, noiseBegin is set to signalBegin. The minimum mean of both defined noise windows is used finally. .. confval:: profile.$name.noiseEnd Unit: *s* Type: *double* Defines the end of the noise window if envelope is enabled. The mean is computed from the noise window and removed from the whole envelope. This value is relative to the first P arrival. If not given, noiseEnd is set to signalBegin + 1. The minimum mean of both defined noise windows is used finally. .. confval:: profile.$name.noise2Begin Unit: *s* Type: *double* Defines the begin of the second noise window if envelope is enabled. This value is relative to the first P arrival. If not given, noise2Begin is set to signalBegin. The minimum mean of both defined noise windows is used finally. This parameter is optional and set to noiseBegin if not given. Please note: In most cases it is not necessary to set this parameter. .. confval:: profile.$name.noise2End Unit: *s* Type: *double* Defines the end of the second noise window if envelope is enabled. This value is relative to the first P arrival. If not given, noiseEnd is set to signalBegin + 1. The minimum mean of both defined noise windows is used finally. This parameter is optional and set to noiseEnd if not given. Please note: In most cases it is not necessary to set this parameter. .. confval:: profile.$name.signalBegin Unit: *s* Type: *double* Defines the begin of the signal window used for cross\-correlation. Relative to the first P arrival. Mandatory if not specified in the module configuration. .. confval:: profile.$name.signalEnd Unit: *s* Type: *double* Defines the end of the signal window used for cross\-correlation. Relative to the first S arrival. Mandatory if not specified in the module configuration. .. note:: **profile.$name.processing.\*** *Data processing before matching.* *These parameters overwrite the corresponding entries of* *the module configuration. If a parameter is not defined,* *it will be used from the module configuration.* .. note:: **profile.$name.processing.filter.\*** *Data filtering. If envelope calculation is disabled,* *the filtering can be used to create any characteristic* *function for data matching.* .. confval:: profile.$name.processing.filter.definition Type: *string* Filter applied to the raw waveforms. Make sure to define a margin by procMargin per event profile which is large enough allowing to compensate for all filter artefacts before the beginning of the noise and signal windows. The deprecated parameters order and hiFreq of this group are ignored if a value is set. .. confval:: profile.$name.processing.filter.bandStop Type: *boolean* Enables a bandstop filter at 50Hz and 100Hz. For more specific frequencies use the SeisComP filter BW_BS\(\). .. note:: **profile.$name.processing.envelope.\*** *Waveform envelopes can be used as characteristic functions.* *Envelopes are formed from pre-processed data.* .. confval:: profile.$name.processing.envelope.enable Type: *boolean* Compute envelope to be used for fitting. .. confval:: profile.$name.processing.envelope.samplingFrequency Unit: *Hz* Type: *int* Defines the target sampling frequency of the envelope \(0 \= no resampling\). .. confval:: profile.$name.processing.envelope.hiFreq Unit: *Hz* Type: *double* Frequency for smoothing the envelope \(0 \= no smoothing\). This parameter will be set to the samplingFrequency for values less than or equal to 0. See documentation section \"Envelope\" for details. .. confval:: profile.$name.processing.envelope.resampleAverage Type: *boolean* Enables averaging of neighbor samples when downsampling. The width of the kernel is the ratio of SR\/samplingFrequency. .. confval:: profile.$name.processing.logarithm.enable Type: *boolean* Use the logarithm of the characteristic function \(either waveforms or envelope\). .. note:: **profile.$name.ppicker.\*** *Parameters controlling the refinement of P-type phase picks using* *the AIC methods. P-type phase picks include any phase arriving at* *the station as a P phase, e.g. P, pP, Pn, PKP, etc. The AIC is* *applied to the component on which the P pick of the event* *was made.* .. confval:: profile.$name.ppicker.procMargin Default: ``-3`` Unit: *s* Type: *double* Begin of processing time window relative to the TP pick. The processing window should start before the AIC window allowing all filter artefacts to be diminished. .. confval:: profile.$name.ppicker.signalBegin Default: ``-1`` Unit: *s* Type: *double* Begin of AIC time window relative to the TP pick. .. confval:: profile.$name.ppicker.signalEnd Default: ``1`` Unit: *s* Type: *double* End of AIC time window relative to the TP pick. .. confval:: profile.$name.ppicker.filter Default: ``RMHP(2)>>ITAPER(1)>>BW(3,2,20)`` Type: *string* Filter applied to the data before AIC analysis. Filtering starts at procMargin allowing to compensate for all filter artefacts. This parameter also accepts a list of filters separated by semicolon. In this case multiple AIC runs will be performed and the result with the highest SNR value will be used further. .. confval:: profile.$name.ppicker.minSNR Default: ``3`` Type: *double* Minimum SNR which must be reached at the detection time of the AIC. Otherwise no pick is created. .. note:: **profile.$name.spicker.\*** *Parameters controlling the refinement of S-type phase picks using* *the AIC methods. S-type phase picks include any phase arriving at* *the station as an S phase, e.g. S, sS, Sn, PKS, etc. The AIC is* *applied on the L2 norm of the horizontal components or on the* *vertical component of the if the S pick was made on the* *vertical component.* .. confval:: profile.$name.spicker.procMargin Default: ``-3`` Unit: *s* Type: *double* Begin of processing time window relative to the TS pick. As filtering may result in artefacts, the processing window should start before the AIC window allowing all artefacts to be diminished. .. confval:: profile.$name.spicker.signalBegin Default: ``-1`` Unit: *s* Type: *double* Begin of AIC time window relative to the TS pick. .. confval:: profile.$name.spicker.signalEnd Default: ``1`` Unit: *s* Type: *double* End of AIC time window relative to the TS pick. .. confval:: profile.$name.spicker.filter Default: ``RMHP(2)>>ITAPER(1)>>BW(3,2,10)`` Type: *string* Filter applied to the raw data before forming the L2 norm of the horizontal seismograms. This filter is recommended to account for DC offset of individual components. Filtering starts at procMargin allowing to compensate for all filter artefacts before phase picking. This parameter also accepts a list of filters separated by semicolon. In this case multiple AIC runs will be performed and the result with the highest SNR value will be used further. Please note that the number of filters must either be one or match the number of filters defined in parameter detecFilter. .. confval:: profile.$name.spicker.detecFilter Type: *string* Filter applied to the L2 trace of the data before AIC analysis. Filtering starts at procMargin. Leave this parameter empty to apply no further filtering. This is often the case. This parameter also accepts a list of filters separated by semicolon. In this case multiple AIC runs will be performed and the result with the highest SNR value will be used further. Please note that the number of filters must either be one or match the number of filters defined in parameter filter. .. confval:: profile.$name.spicker.minSNR Default: ``5`` Type: *double* Minimum SNR which must be reached at the detection time of the AIC. Otherwise no pick is created. Command-Line Options ==================== 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. Example: 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 \&. .. option:: --auto-shutdown arg Enable\/disable self\-shutdown because a master module shutdown. This only works when messaging is enabled and the master module sends a shutdown message \(enabled with \-\-start\-stop\-msg for the master module\). .. option:: --shutdown-master-module arg Set the name of the master\-module used for auto\-shutdown. This is the application name of the module actually started. If symlinks are used, then it is the name of the symlinked application. .. option:: --shutdown-master-username arg Set the name of the master\-username of the messaging used for auto\-shutdown. If \"shutdown\-master\-module\" is given as well, this parameter is ignored. 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 Limit the logging to a certain component. This option can be given more than once. .. option:: -s, --syslog Use syslog logging backend. 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 Execute in debug mode. Equivalent to \-\-verbosity\=4 \-\-console\=1 . .. option:: --log-file arg Use alternative log file. Messaging --------- .. option:: -u, --user arg Overrides configuration parameter :confval:`connection.username`. .. option:: -H, --host arg Overrides configuration parameter :confval:`connection.server`. .. option:: -t, --timeout arg Overrides configuration parameter :confval:`connection.timeout`. .. option:: -g, --primary-group arg Overrides configuration parameter :confval:`connection.primaryGroup`. .. option:: -S, --subscribe-group arg A group to subscribe to. This option can be given more than once. .. option:: --start-stop-msg arg Default: ``0`` Set sending of a start and a stop message. .. option:: --test Runs the detector without sending any objects to the messaging system. Database -------- .. option:: --db-driver-list List all supported database drivers. .. option:: -d, --database arg The database connection string, format: service:\/\/user:pwd\@host\/database. \"service\" is the name of the database driver which can be queried with \"\-\-db\-driver\-list\". .. option:: --config-module arg The config module to use. .. option:: --inventory-db arg Load the inventory from the given database or file, format: [service:\/\/]location . .. option:: --db-disable Do not use the database at all Records ------- .. option:: --record-driver-list List all supported record stream drivers. .. option:: -I, --record-url arg The recordstream source URL, format: [service:\/\/]location[#type]. \"service\" is the name of the recordstream driver which can be queried with \"\-\-record\-driver\-list\". If \"service\" is not given, \"file:\/\/\" is used. .. option:: --record-file arg Specify a file as record source. .. option:: --record-type arg Specify a type for the records being read. Mode ---- .. option:: --offline Do not connect to the messaging system. Implied with \-\-ep. Output ------ .. option:: --ep Print XML result to standard out and do not connect to the messaging system. \-\-offline applies implicitly. .. option:: --progress Print current processing time to stderr. .. option:: --progress-int arg Default: ``3600`` Unit: *s* Set the time interval to print the execution progress. Units: s. Default: 3600 s. .. option:: --dump Write each stage to file. Requires definition of configuration parameters in section `output.dump`. Settings -------- .. option:: --before arg Default: ``0`` Unit: *s* The timespan in seconds before now to start processing. Use \-1 to let ccloc choose a timespan to speed up the initial window filling.