Browse Source

adapting log and exception convention

priors
miili 2 years ago
parent
commit
5ef64c565c
30 changed files with 959 additions and 1069 deletions
  1. +0
    -197
      examples/grond-playground-insar/config/insar_rectangular.gronf
  2. +1
    -0
      examples/grond-playground-insar/config/insar_rectangular.gronf
  3. +0
    -295
      examples/grond-playground-regional/config/regional_cmt.gronf
  4. +1
    -0
      examples/grond-playground-regional/config/regional_cmt.gronf
  5. +0
    -239
      examples/grond-playground-wphase/config/wphase_cmt.gronf
  6. +1
    -0
      examples/grond-playground-wphase/config/wphase_cmt.gronf
  7. +5
    -1
      setup.py
  8. +7
    -7
      src/analysers/noise_analyser/analyser.py
  9. +45
    -191
      src/apps/cmd_init.py
  10. +32
    -6
      src/apps/grond.py
  11. +3
    -3
      src/config.py
  12. +20
    -20
      src/core.py
  13. +200
    -0
      src/data/init/example_insar_rectangular.gronf
  14. +296
    -0
      src/data/init/example_regional_cmt.gronf
  15. +240
    -0
      src/data/init/example_wphase_cmt.gronf
  16. +49
    -47
      src/dataset.py
  17. +3
    -3
      src/monitor.py
  18. +3
    -3
      src/optimisers/highscore/optimiser.py
  19. +4
    -4
      src/optimisers/highscore/plot.py
  20. +2
    -2
      src/optimisers/plot.py
  21. +2
    -2
      src/plot/collection.py
  22. +1
    -1
      src/plot/main.py
  23. +5
    -5
      src/problems/base.py
  24. +6
    -6
      src/problems/plot.py
  25. +9
    -12
      src/report/base.py
  26. +6
    -6
      src/run_info.py
  27. +3
    -3
      src/scenario.py
  28. +3
    -4
      src/targets/gnss_campaign/target.py
  29. +1
    -1
      src/targets/satellite/target.py
  30. +2
    -2
      src/targets/waveform/plot.py
  31. +2
    -2
      src/targets/waveform/target.py
  32. +2
    -2
      src/targets/waveform_oac/target.py
  33. +5
    -5
      src/targets/waveform_phase_ratio/target.py

+ 0
- 197
examples/grond-playground-insar/config/insar_rectangular.gronf View File

@ -1,197 +0,0 @@
--- !grond.Config
# All file paths referenced below are treated relative to the location of this
# configuration file, here we may give a common prefix. E.g. setting it to '..'
# if the configuration file is in the sub-directory '${project_root}/config'
# allows us to give the paths below relative to '${project_root}'.
path_prefix: '..'
# Path, where to store output (run directories). The placeholder
# '${problem_name}' will be expanded to a name configured below in
# problem_config.name_template and will typically include a config identifier
# and the event name.
rundir_template: runs/${problem_name}.grun
# If given, restrict to processing of listed events
#event_names:
#- 'gfz2018pmjk'
# -----------------------------------------------------------------------------
# Configuration section for dataset (input data)
#
# The placeholder '${event_name}' will be expanded to the current event. This
# enables us to use the same configuration for multiple events. The available
# events are detected by looking into possible expansions of
# dataset_config.events_path
# -----------------------------------------------------------------------------
dataset_config: !grond.DatasetConfig
# File with hypocenter information and possibly reference solution
events_path: 'data/events/${event_name}/event.txt'
# List of directories for the InSAR scenes
kite_scene_paths: ['data/events/${event_name}/insar']
# -----------------------------------------------------------------------------
# Configuration section for the observational data fitting
#
# This defines the objective function to be minimized in the optimisation. It
# can be composed of one or more contributions, each represented by a
# !grond.*TargetGroup section.
# -----------------------------------------------------------------------------
target_groups:
- !grond.SatelliteTargetGroup
# Normalisation family (see the Grond documentation for how it works).
# Use distinct normalisation families when mixing misfit contributors with
# different magnitude scaling, like e.g. cross-correlation based misfit and
# time-domain Lx norm.
normalisation_family: 'static'
# Just a name used to identify targets from this group. Use dot-separated path
# notation to group related contributors
path: 'insar'
# How to weight contributions from this group in the global misfit
weight: 1.0
# Selector for kite scene ids, '*all' is a wildcard and load all scenes present
kite_scenes: ['*all']
# Subsection on how to fit the traces
misfit_config: !grond.SatelliteMisfitConfig
# Optimise a planar orbital ramp
optimise_orbital_ramp: false
# Parameters for the orbital ramp
ranges:
# Vertical offset in [m]
offset: -0.5 .. 0.5
# Ranges for the East-West and North-South inclination of the ramp
ramp_east: -1e-4 .. 1e-4
ramp_north: -1e-4 .. 1e-4
# How to interpolate the Green's functions (available choices:
# 'nearest_neighbor', 'multilinear'). Choices other than 'nearest_neighbor'
# may require dense GF stores to avoid aliasing artifacts in the forward
# modelling.
interpolation: multilinear
# Name of the GF Store to use
store_id: crust2_ib_static
# -----------------------------------------------------------------------------
# Definition of the problem to be solved
#
# In this section the source model to be fitted is chosen, the parameter space
# defined, and how to combine the misfit contributions defined in the
# target_groups section above.
#
# The marker !grond.RectangularProblemConfig selects a finite rectancular
# source model.
# -----------------------------------------------------------------------------
problem_config: !grond.RectangularProblemConfig
# Name used to identify the output
name_template: rect_2009LaAquila
# How to combine the target misfits. For L1 norm: 1, L2 norm: 2, etc.
norm_exponent: 2
# Definition of model parameter space to be searched in the optimisation
ranges:
# Scaling ranges in [m]
depth: 2500 .. 7000
east_shift: 0 .. 20000
north_shift: 0 .. 20000
length: 5000 .. 10000
width: 2000 .. 10000
slip: .2 .. 2
# Orientation ranges in [deg]
dip: 10 .. 50
rake: 120 .. 360
strike: 220 .. 360
# We are using a dense GF store and will reduce the number of discrete
# subsources by this factor. Decrease the decimation for a finer sub-source
# resolution, and increased computational time
decimation_factor: 12
# Clearance distance around stations (no models with origin closer than this
# distance to any station are produced by the sampler)
distance_min: 0.0
# -----------------------------------------------------------------------------
# Configuration of pre-optimisation analysis phases.
# determined during this phase.
# -----------------------------------------------------------------------------
#
analyser_configs:
# DOES NOT APPLY FOR INSAR! Balancing weights are determined with this analyser
- !grond.TargetBalancingAnalyserConfig
niterations: 1000
# -----------------------------------------------------------------------------
# Configuration of the optimisation procedure
# -----------------------------------------------------------------------------
optimiser_config: !grond.HighScoreOptimiserConfig
# Number of bootstrap realisations to be tracked simultaneously in the
# optimisation
nbootstrap: 25
# Stages of the sampler then narrow down to the interesting regions
# (!grond.DirectedSamplerPhase).
sampler_phases:
# Start with uniform sampling of the model space
- !grond.UniformSamplerPhase
# Number of iterations
niterations: 10000
# How often we shall try to find a valid sample
ntries_preconstrain_limit: 1000
# Narrow down to the interesting regions
- !grond.DirectedSamplerPhase
# Number of iterations
niterations: 40000
# How often we shall try to find a valid sample
ntries_preconstrain_limit: 1000
# Multiplicator for width of sampler distribution at start of this phase
scatter_scale_begin: 2.0
# Multiplicator for width of sampler distribution at end of this phase
scatter_scale_end: 0.5
starting_point: excentricity_compensated
sampler_distribution: normal
standard_deviation_estimator: median_density_single_chain
ntries_sample_limit: 2000
# This parameter determines the length of the chains
chain_length_factor: 8.0
# -----------------------------------------------------------------------------
# Configuration section for synthetic seismogram engine
#
# Configures where to look for GF stores.
# -----------------------------------------------------------------------------
engine_config: !grond.EngineConfig
# Whether to use GF store directories listed in ~/.pyrocko/config.pf
gf_stores_from_pyrocko_config: true
# List of directories with GF stores
gf_store_superdirs: ['gf_stores']

