ConfigurationΒΆ

To use the command-line scripts provided some configuration values need to be set. These configuration values are stored in a yaml formatted file. I/O is undertaken using the rt_eqcorrscan.config.Config class.

Creating a new Config object instantiates the object with some simple defaults.

[1]:
from rt_eqcorrscan.config import Config

config = Config()
print(config)
Config(
        rt_match_filter=RTMatchFilterConfig({'client': 'GEONET', 'client_type': 'FDSN', 'seedlink_server_url': 'link.geonet.org.nz', 'n_stations': 10, 'max_distance': 1000.0, 'buffer_capacity': 300.0, 'detect_interval': 120.0, 'plot': True, 'threshold': 0.5, 'threshold_type': 'av_chan_corr', 'trig_int': 2.0, 'local_wave_bank': None}),
        reactor=ReactorConfig({'magnitude_threshold': 6.0, 'rate_threshold': 20.0, 'rate_radius': 0.5}),
        plot=PlotConfig({'plot_length': 600.0, 'lowcut': 1.0, 'highcut': 10.0}),
        database_manager=DatabaseManagerConfig({'event_path': '.', 'event_format': 'QUAKEML', 'event_name_structure': '{event_id_end}', 'path_structure': '{year}/{month}/{event_id_end}', 'event_ext': '.xml', 'min_stations': 5}),
        template=TemplateConfig({'lowcut': 2.0, 'highcut': 15.0, 'filt_order': 4, 'samp_rate': 50.0, 'length': 4.0, 'prepick': 0.2, 'swin': 'all', 'process_len': 300, 'min_snr': 0})

These defaults can be changed, and other parameters added (so that you can write your own scripts and extend the configuration).

[2]:
config.plot.plot_length = 200.0
print(config.plot)
PlotConfig({'plot_length': 200.0, 'lowcut': 1.0, 'highcut': 10.0})

You can write these configuration parameters to a file to allow you to store them and read them back in later. You can also edit the yml file in a text editor.

[3]:
config.write("basic_config.yml")

from rt_eqcorrscan.config import read_config

config_back = read_config("basic_config.yml")
print(config_back)
Config(
        rt_match_filter=RTMatchFilterConfig({'client': 'GEONET', 'client_type': 'FDSN', 'seedlink_server_url': 'link.geonet.org.nz', 'n_stations': 10, 'max_distance': 1000.0, 'buffer_capacity': 300.0, 'detect_interval': 120.0, 'plot': True, 'threshold': 0.5, 'threshold_type': 'av_chan_corr', 'trig_int': 2.0, 'local_wave_bank': None}),
        reactor=ReactorConfig({'magnitude_threshold': 6.0, 'rate_threshold': 20.0, 'rate_radius': 0.5}),
        plot=PlotConfig({'plot_length': 200.0, 'lowcut': 1.0, 'highcut': 10.0}),
        database_manager=DatabaseManagerConfig({'event_path': '.', 'event_format': 'QUAKEML', 'event_name_structure': '{event_id_end}', 'path_structure': '{year}/{month}/{event_id_end}', 'event_ext': '.xml', 'min_stations': 5}),
        template=TemplateConfig({'lowcut': 2.0, 'highcut': 15.0, 'filt_order': 4, 'samp_rate': 50.0, 'length': 4.0, 'prepick': 0.2, 'swin': 'all', 'process_len': 300, 'min_snr': 0})