.. highlight:: rst

.. _scmapcut:

########
scmapcut
########

**Create image files containing maps of specific regions.**


Description
===========

*scmapcut* is a commandline tool to create image files containing maps of specific
regions and for selected events. When plotting events given by their eventID, the
event parameters must be provided in a SeisComP event XML file. The XML file can
be retrieved from the database using :ref:`scxmldump`.

Examples
========

1. Draw a map for the event with event ID <eventID>. Plot a region of at least
   3 degrees around the epicentre. The created image has 800x400 px.

   .. code-block:: sh

      scmapcut -E <eventID> --ep <eventID>.xml -m 3 -d 800x400 -o <eventID>.png

   .. _fig-workflow:

   .. figure:: media/gempa2017xxxx.png
      :align: center
      :width: 10cm

      Image example.

#. Draw a map for a generic event with magnitude 4. The size of the event shown
   on the map scales with magnitude. Plot a region of at least 3 degrees around
   the epicentre. The created image has 800x400 px.


   .. code-block:: sh

      scmapcut --lat 44 --lon 12 --depth 10 --mag 4 -m 0.5 -d 800x400 -o generic.png

   .. _fig-workflow_mag4:

   .. figure:: media/generic.png
      :align: center
      :width: 10cm

      Generic example.


.. _scmapcut_configuration:

Module Configuration
====================

| :file:`etc/defaults/global.cfg`
| :file:`etc/defaults/scmapcut.cfg`
| :file:`etc/global.cfg`
| :file:`etc/scmapcut.cfg`
| :file:`~/.seiscomp/global.cfg`
| :file:`~/.seiscomp/scmapcut.cfg`

scmapcut inherits :ref:`global options<global-configuration>`.




Command-Line Options
====================

.. program:: scmapcut

:program:`scmapcut [options]`


Generic
-------

.. option:: -h, --help

   Show help message.

.. option:: -V, --version

   Show version information.

.. option:: --config-file file

   The alternative module configuration file. When this option
   is used, the module configuration is only read from the
   given file and no other configuration stage is considered.
   Therefore, all configuration including the definition of
   plugins must be contained in that file or given along with
   other command\-line options such as \-\-plugins.

.. 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, e.g., \-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.


Cities
------

.. option:: --city-xml arg

   Type: *string*

   Path to the cities.xml file. If undefined, the data is
   read from CONFIGDIR\@\/cities.xml or \@DATADIR\@\/cities.xml.


Options
-------

.. option:: -r, --region arg

   Unit: *degree*

   Type: *string*

   Cut region \([lat_dim]x[lon_dim]+lat0+lon0 or +lat0+lon+lat1+lon1\).

.. option:: -m, --margin arg

   Unit: *degree*

   Type: *string*

   Margin in degrees around origin \(margin\|margin_latxmargin_lon\).

.. option:: -d, --dimension arg

   Unit: *px*

   Type: *string*

   Output image dimension \(wxh\).

.. option:: -o, --output arg

   Type: *string*

   Output image, file name.

.. option:: --lat arg

   Unit: *degree*

   Type: *float*

   Latitude of symbol.

.. option:: --long arg

   Unit: *degree*

   Longitude of symbol.

.. option:: --depth arg

   Unit: *km*

   Depth of event.

.. option:: --mag arg

   Magnitude of event.

.. option:: --layers arg

   Draw polygonal layers.

.. option:: --ep arg

   Name of XML file containing the event parameters to load.

.. option:: -E, --event-id arg

   Event ID of the event to plot on map.

.. option:: --html-area

   Print html\/area section.

.. option:: --without-arrivals

   Do not render arrivals \(stations\).