+ 1
- 0
examples/grond-playground-insar/config/insar_rectangular.gronf View File

@ -0,0 +1 @@
../../../src/data/init/example_insar_rectangular.gronf

+ 0
- 295
examples/grond-playground-regional/config/regional_cmt.gronf View File

@ -1,295 +0,0 @@
%YAML 1.1
--- !grond.Config
# All file paths referenced below are treated relative to the location of this
# configuration file, here we may give a common prefix. E.g. setting it to '..'
# if the configuration file is in the sub-directory '${project_root}/config'
# allows us to give the paths below relative to '${project_root}'.
path_prefix: '..'
# Path, where to store output (run directories). The placeholder
# '${problem_name}' will be expanded to a name configured below in
# problem_config.name_template and will typically include a config identifier
# and the event name.
rundir_template: 'runs/${problem_name}.grun'
# If given, restrict to processing of listed events
#event_names:
#- 'gfz2018pmjk'
# -----------------------------------------------------------------------------
# Configuration section for dataset (input data)
#
# The placeholder '${event_name}' will be expanded to the current event. This
# enables us to use the same configuration for multiple events. The available
# events are detected by looking into possible expansions of
# dataset_config.events_path
# -----------------------------------------------------------------------------
dataset_config: !grond.DatasetConfig
# List of files with station coordinates.
stations_stationxml_paths:
- 'data/events/${event_name}/waveforms/stations.geofon.xml'
- 'data/events/${event_name}/waveforms/stations.iris.xml'
# File with hypocenter information and possibly reference solution
events_path: 'data/events/${event_name}/event.txt'
# List of directories with raw waveform data
waveform_paths: ['data/events/${event_name}/waveforms/raw']
# List of stations/components to be excluded according to their STA, NET.STA,
# NET.STA.LOC, or NET.STA.LOC.CHA codes
blacklist: ['GE.UGM', 'GE.PLAI']
# List of files with additional exclusion lists (one entry per line, same
# format as above)
blacklist_paths:
- 'data/events/${event_name}/waveforms/blacklist.txt'
# List of files with instrument response information (can be the same as in
# stations_stationxml_paths above)
responses_stationxml_paths:
- 'data/events/${event_name}/waveforms/stations.geofon.xml'
- 'data/events/${event_name}/waveforms/stations.iris.xml'
# -----------------------------------------------------------------------------
# Configuration section for the observational data fitting
#
# This defines the objective function to be minimized in the optimisation. It
# can be composed of one or more contributions, each represented by a
# !grond.*TargetGroup section.
# -----------------------------------------------------------------------------
target_groups:
- !grond.WaveformTargetGroup
# Normalisation family (see the Grond documentation for how it works).
# Use distinct normalisation families when mixing misfit contributors with
# different magnitude scaling, like e.g. cross-correlation based misfit and
# time-domain Lx norm.
normalisation_family: 'td'
# Just a name used to identify targets from this group. Use dot-separated path
# notation to group related contributors
path: 'td.love'
# Epicentral distance range of stations to be considered in meter
distance_min: 1e3
distance_max: 900e3
# Names of components to be included. Available: N=north, E=east, Z=vertical
# (up), R=radial (away), T=transverse (right)
channels: ['T']
# How to weight contributions from this group in the global misfit
weight: 1.0
# subsection on how to fit the traces
misfit_config: !grond.WaveformMisfitConfig
# Frequency band [Hz] of acausal filter (flat part of frequency taper)
fmin: 0.01
fmax: 0.05
# Factor defining fall-off of frequency taper (zero at fmin/ffactor and
# fmax*ffactor)
ffactor: 1.5
# Time window to include in the data fitting. Times can be defined offset
# to given phase arrivals. E.g. '{stored:P}-600' would mean 600 s
# before arrival of the phase named 'P'. The phase must be defined in the
# travel time tables in the GF store.
tmin: '{stored:any_P}'
tmax: '{vel_surface:2.5}'
# tfade: 120.0
# How to fit the data (available: 'time_domain', 'frequency_domain',
# 'log_frequency_domain', 'absolute', 'envelope', 'cc_max_norm')
domain: 'time_domain'
tautoshift_max: 4.0
autoshift_penalty_max: 0.05
# For L1 norm: 1, L2 norm: 2, etc.
norm_exponent: 1
# How to interpolate the Green's functions (available choices:
# 'nearest_neighbor', 'multilinear'). Choices other than 'nearest_neighbor'
# may require dense GF stores to avoid aliasing artifacts in the forward
# modelling.
interpolation: 'nearest_neighbor'
# Name of the GF Store to use
store_id: 'crust2_j3'
- !grond.WaveformTargetGroup
# Normalisation family (see the Grond documentation for how it works).
# Use distinct normalisation families when mixing misfit contributors with
# different magnitude scaling, like e.g. cross-correlation based misfit and
# time-domain Lx norm.
normalisation_family: 'td'
# Just a name used to identfy targets from this group. Use dot-separated path
# notation to group related contributors
path: 'td.rayleigh'
# Epicentral distance range of stations to be considered in meter
distance_min: 1e3
distance_max: 900e3
# Names of components to be included. Available: N=north, E=east, Z=vertical
# (up), R=radial (away), T=transverse (right)
channels: ['R', 'Z']
# How to weight contributions from this group in the global misfit
weight: 1.0
# subsection on how to fit the traces
misfit_config: !grond.WaveformMisfitConfig
# Frequency band [Hz] of acausal filter (flat part of frequency taper)
fmin: 0.01
fmax: 0.05
# Factor defining fall-off of frequency taper (zero at fmin/ffactor and
# fmax*ffactor)
ffactor: 1.5
# Time window to include in the data fitting. Times can be defined offset
# to given phase arrivals. E.g. '{stored:P}-600' would mean 600 s
# before arrival of the phase named 'P'. The phase must be defined in the
# travel time tables in the GF store.
tmin: '{stored:any_P}'
tmax: '{vel_surface:2.5}'
# tfade: 120.0
# How to fit the data (available: 'time_domain', 'frequency_domain',
# 'log_frequency_domain', 'absolute', 'envelope', 'cc_max_norm')
domain: 'time_domain'
tautoshift_max: 4.0
autoshift_penalty_max: 0.05
# For L1 norm: 1, L2 norm: 2, etc.
norm_exponent: 1
# How to interpolate the Green's functions (available choices:
# 'nearest_neighbor', 'multilinear'). Choices other than 'nearest_neighbor'
# may require dense GF stores to avoid aliasing artifacts in the forward
# modelling.
interpolation: 'nearest_neighbor'
# Name of the GF Store to use
store_id: 'crust2_j3'
# -----------------------------------------------------------------------------
# Definition of the problem to be solved
#
# In this section the source model to be fitted is chosen, the parameter space
# defined, and how to combine the misfit contributions defined in the
# target_groups section above.
#
# The marker !grond.CMTProblemConfig selects a centroid moment tensor source
# model.
# -----------------------------------------------------------------------------
problem_config: !grond.CMTProblemConfig
# Name used to identify the output
name_template: 'cmt_${event_name}'
# Definition of model parameter space to be searched in the optimisation
ranges:
# Time relative to hypocenter origin time [s]
time: '-10 .. 10 | add'
# Centroid location with respect to hypocenter origin [m]
north_shift: '-15e3 .. 15e3'
east_shift: '-15e3 .. 15e3'
depth: '5e3 .. 30e3'
# Range of magnitudes to allow
magnitude: '5.7 .. 6.2'
# Relative moment tensor component ranges (don't touch)
rmnn: '-1.41421 .. 1.41421'
rmee: '-1.41421 .. 1.41421'
rmdd: '-1.41421 .. 1.41421'
rmne: '-1 .. 1'
rmnd: '-1 .. 1'
rmed: '-1 .. 1'
# Source duration range [s]
duration: '1. .. 5.'
# Clearance distance around stations (no models with origin closer than this
# distance to any station are produced by the sampler)
distance_min: 1e3
# Type of moment tensor to restrict to (choices: 'full', 'deviatoric', 'dc')
mt_type: 'deviatoric'
# How to combine the target misfits. For L1 norm: 1, L2 norm: 2, etc.
norm_exponent: 1
# -----------------------------------------------------------------------------
# Configuration of pre-optimisation analysis phases.
# determined during this phase.
# -----------------------------------------------------------------------------
#
analyser_configs:
# Balancing weights are determined with this analyser
- !grond.TargetBalancingAnalyserConfig
# Number of models to forward model in the analysis, larger number -> better
# statistics)
niterations: 1000
# -----------------------------------------------------------------------------
# Configuration of the optimisation procedure
# -----------------------------------------------------------------------------
optimiser_config: !grond.HighScoreOptimiserConfig
# Number of bootstrap realisations to be tracked simultaneously in the
# optimisation
nbootstrap: 100
# stages of the sampler. Start with uniform sampling of the model space
# (!grond.UniformSamplerPhase), then narrow down to the interesting regions
# (!grond.DirectedSamplerPhase).
sampler_phases:
- !grond.UniformSamplerPhase
# Number of iterations
niterations: 1000
- !grond.DirectedSamplerPhase
# Number of iterations
niterations: 20000
# Multiplicator for width of sampler distribution at start of this phase
scatter_scale_begin: 2.0
# Multiplicator for width of sampler distribution at end of this phase
scatter_scale_end: 0.5
# -----------------------------------------------------------------------------
# Configuration section for synthetic seismogram engine
#
# Configures where to look for GF stores.
# -----------------------------------------------------------------------------
engine_config: !grond.EngineConfig
# Whether to use GF store directories listed in ~/.pyrocko/config.pf
gf_stores_from_pyrocko_config: false
# List of directories with GF stores
gf_store_superdirs: ['gf_stores']

