gis

Gempa Image Server - Tiny Web server serving maps, tiles and trace images

Description

GIS is an image server allowing to generate images of various kinds showing event information, maps or waveform data. The images are generated upon request and delivered all formats supported by Qt: PNG, JPG, JPEG, BMP, PPM, TIFF, XBM, XPM.

The images can be generated interactively on demand or automatically and on demand by other modules, e.g. GDS.

Note

The GIS package is automatically provided as a separate package when purchasing GDS.

Sources of Information

GIS collects information from different sources depending on the requested data type. The source must be configured or the information must be provided:

  • Event and origin information are provided by HTTP POST as event XML. The include:

    • events with preferred origin, magnitude and focal mechanism / moment tensor,

    • origins with arrivals and magnitudes,

    • moment tensors

  • Inventory information are read from the SeisComP database or from a provided inventory XML file,

  • Waveforms are read from the configured RecordStream.

    Hint

    The RecordStream configuration must not include any real-time source, such as seedlink. Use the option ?arch when fetching data from a CAPS server

  • Map information:

    • Map Tiles - loaded from local tile store or map server,

    • Geo Features - loaded from BNA directory,

    • Geo Features - transmitted as JSON documents via HTTP POST,

    • Geo Images - transmitted via HTTP POST in order of their transmission,

    • Vector Layer - coordinate grid, cities loaed from cities XML file,

    • Event information,

    • Screen Images - transmitted via HTTP POST in order of their transmission.

Generating Requests

The GIS supports HTTP-GET and HTTP-POST requests. The detailed keys, values and descriptions are provided by the documentatin on the GIS Web page. The Web site is provided by the GIS server on port 20001 by default. To view the Web site, start the SeisComP messaging and gis:

seiscomp start scmaster
seiscomp exec gis --debug

Then open the Web site with the configured port and view the options, e.g.:

firefox localhost:20001
../_images/gis-webpage.png

Figure 1: GIS Web page exposed by default on http://localhost:20001.

Sending Requests

Requests can be sent to the GIS server in different ways depending on the request content, e.g.:

  • A custom Python script

  • Linux commands wget or curl

Find some examples in the section Examples.

Examples

Maps may contain event and station information alone or together. Data are shown as time series or Fourier spectra. This section provides examples for generating images interactively on demand.

Maps: event with stations

Plot event information from one more events along with stations providing arrivals. The event and station information are provided in a single file event-inventory.xml. Generate this file using scxmlmerge or provide the inventory to gis from the database:

scxmlmerge event.xml inventory.xml > event-inventory.xml
curl -X POST -d @event-inventory.xml "http://localhost:20001/map?&dim=1024,512&stations=*&&reg=-30,180,40,20" -o gis-event-map.png
../_images/gis-event-map.png

Figure 2: Map with event information, map features and stations providing arrivals.

Multiple events are plotted if contained in the event XML file.

Maps: stations

Generate a map of stations. Post the inventory XML file and draw all stations. The file can be created using scxmldump, e.g.:

scxmldump -d localhost -If -o inventory.xml ::
curl -X POST -d @inventory.xml "http://localhost:20001/map?&dim=1024,512&reg=0,110,20,10&stations=*" -o gis-stations.png
../_images/gis-stations.png

Figure 3: Example of a map with stations from inventory.

Waveform data with arrivals from events

Generate plots of waveforms with arrival information from one event. The posted file event.xml contains the complete event information. The file can be created for an event with ID eventID using scxmldump, e.g.:

scxmldump -d localhost -E [eventID] -PAf -o event.xml
curl -X POST -d @event.xml "http://localhost:20001/traces?dim=1024,1024&num=7&fmt=png&buffersize=360&orderby=distance&removeoffset=1&weight=1.0&filter=BW(3,1.0,9.0)&showpicks=true&showtt=true&start=2021-02-03T05:28:00&amprange=10000000&usegain=true" -o gis-traces-arrivals.png
../_images/gis-traces-arrivals.png

Figure 4: Example of a trace plot with arrival information.

While the measured phased arrivals are marked by red symbols, the theoretical times are indicated with blue dots.

Waveform data

Generate plots of waveforms for a given time range. Apply the gain to show physical units:

wget -O gis-traces.png "http://localhost:20001/traces?streams=IU.M*.00.BHZ&dim=1024,700&start=2020-05-01&bufferSize=30000&num=5&usegain=true"
../_images/gis-traces.png

