config

Functions, classes and methods for configuring the RT-EQcorrscan system.

config.config

Handle configuration of RT_EQcorrscan using a yaml file.

class rt_eqcorrscan.config.config.Config(log_level='INFO', log_formatter='%(asctime)s\\t[%(processName)s:%(threadName)s]: %(name)s\\t%(levelname)s\\t%(message)s', **kwargs)[source]

Base configuration parameters from RT_EQcorrscan.

Parameters
  • log_level (str) – Any parsable string for logging.basicConfig

  • log_formatter (str) – Any parsable string formatter for logging.basicConfig

  • rt_match_filter – Config values for real-time matched-filtering

  • reactor – Config values for the Reactor

  • plot – Config values for real-time plotting

  • database_manager – Config values for the database manager.

  • template – Config values for template creation.

  • streaming – Config values for real-time streaming

  • notifier – Config values to notification services

setup_logging(screen=True, file=True, filename='rt_eqcorrscan.log', **kwargs)[source]

Set up logging using the logging parameters.

to_yaml_dict()[source]

Make a more human readable yaml format

Return type

dict

write(config_file)[source]

Write the configuration to a tml formatted file.

Parameters

config_file (str) – path to the configuration file. Will overwrite and not warn

Return type

None

class rt_eqcorrscan.config.config.DatabaseManagerConfig(*args, **kwargs)[source]

A holder for configuration values for database management.

Works like a dictionary and can have anything added to it.

class rt_eqcorrscan.config.config.NotifierConfig(*args, **kwargs)[source]
class rt_eqcorrscan.config.config.PlotConfig(*args, **kwargs)[source]

A holder for configuration values for real-time matched-filter plotting.

Works like a dictionary and can have anything added to it.

class rt_eqcorrscan.config.config.RTMatchFilterConfig(*args, **kwargs)[source]

A holder for configuration values for real-time matched-filtering.

Works like a dictionary and can have anything added to it.

To enable you to provide your own streaming service you should write your own class subclassing rt_eqcorrscan.streaming.streaming._StreamingClient, and set the parameter rt_client_base to be the import path for your class.

get_client()[source]

Get the client instance given the set parameters.

get_waveform_client()[source]

Get the waveform client instance given the set parameters.

class rt_eqcorrscan.config.config.ReactorConfig(*args, **kwargs)[source]

A holder for configuration values for the reactor.

Works like a dictionary and can have anything added to it.

class rt_eqcorrscan.config.config.StreamingConfig(*args, **kwargs)[source]
get_streaming_client()[source]

Get the configured waveform streaming service.

class rt_eqcorrscan.config.config.TemplateConfig(*args, **kwargs)[source]

A holder for configuration values for Template construction.

Works like a dictionary and can have anything added to it.

rt_eqcorrscan.config.config.read_config(config_file=None)[source]

Read configuration from a yml file.

Parameters

config_file – path to the configuration file.

Return type

Config

Returns

  • Configuration with required defaults filled and updated based on the

  • contents of the file.