+ 1
- 0
examples/grond-playground-regional/config/regional_cmt.gronf View File

@ -0,0 +1 @@
../../../src/data/init/example_regional_cmt.gronf

+ 0
- 239
examples/grond-playground-wphase/config/wphase_cmt.gronf View File

@ -1,239 +0,0 @@
%YAML 1.1
--- !grond.Config
# All file paths referenced below are treated relative to the location of this
# configuration file, here we may give a common prefix. E.g. setting it to '..'
# if the configuration file is in the sub-directory '${project_root}/config'
# allows us to give the paths below relative to '${project_root}'.
path_prefix: '..'
# Path, where to store output (run directories). The placeholder
# '${problem_name}' will be expanded to a name configured below in
# problem_config.name_template and will typically include a config identifier
# and the event name.
rundir_template: 'runs/${problem_name}.grun'
# If given, restrict to processing of listed events
#event_names:
#- 'gfz2015sfdd'
# -----------------------------------------------------------------------------
# Configuration section for dataset (input data)
#
# The placeholder '${event_name}' will be expanded to the current event. This
# enables us to use the same configuration for multiple events. The available
# events are detected by looking into possible expansions of
# dataset_config.events_path
# -----------------------------------------------------------------------------
dataset_config: !grond.DatasetConfig
# List of files with station coordinates.
stations_stationxml_paths:
- 'data/events/${event_name}/waveforms/stations.geofon.xml'
- 'data/events/${event_name}/waveforms/stations.iris.xml'
- 'data/events/${event_name}/waveforms/stations.orfeus.xml'
# File with hypocenter information and possibly reference solution
events_path: 'data/events/${event_name}/event.txt'
# List of directories with raw waveform data
waveform_paths: ['data/events/${event_name}/waveforms/raw']
# List of stations/components to be excluded according to their STA, NET.STA,
# NET.STA.LOC, or NET.STA.LOC.CHA codes
blacklist: []
# List of files with additional exclusion lists (one entry per line, same
# format as above)
blacklist_paths:
- 'data/events/${event_name}/waveforms/blacklist.txt'
# List of files with instrument response information (can be the same as in
# stations_stationxml_paths above)
responses_stationxml_paths:
- 'data/events/${event_name}/waveforms/stations.geofon.xml'
- 'data/events/${event_name}/waveforms/stations.iris.xml'
- 'data/events/${event_name}/waveforms/stations.orfeus.xml'
# -----------------------------------------------------------------------------
# Configuration section for the observational data fitting
#
# This defines the objective function to be minimized in the optimisation. It
# can be composed of one or more contributions, each represented by a
# !grond.*TargetGroup section.
# -----------------------------------------------------------------------------
target_groups:
- !grond.WaveformTargetGroup
# Normalisation family (see the Grond documentation for how it works).
# Use distinct normalisation families when mixing misfit contributors with
# different magnitude scaling, like e.g. cross-correlation based misfit and
# time-domain Lx norm.
normalisation_family: 'td'
# Just a name used to identfy targets from this group. Use dot-separated path
# notation to group related contributors
path: 'td.wphase'
# Epicentral distance range of stations to be considered
distance_min: 3000e3
distance_max: 10000e3
# Names of components to be included. Available: N=north, E=east, Z=vertical
# (up), R=radial (away), T=transverse (right)
channels: ['Z','R']
# How to weight contributions from this group in the global misfit
weight: 1.0
# subsection on how to fit the traces
misfit_config: !grond.WaveformMisfitConfig
# Frequency band [Hz] of acausal filter (flat part of frequency taper)
fmin: 0.001
fmax: 0.005
# Factor defining fall-off of frequency taper (zero at fmin/ffactor and
# fmax*ffactor)
ffactor: 1.5
# Time window to include in the data fitting. Times can be defined offset
# to given phase arrivals. E.g. '{stored:P}-600' would mean 600 s
# before arrival of the phase named 'P'. The phase must be defined in the
# travel time tables in the GF store.
tmin: '{stored:P}-600'
tmax: '{stored:S}-60'
# tfade: 120.0
# How to fit the data (available: 'time_domain', 'frequency_domain',
# 'log_frequency_domain', 'absolute', 'envelope', 'cc_max_norm')
domain: 'time_domain'
# For L1 norm: 1, L2 norm: 2, etc.
norm_exponent: 1
# How to interpolate the Green's functions (available choices:
# 'nearest_neighbor', 'multilinear'). Choices other than 'nearest_neighbor'
# may require dense GF stores to avoid aliasing artifacts in the forward
# modelling.
interpolation: 'nearest_neighbor'
# Name of the GF Store to use
store_id: 'global_20s_shallow'
# -----------------------------------------------------------------------------
# Definition of the problem to be solved
#
# In this section the source model to be fitted is chosen, the parameter space
# defined, and how to combine the misfit contributions defined in the
# target_groups section above.
#
# The marker !grond.CMTProblemConfig selects a centroid moment tensor source
# model.
# -----------------------------------------------------------------------------
problem_config: !grond.CMTProblemConfig
# Name used to identify the output
name_template: 'wphase_cmt_${event_name}'
# Definition of model parameter space to be searched in the optimisation
ranges:
# Time relative to hypocenter origin time [s]
time: '-100 .. 100 | add'
# Centroid location with respect to hypocenter origin [m]
north_shift: '-200e3 .. 200e3'
east_shift: '-200e3 .. 200e3'
depth: '5e3 .. 40e3'
# Range of magnitudes to allow
magnitude: '7.5 .. 8.5'
# Relative moment tensor component ranges (don't touch)
rmnn: '-1.41421 .. 1.41421'
rmee: '-1.41421 .. 1.41421'
rmdd: '-1.41421 .. 1.41421'
rmne: '-1 .. 1'
rmnd: '-1 .. 1'
rmed: '-1 .. 1'
# Source duration range [s]
duration: '50. .. 200.'
# Clearance distance around stations (no models with origin closer than this
# distance to any station are produced by the sampler)
distance_min: 0.
# Type of moment tensor to restrict to (choices: 'full', 'deviatoric', 'dc')
mt_type: 'deviatoric'
# How to combine the target misfits. For L1 norm: 1, L2 norm: 2, etc.
norm_exponent: 1
# -----------------------------------------------------------------------------
# Configuration of pre-optimisation analysis phases.
# determined during this phase.
# -----------------------------------------------------------------------------
#
analyser_configs:
# Balancing weights are determined with this analyser
- !grond.TargetBalancingAnalyserConfig
# Number of models to forward model in the analysis, larger number -> better
# statistics)
niterations: 1000
# -----------------------------------------------------------------------------
# Configuration of the optimisation procedure
# -----------------------------------------------------------------------------
optimiser_config: !grond.HighScoreOptimiserConfig
# Number of bootstrap realisations to be tracked simultaneously in the
# optimisation
nbootstrap: 100
# stages of the sampler. Start with uniform sampling of the model space
# (!grond.UniformSamplerPhase), then narrow down to the interesting regions
# (!grond.DirectedSamplerPhase).
sampler_phases:
- !grond.UniformSamplerPhase
# Number of iterations
niterations: 1000
- !grond.DirectedSamplerPhase
# Number of iterations
niterations: 20000
# Multiplicator for width of sampler distribution at start of this phase
scatter_scale_begin: 2.0
# Multiplicator for width of sampler distribution at end of this phase
scatter_scale_end: 0.5
# -----------------------------------------------------------------------------
# Configuration section for synthetic seismogram engine
#
# Configures where to look for GF stores.
# -----------------------------------------------------------------------------
engine_config: !grond.EngineConfig
# Whether to use GF store directories listed in ~/.pyrocko/config.pf
gf_stores_from_pyrocko_config: false
# List of directories with GF stores
gf_store_superdirs: ['gf_stores']