Figure 5: Example of a trace plot.

Fourier spectra

Generate Fourier spectra from waveform data:

  • Amplitude spectra

    wget -O gis-spectra.png "http://localhost:20001/spectra?stream=IU.ANMO.00.BHZ&dim=1024,500&start=2020-05-01"
    
    ../_images/gis-spectra.png

    Figure 6: Example of a Fourier amplitude spectrum.

  • Phase spectra

    wget -O gis-spectra-phase.png "http://localhost:20001/spectra?stream=IU.ANMO.00.BHZ&dim=1024,500&start=2020-05-01?mode=phase"
    
    ../_images/gis-spectra-phase.png

    Figure 7: Example of a Fourier phase spectrum.

  • Power spectra

    wget -O gis-spectra-power.png "http://localhost:20001/spectra?stream=IU.ANMO.00.BHZ&dim=1024,500&start=2020-05-01&mode=power"
    
    ../_images/gis-spectra-power.png

    Figure 8: Example of a Fourier power spectrum.

Composite images

GIS can generate composite images consisting of different images generated before.

Module Configuration

etc/defaults/global.cfg
etc/defaults/gis.cfg
etc/global.cfg
etc/gis.cfg
~/.seiscomp/global.cfg
~/.seiscomp/gis.cfg

gis inherits global options.

Note

Modules/plugins may require a license file. The default path to license files is @DATADIR@/licenses/ which can be overridden by global configuration of the parameter gempa.licensePath. Example:

gempa.licensePath = @CONFIGDIR@/licenses
dbDisable

Default: false

Type: boolean

If set to true no inventory and configuration is fetched from the database. Also no connection attempt to the messaging system is made to retrieve the database parameters.

bind

Default: 127.0.0.1:20001

Type: host-with-port

IP and port to bind the command interface to. Use 0.0.0.0 to bind to all interfaces. Either the port or the IP address may be omitted, e.g. "0.0.0.0" or ":1234". If set to an empty string the application will run without providing a command interface.

rootURL

Type: string

Defines the root URL used to generate links. That option is only important if e.g. Apache with reverse proxy is used to forward GIS webpages.

mediaDirectory

Default: @DATADIR@/gis/media

Type: string

Path to media files (index.html, .css, .js, .ico, …) served by GIS.

accessLog

Default: false

Type: boolean

Enables HTTP access logging to @LOGDIR@/gis-http-access. Logfiles are created for 24h and kept for 7 days using log rotation.

ttt

Default: libtau

Type: string

Name of travel time table interface, e.g. ‘libtau’ or ‘locsat’

ttColors

Type: list:string

List of case sensitive phase name to color mappings, e.g. "P:red,S:#00ff00,PP:#aabbcc". Unmapped phases are not drawn.

ttRadius

Default: 3

Unit: px

Type: double

Radius of the travel time circles

errorImage

Default: false

Type: boolean

If enabled errors will be reported inside an image file. The HTTP status code will be set to ‘200 OK’ in this case.

urlLen

Default: 1024

Type: int

Maximum number of URL characters.

tilesTimeout

Default: 0

Unit: s

Type: double

Timeout in seconds after which the download of tiles should be aborted. On timeout the requested map image is rendered with an incomplete image layer. This option is only used if an asynchronous tile store is configured.

originSymbol

Type: string

Origin symbol image. If defined the image is plotted instead of the standard circle. The size and color still depends on the magnitude and depth.

Command-Line Options

Generic

-h, --help

Show help message.

-V, --version

Show version information.

--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.

--plugins arg

Load given plugins.

-D, --daemon

Run as daemon. This means the application will fork itself and doesn’t need to be started with &.

Verbosity

--verbosity arg

Verbosity level [0..4]. 0:quiet, 1:error, 2:warning, 3:info, 4:debug.

-v, --v

Increase verbosity level (may be repeated, eg. -vv).

-q, --quiet

Quiet mode: no logging output.

--component arg

Limit the logging to a certain component. This option can be given more than once.

-s, --syslog

Use syslog logging backend. The output usually goes to /var/lib/messages.

-l, --lockfile arg

Path to lock file.

--console arg

Send log output to stdout.

--debug

Execute in debug mode. Equivalent to --verbosity=4 --console=1 .

--log-file arg

Use alternative log file.

Server

-p, --port arg

Overrides configuration parameter port.