+ 1
- 0
examples/grond-playground-wphase/config/wphase_cmt.gronf View File

@ -0,0 +1 @@
../../../src/data/init/example_wphase_cmt.gronf

+ 5
- 1
setup.py View File

@ -133,7 +133,11 @@ setup(
'report/app/favicon.png',
'report/app/templates/*.html',
'report/app/css/*.css',
'report/app/js/*.js']},
'report/app/js/*.js',
'data/init/*.gronf',
'data/init/*.txt'
]},
data_files=[],


+ 7
- 7
src/analysers/noise_analyser/analyser.py View File

@ -112,7 +112,7 @@ def seismic_noise_variance(traces, engine, event, targets,
stat_w = 0.
logger.info(
'Noise analyser found event %s phase onset of '
'%s for %s' % (
'%s for %s.' % (
ev.name, phase_def, target.name))
if arrival_time_pre > arrival_time-30.*60.\
@ -121,7 +121,7 @@ def seismic_noise_variance(traces, engine, event, targets,
stat_w *= 1.
logger.info(
'Noise analyser found event %s possibly '
'contaminating the noise' % ev.name)
'contaminating the noise.' % ev.name)
# this should be magnitude dependent
except Exception:
@ -161,10 +161,10 @@ class NoiseAnalyser(Analyser):
within a 30 min time window before the start of the set pre-event noise
window, only a warning is thrown.
It is further possible to disregard data with a noise level exceeding the
median by a given ``cutoff`` factor. These weights are set to 0. This can be
done exclusively (``mode='weeding'``) such that noise weights are either
1 or 0, or in combination with weighting below the median-times-cutoff
It is further possible to disregard data with a noise level exceeding the
median by a given ``cutoff`` factor. These weights are set to 0. This can
be done exclusively (``mode='weeding'``) such that noise weights are either
1 or 0, or in combination with weighting below the median-times-cutoff
noise level (``mode='weighting'``).
'''
@ -235,7 +235,7 @@ class NoiseAnalyser(Analyser):
norm_noise = meta.nanmedian(noise)
if norm_noise == 0:
logger.info(
'Noise Analyser returned a weight of 0 for all stations')
'Noise Analyser returned a weight of 0 for all stations.')
ok = num.isfinite(noise)
assert num.all(noise[ok] >= 0.0)


+ 45
- 191
src/apps/cmd_init.py View File

@ -1,201 +1,55 @@
import grond
import logging
import math
import shutil
import os
from os import path as op
from pyrocko import util
from pyrocko.gf import Range, Timing
import glob
import os.path as op
logger = logging.getLogger('grond.init')
km = 1e3
INIT_EVENT = '''name = myanmar_2011
time = 2011-03-24 13:55:12.010
latitude = 20.687
longitude = 99.822
magnitude = 6.9
moment = 1.9228e+19
depth = 8000
region = Myanmar
--------------------------------------------
'''
class GrondInit(object):
class GrondProject(object):
folder = op.join(op.dirname(__file__), '..', 'data', 'init')
def __init__(self):
self.dataset_config = grond.DatasetConfig(
events_path='events.txt')
self.project_config = None
self.target_groups = []
self.sub_dirs = ['gf_stores', 'config']
self.empty_files = []
def add_waveforms(self):
logger.info('Added waveforms')
dsc = self.dataset_config
wd = op.join('data', 'waveforms')
self.sub_dirs.append(wd)
dsc.waveform_paths = [wd]
sp = op.join(wd, 'stations.xml')
dsc.stations_stationxml_paths = [sp]
dsc.responses_stationxml_paths = [sp]
self.target_groups.append(
grond.WaveformTargetGroup(
normalisation_family='time_domain',
path='sw',
distance_min=10*km,
distance_max=1000*km,
channels=['Z', 'R', 'T'],
interpolation='nearest_neighbor',
store_id='gf_store_id',
misfit_config=grond.WaveformMisfitConfig(
tmin=Timing(phase_defs=['stored:any_P'], offset=-10.0),
tmax=Timing(phase_defs=['vel_surface:2.5']),
domain='time_domain',
tautoshift_max=4.0,
autoshift_penalty_max=0.05,
norm_exponent=2,
fmin=0.01,
fmax=0.05,
ffactor=1.5)))
def add_insar(self):
logger.info('Added InSAR')
dsc = self.dataset_config
sd = op.join('data', 'insar')
self.sub_dirs.append(sd)
dsc.kite_scene_paths = [sd]
self.target_groups.append(
grond.SatelliteTargetGroup(
normalisation_family='static',
path='insar',
interpolation='multilinear',
store_id='gf_static_store_id',
kite_scenes=['*all'],
misfit_config=grond.SatelliteMisfitConfig(
optimise_orbital_ramp=True,
ranges={
'offset': '-0.5 .. 0.5',
'ramp_north': '-1e-4 .. 1e-4',
'ramp_east': '-1e-4 .. 1e-4'
}
))
)
def add_gnss(self):
logger.info('Added GNSS')
dsc = self.dataset_config
gd = op.join('data', 'gnss')
self.sub_dirs.append(gd)
gp = op.join(gd, 'my_campaign.yaml')
dsc.gnss_campaign_paths = [gp]
self.target_groups.append(
grond.GNSSCampaignTargetGroup(
normalisation_family='static',
path='gnss',
interpolation='multilinear',
store_id='gf_static_store_id',
misfit_config=grond.GNSSCampaignMisfitConfig()
)
)
def set_cmt_source(self):
logger.info('Set problem to CMTProblem')
pi2 = math.pi/2
self.problem_config = grond.CMTProblemConfig(
name_template='cmt_${event_name}',
distance_min=2.*km,
mt_type='deviatoric',
ranges=dict(
time=Range(-10.0, 10.0, relative='add'),
north_shift=Range(-16*km, 16*km),
east_shift=Range(-16*km, 16*km),
depth=Range(1*km, 11*km),
magnitude=Range(4.0, 6.0),
rmnn=Range(-pi2, pi2),
rmee=Range(-pi2, pi2),
rmdd=Range(-pi2, pi2),
rmne=Range(-1.0, 1.0),
rmnd=Range(-1.0, 1.0),
rmed=Range(-1.0, 1.0),
duration=Range(1.0, 15.0))
)
def set_rectangular_source(self):
logger.info('Set problem to RectangularProblem')
self.problem_config = grond.RectangularProblemConfig(
name_template='rect_source',
ranges=dict(
north_shift=Range(-20*km, 20*km),
east_shift=Range(-20*km, 20*km),
depth=Range(0*km, 10*km),
length=Range(20*km, 40*km),
width=Range(5*km, 12*km),
dip=Range(20, 70),
strike=Range(0, 180),
rake=Range(0, 90),
slip=Range(1, 3))
)
def check(self):
assert self.target_groups, 'No target_groups set!'
assert self.problem_config, 'No problem set!'
def get_config(self):
self.check()
engine_config = grond.EngineConfig(
gf_store_superdirs=['gf_stores'])
optimiser_config = grond.HighScoreOptimiserConfig()
return grond.Config(
rundir_template=op.join('rundir', '${problem_name}.grun'),
dataset_config=self.dataset_config,
problem_config=self.problem_config,
target_groups=self.target_groups,
optimiser_config=optimiser_config,
engine_config=engine_config)
def build(self, project_dir, force=False):
if op.exists(project_dir) and not force:
raise grond.GrondError(
'Directory "%s" already exists! Use --force to overwrite'
% project_dir)
elif op.exists(project_dir) and force:
logger.info('Overwriting directory %s.' % project_dir)
shutil.rmtree(project_dir)
logger.info('Creating empty project in folder %s' % project_dir)
config = self.get_config()
def p(*fn):
return op.join(project_dir, *fn)
config.set_basepath(p())
os.mkdir(op.abspath(project_dir))
for d in self.sub_dirs:
util.ensuredir(p(d))
grond.write_config(config, p('config', 'config.gronf'))
with open(p('events.txt'), 'w') as f:
f.write(INIT_EVENT)
for fn in self.empty_files:
open(p(fn), 'w').close()
def dump(self):
return self.get_config().dump()
pass
def available_inits(self):
return {
'examples': tuple((self.filename_to_abbrv(fn),
self._get_description(fn))
for fn in self.example_files),
'events': tuple((self.filename_to_abbrv(fn),
self._get_description(fn))
for fn in self.event_files),
}
@staticmethod
def filename_to_abbrv(filename):
return op.basename(filename).split('.')[0]
@property
def example_files(self):
return self._get_files('example_*.gronf')
@property
def section_files(self):
return self._get_files('section_*.gronf')
@property
def snippet_files(self):
return self._get_files('snippet_*.gronf')
@property
def event_files(self):
return self._get_files('event_*.txt')
def _get_files(self, name):
return glob.glob(op.join(self.folder, name))
def _get_description(self, filename):
with open(filename, 'rt') as f:
for ln in f.readlines():
if ln.startswith('#'):
return ln.split(':')[-1].strip('# \n')
return 'No description!'

+ 32
- 6
src/apps/grond.py View File

@ -311,7 +311,7 @@ def multiple_choice(option, opt_str, value, parser, choices):
options = value.split(',')
for opt in options:
if opt not in choices:
raise OptionValueError('invalid option %s - valid options are: %s'
raise OptionValueError('Invalid option %s - valid options are: %s'
% (opt, ', '.join(choices)))
setattr(parser.values, option.dest, options)
@ -320,14 +320,14 @@ def magnitude_range(option, opt_str, value, parser):
mag_range = value.split('-')
if len(mag_range) != 2:
raise OptionValueError(
'invalid magnitude %s - valid range is e.g. 6-7' % value)
'Invalid magnitude %s - valid range is e.g. 6-7.' % value)
try:
mag_range = tuple(map(float, mag_range))
except ValueError:
raise OptionValueError('magnitudes must be numbers.')
raise OptionValueError('Magnitudes must be numbers.')
if mag_range[0] > mag_range[1]:
raise OptionValueError('minimum magnitude must be larger than'
raise OptionValueError('Minimum magnitude must be larger than'
' maximum magnitude.')
setattr(parser.values, option.dest, mag_range)
@ -444,6 +444,32 @@ def command_scenario(args):
def command_init(args):
from .cmd_init import GrondInit
grond_init = GrondInit()
def setup(parser):
parser.add_option(
'--force', dest='force', action='store_true')
parser, options, args = cl_parse('init', args, setup)
if len(args) not in (1, 2):
help_and_die(parser, '1 or 2 arguments required')
if args[0] == 'list':
print('List of available configuration examples for grond:')
for section, entries in grond_init.available_inits().items():
padding = max([len(n) for n, _ in entries])
print('\n{title}:'.format(title=section.title()))
for name, desc in entries:
print(' {name:<{padding}}: {desc}'.format(
name=name, desc=desc, padding=padding))
def command_init_old(args):
from . import cmd_init as init
def setup(parser):
@ -937,7 +963,7 @@ def command_tag(args):
logger.error(e)
if errors:
die('errors occurred, see log messages above.')
die('Errors occurred, see log messages above.')
def make_report(env_args, event_name, conf, update_without_plotting):
@ -1126,7 +1152,7 @@ def command_report(args):
else:
if not entries_generated and not options.index_only:
logger.info('nothing to do, see: grond report --help')
logger.info('Nothing to do, see: grond report --help')
if entries_generated and not (options.serve or options.serve_external):
logger.info(CLIHints('report', config=s_conf))


+ 3
- 3
src/config.py View File

@ -137,10 +137,10 @@ def read_config(path):
config = guts.load(filename=path)
except OSError:
raise GrondError(
'cannot read Grond configuration file: %s' % path)
'Cannot read Grond configuration file: %s' % path)
if not isinstance(config, Config):
raise GrondError('invalid Grond configuration in file "%s"' % path)
raise GrondError('Invalid Grond configuration in file "%s".' % path)
config.set_basepath(op.dirname(path) or '.')
return config
@ -160,7 +160,7 @@ def write_config(config, path):
except OSError:
raise GrondError(
'cannot write Grond configuration file: %s' % path)
'Cannot write Grond configuration file: %s' % path)
def diff_configs(path1, path2):


+ 20
- 20
src/core.py View File

@ -151,7 +151,7 @@ def harvest(rundir, problem=None, nbest=10, force=False, weed=0):
xs, misfits, bootstrap_misfits, _ = \
load_problem_data(rundir, problem, nchains=nchains)
logger.info('harvesting problem %s...' % problem.name)
logger.info('Harvesting problem %s...' % problem.name)
optimiser = load_optimiser_info(rundir)
dumpdir = op.join(rundir, 'harvest')
@ -198,7 +198,7 @@ def harvest(rundir, problem=None, nbest=10, force=False, weed=0):
for i in ibests:
problem.dump_problem_data(dumpdir, xs[i], misfits[i, :, :])
logger.info('done harvesting problem %s' % problem.name)
logger.info('Done harvesting problem %s.' % problem.name)
def cluster(rundir, clustering, metric):
@ -212,7 +212,7 @@ def cluster(rundir, clustering, metric):
from grond.clustering import metrics
if metric not in metrics.metrics:
raise GrondError('unknown metric: %s' % metric)
raise GrondError('Unknown metric: %s' % metric)
mat = metrics.compute_similarity_matrix(events, metric)
@ -239,7 +239,7 @@ def get_event_names(config):
def check_problem(problem):
if len(problem.targets) == 0:
raise GrondError('no targets available')
raise GrondError('No targets available')
def check(
@ -259,9 +259,9 @@ def check(
problem = config.get_problem(event)
_, nfamilies = problem.get_family_mask()
logger.info('problem: %s' % problem.name)
logger.info('number of target families: %i' % nfamilies)
logger.info('number of targets (total): %i' % len(problem.targets))
logger.info('Problem: %s' % problem.name)
logger.info('Number of target families: %i' % nfamilies)
logger.info('Number of targets (total): %i' % len(problem.targets))
if target_string_ids:
problem.targets = [
@ -269,7 +269,7 @@ def check(
if util.match_nslc(target_string_ids, target.string_id())]
logger.info(
'number of targets (selected): %i' % len(problem.targets))
'Number of targets (selected): %i' % len(problem.targets))
check_problem(problem)
@ -410,7 +410,7 @@ def check(
(target.string_id() + ':', sok)))
except GrondError as e:
logger.error('event %i, %s: %s' % (
logger.error('Event %i, %s: %s' % (
ievent,
event.name or util.time_to_str(event.time),
str(e)))
@ -474,18 +474,18 @@ def process_event(ievent, g_data_id):
elif force:
shutil.rmtree(rundir)
else:
logger.warn('skipping problem %s: rundir already exists: %s' %
logger.warn('Skipping problem %s: rundir already exists: %s' %
(problem.name, rundir))
return
util.ensuredir(rundir)
logger.info(
'starting event %i / %i' % (ievent+1, nevents))
'Starting event %i / %i' % (ievent+1, nevents))
logger.info('rundir: %s' % rundir)
logger.info('Rundir: %s' % rundir)
logger.info('analysing problem %s' % problem.name)
logger.info('Analysing problem %s.' % problem.name)
for analyser_conf in config.analyser_configs:
analyser = analyser_conf.get_analyser()
@ -537,10 +537,10 @@ def process_event(ievent, g_data_id):
tstop = time.time()
logger.info(
'stop %i / %i (%g min)' % (ievent+1, nevents, (tstop - tstart)/60.))
'Stop %i / %i (%g min)' % (ievent+1, nevents, (tstop - tstart)/60.))
logger.info(
'done with problem %s, rundir is %s' % (problem.name, rundir))
'Done with problem %s, rundir is "%s".' % (problem.name, rundir))
class ParameterStats(Object):
@ -614,16 +614,16 @@ def export(what, rundirs, type=None, pnames=None, filename=None):
shortform = False
if what == 'stats' and type is not None:
raise GrondError('invalid argument combination: what=%s, type=%s' % (
raise GrondError('Invalid argument combination: what=%s, type=%s' % (
repr(what), repr(type)))
if what != 'stats' and shortform:
raise GrondError('invalid argument combination: what=%s, pnames=%s' % (
raise GrondError('Invalid argument combination: what=%s, pnames=%s' % (
repr(what), repr(pnames)))
if what != 'stats' and type != 'vector' and pnames is not None:
raise GrondError(
'invalid argument combination: what=%s, type=%s, pnames=%s' % (
'Invalid argument combination: what=%s, type=%s, pnames=%s' % (
repr(what), repr(type), repr(pnames)))
if filename is None:
@ -656,7 +656,7 @@ def export(what, rundirs, type=None, pnames=None, filename=None):
guts.dump_all([ev], stream=out)
else:
raise GrondError('invalid argument: type=%s' % repr(type))
raise GrondError('Invalid argument: type=%s' % repr(type))
header = None
for rundir in rundirs:
@ -708,7 +708,7 @@ def export(what, rundirs, type=None, pnames=None, filename=None):
print(rs, file=out)
else:
raise GrondError('invalid argument: what=%s' % repr(what))
raise GrondError('Invalid argument: what=%s' % repr(what))
if out is not sys.stdout:
out.close()


+ 200
- 0
src/data/init/example_insar_rectangular.gronf View File

@ -0,0 +1,200 @@
%YAML 1.1
# Example: Inversion of planar RectangularSource from local InSAR Observations
--- !grond.Config
# All file paths referenced below are treated relative to the location of this
# configuration file, here we may give a common prefix. E.g. setting it to '..'
# if the configuration file is in the sub-directory '${project_root}/config'
# allows us to give the paths below relative to '${project_root}'.
path_prefix: '..'
# Path, where to store output (run directories). The placeholder
# '${problem_name}' will be expanded to a name configured below in
# problem_config.name_template and will typically include a config identifier
# and the event name.
rundir_template: runs/${problem_name}.grun
# If given, restrict to processing of listed events
#event_names:
#- 'gfz2018pmjk'
# -----------------------------------------------------------------------------
# Configuration section for dataset (input data)
#
# The placeholder '${event_name}' will be expanded to the current event. This
# enables us to use the same configuration for multiple events. The available
# events are detected by looking into possible expansions of
# dataset_config.events_path
# -----------------------------------------------------------------------------
dataset_config: !grond.DatasetConfig
# File with hypocenter information and possibly reference solution
events_path: 'data/events/${event_name}/event.txt'
# List of directories for the InSAR scenes
kite_scene_paths: ['data/events/${event_name}/insar']
# -----------------------------------------------------------------------------
# Configuration section for the observational data fitting
#
# This defines the objective function to be minimized in the optimisation. It
# can be composed of one or more contributions, each represented by a
# !grond.*TargetGroup section.
# -----------------------------------------------------------------------------
target_groups:
- !grond.SatelliteTargetGroup
# Normalisation family (see the Grond documentation for how it works).
# Use distinct normalisation families when mixing misfit contributors with
# different magnitude scaling, like e.g. cross-correlation based misfit and
# time-domain Lx norm.
normalisation_family: 'static'
# Just a name used to identify targets from this group. Use dot-separated path
# notation to group related contributors
path: 'insar'
# How to weight contributions from this group in the global misfit
weight: 1.0
# Selector for kite scene ids, '*all' is a wildcard and load all scenes present
kite_scenes: ['*all']
# Subsection on how to fit the traces
misfit_config: !grond.SatelliteMisfitConfig
# Optimise a planar orbital ramp
optimise_orbital_ramp: false
# Parameters for the orbital ramp
ranges:
# Vertical offset in [m]
offset: -0.5 .. 0.5
# Ranges for the East-West and North-South inclination of the ramp
ramp_east: -1e-4 .. 1e-4
ramp_north: -1e-4 .. 1e-4
# How to interpolate the Green's functions (available choices:
# 'nearest_neighbor', 'multilinear'). Choices other than 'nearest_neighbor'
# may require dense GF stores to avoid aliasing artifacts in the forward
# modelling.
interpolation: multilinear
# Name of the GF Store to use
store_id: crust2_ib_static
# -----------------------------------------------------------------------------
# Definition of the problem to be solved
#
# In this section the source model to be fitted is chosen, the parameter space
# defined, and how to combine the misfit contributions defined in the
# target_groups section above.
#
# The marker !grond.RectangularProblemConfig selects a finite rectancular
# source model.
# -----------------------------------------------------------------------------
problem_config: !grond.RectangularProblemConfig
# Name used to identify the output
name_template: rect_2009LaAquila
# How to combine the target misfits. For L1 norm: 1, L2 norm: 2, etc.
norm_exponent: 2
# Definition of model parameter space to be searched in the optimisation
ranges:
# Scaling ranges in [m]
depth: 2500 .. 7000
east_shift: 0 .. 20000
north_shift: 0 .. 20000
length: 5000 .. 10000
width: 2000 .. 10000
slip: .2 .. 2
# Orientation ranges in [deg]
dip: 10 .. 50
rake: 120 .. 360
strike: 220 .. 360
# We are using a dense GF store and will reduce the number of discrete
# subsources by this factor. Decrease the decimation for a finer sub-source
# resolution, and increased computational time
decimation_factor: 12
# Clearance distance around stations (no models with origin closer than this
# distance to any station are produced by the sampler)
distance_min: 0.0
# -----------------------------------------------------------------------------
# Configuration of pre-optimisation analysis phases.
# determined during this phase.
# -----------------------------------------------------------------------------
#
analyser_configs:
# DOES NOT APPLY FOR INSAR! Balancing weights are determined with this analyser
- !grond.TargetBalancingAnalyserConfig
niterations: 1000
# -----------------------------------------------------------------------------
# Configuration of the optimisation procedure
# -----------------------------------------------------------------------------
optimiser_config: !grond.HighScoreOptimiserConfig
# Number of bootstrap realisations to be tracked simultaneously in the
# optimisation
nbootstrap: 25
# Stages of the sampler then narrow down to the interesting regions
# (!grond.DirectedSamplerPhase).
sampler_phases:
# Start with uniform sampling of the model space
- !grond.UniformSamplerPhase
# Number of iterations
niterations: 10000
# How often we shall try to find a valid sample
ntries_preconstrain_limit: 1000
# Narrow down to the interesting regions
- !grond.DirectedSamplerPhase
# Number of iterations
niterations: 40000
# How often we shall try to find a valid sample
ntries_preconstrain_limit: 1000
# Multiplicator for width of sampler distribution at start of this phase
scatter_scale_begin: 2.0
# Multiplicator for width of sampler distribution at end of this phase
scatter_scale_end: 0.5
starting_point: excentricity_compensated
sampler_distribution: normal
standard_deviation_estimator: median_density_single_chain
ntries_sample_limit: 2000
# This parameter determines the length of the chains
chain_length_factor: 8.0
# -----------------------------------------------------------------------------
# Configuration section for synthetic seismogram engine
#
# Configures where to look for GF stores.
# -----------------------------------------------------------------------------
engine_config: !grond.EngineConfig
# Whether to use GF store directories listed in ~/.pyrocko/config.pf
gf_stores_from_pyrocko_config: true
# List of directories with GF stores
gf_store_superdirs: ['gf_stores']

+ 296
- 0
src/data/init/example_regional_cmt.gronf View File

@ -0,0 +1,296 @@
%YAML 1.1
# Example: Inversion of centroid moment tensor from regional waveform observations.
--- !grond.Config
# All file paths referenced below are treated relative to the location of this
# configuration file, here we may give a common prefix. E.g. setting it to '..'
# if the configuration file is in the sub-directory '${project_root}/config'
# allows us to give the paths below relative to '${project_root}'.
path_prefix: '..'
# Path, where to store output (run directories). The placeholder
# '${problem_name}' will be expanded to a name configured below in
# problem_config.name_template and will typically include a config identifier
# and the event name.
rundir_template: 'runs/${problem_name}.grun'
# If given, restrict to processing of listed events
#event_names:
#- 'gfz2018pmjk'
# -----------------------------------------------------------------------------
# Configuration section for dataset (input data)
#
# The placeholder '${event_name}' will be expanded to the current event. This
# enables us to use the same configuration for multiple events. The available
# events are detected by looking into possible expansions of
# dataset_config.events_path
# -----------------------------------------------------------------------------
dataset_config: !grond.DatasetConfig
# List of files with station coordinates.
stations_stationxml_paths:
- 'data/events/${event_name}/waveforms/stations.geofon.xml'
- 'data/events/${event_name}/waveforms/stations.iris.xml'
# File with hypocenter information and possibly reference solution
events_path: 'data/events/${event_name}/event.txt'
# List of directories with raw waveform data
waveform_paths: ['data/events/${event_name}/waveforms/raw']
# List of stations/components to be excluded according to their STA, NET.STA,
# NET.STA.LOC, or NET.STA.LOC.CHA codes
blacklist: ['GE.UGM', 'GE.PLAI']
# List of files with additional exclusion lists (one entry per line, same
# format as above)
blacklist_paths:
- 'data/events/${event_name}/waveforms/blacklist.txt'
# List of files with instrument response information (can be the same as in
# stations_stationxml_paths above)
responses_stationxml_paths:
- 'data/events/${event_name}/waveforms/stations.geofon.xml'
- 'data/events/${event_name}/waveforms/stations.iris.xml'
# -----------------------------------------------------------------------------
# Configuration section for the observational data fitting
#
# This defines the objective function to be minimized in the optimisation. It
# can be composed of one or more contributions, each represented by a
# !grond.*TargetGroup section.
# -----------------------------------------------------------------------------
target_groups:
- !grond.WaveformTargetGroup
# Normalisation family (see the Grond documentation for how it works).
# Use distinct normalisation families when mixing misfit contributors with
# different magnitude scaling, like e.g. cross-correlation based misfit and
# time-domain Lx norm.
normalisation_family: 'td'
# Just a name used to identify targets from this group. Use dot-separated path
# notation to group related contributors
path: 'td.love'
# Epicentral distance range of stations to be considered in meter
distance_min: 1e3
distance_max: 900e3
# Names of components to be included. Available: N=north, E=east, Z=vertical
# (up), R=radial (away), T=transverse (right)
channels: ['T']
# How to weight contributions from this group in the global misfit
weight: 1.0
# subsection on how to fit the traces
misfit_config: !grond.WaveformMisfitConfig
# Frequency band [Hz] of acausal filter (flat part of frequency taper)
fmin: 0.01
fmax: 0.05
# Factor defining fall-off of frequency taper (zero at fmin/ffactor and
# fmax*ffactor)
ffactor: 1.5
# Time window to include in the data fitting. Times can be defined offset
# to given phase arrivals. E.g. '{stored:P}-600' would mean 600 s
# before arrival of the phase named 'P'. The phase must be defined in the
# travel time tables in the GF store.
tmin: '{stored:any_P}'
tmax: '{vel_surface:2.5}'
# tfade: 120.0
# How to fit the data (available: 'time_domain', 'frequency_domain',
# 'log_frequency_domain', 'absolute', 'envelope', 'cc_max_norm')
domain: 'time_domain'
tautoshift_max: 4.0
autoshift_penalty_max: 0.05
# For L1 norm: 1, L2 norm: 2, etc.
norm_exponent: 1
# How to interpolate the Green's functions (available choices:
# 'nearest_neighbor', 'multilinear'). Choices other than 'nearest_neighbor'
# may require dense GF stores to avoid aliasing artifacts in the forward
# modelling.
interpolation: 'nearest_neighbor'
# Name of the GF Store to use
store_id: 'crust2_j3'
- !grond.WaveformTargetGroup
# Normalisation family (see the Grond documentation for how it works).
# Use distinct normalisation families when mixing misfit contributors with
# different magnitude scaling, like e.g. cross-correlation based misfit and
# time-domain Lx norm.
normalisation_family: 'td'
# Just a name used to identfy targets from this group. Use dot-separated path
# notation to group related contributors
path: 'td.rayleigh'
# Epicentral distance range of stations to be considered in meter
distance_min: 1e3
distance_max: 900e3
# Names of components to be included. Available: N=north, E=east, Z=vertical
# (up), R=radial (away), T=transverse (right)
channels: ['R', 'Z']
# How to weight contributions from this group in the global misfit
weight: 1.0
# subsection on how to fit the traces
misfit_config: !grond.WaveformMisfitConfig
# Frequency band [Hz] of acausal filter (flat part of frequency taper)
fmin: 0.01
fmax: 0.05
# Factor defining fall-off of frequency taper (zero at fmin/ffactor and
# fmax*ffactor)
ffactor: 1.5
# Time window to include in the data fitting. Times can be defined offset
# to given phase arrivals. E.g. '{stored:P}-600' would mean 600 s
# before arrival of the phase named 'P'. The phase must be defined in the
# travel time tables in the GF store.
tmin: '{stored:any_P}'
tmax: '{vel_surface:2.5}'
# tfade: 120.0
# How to fit the data (available: 'time_domain', 'frequency_domain',
# 'log_frequency_domain', 'absolute', 'envelope', 'cc_max_norm')
domain: 'time_domain'
tautoshift_max: 4.0
autoshift_penalty_max: 0.05
# For L1 norm: 1, L2 norm: 2, etc.
norm_exponent: 1
# How to interpolate the Green's functions (available choices:
# 'nearest_neighbor', 'multilinear'). Choices other than 'nearest_neighbor'
# may require dense GF stores to avoid aliasing artifacts in the forward
# modelling.
interpolation: 'nearest_neighbor'
# Name of the GF Store to use
store_id: 'crust2_j3'
# -----------------------------------------------------------------------------
# Definition of the problem to be solved
#
# In this section the source model to be fitted is chosen, the parameter space
# defined, and how to combine the misfit contributions defined in the
# target_groups section above.
#
# The marker !grond.CMTProblemConfig selects a centroid moment tensor source
# model.
# -----------------------------------------------------------------------------
problem_config: !grond.CMTProblemConfig
# Name used to identify the output
name_template: 'cmt_${event_name}'
# Definition of model parameter space to be searched in the optimisation
ranges:
# Time relative to hypocenter origin time [s]
time: '-10 .. 10 | add'
# Centroid location with respect to hypocenter origin [m]
north_shift: '-15e3 .. 15e3'
east_shift: '-15e3 .. 15e3'
depth: '5e3 .. 30e3'
# Range of magnitudes to allow
magnitude: '5.7 .. 6.2'
# Relative moment tensor component ranges (don't touch)
rmnn: '-1.41421 .. 1.41421'
rmee: '-1.41421 .. 1.41421'
rmdd: '-1.41421 .. 1.41421'
rmne: '-1 .. 1'
rmnd: '-1 .. 1'
rmed: '-1 .. 1'
# Source duration range [s]
duration: '1. .. 5.'
# Clearance distance around stations (no models with origin closer than this
# distance to any station are produced by the sampler)
distance_min: 1e3
# Type of moment tensor to restrict to (choices: 'full', 'deviatoric', 'dc')
mt_type: 'deviatoric'