Browse Source

grond forward: add --show option to select "filtered" or "processed"

forward-show
Sebastian Heimann 10 months ago
parent
commit
ffd7d788ac
  1. 8
      CHANGELOG.md
  2. 9
      src/apps/grond.py
  3. 18
      src/core.py

8
CHANGELOG.md

@ -18,6 +18,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Satellite Plots: added draped surface displacements onto topography.
- Satellite Plots: added more control through PlotConfig.
- Satellite Plots: added cyclic radians plots.
- Option to switch between showing filtered or processed waveforms in
`grond forward`.
### Fixed
- Fix search in HTML report.
@ -95,7 +97,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Transparent event loading and checking.
- Noise analyser: target groups are now handled independently. Each group now
uses its own threshold in weeding mode.
- Improved error handling (`grond check`, instrument responses,
- Improved error handling (`grond check`, instrument responses,
- Only exclude waveform targets when `distance_min` constraint is given in
`problem_config`.
- Improved method chapter in documentation.
@ -124,7 +126,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- New problem config sections in `grond init`.
### Changed
- Documentation of problems configurations are now centralised at
- Documentation of problems configurations are now centralised at
`src/data/snippets`.
- Output of `grond init list`.
@ -160,7 +162,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
multiple misfits.
- Optimiser can now be configured to yield exactly reproducible results by
providing seed values for all random number generators involved.
- Plots `sequence` and `fits_waveform`: layout as single plot figures by
- Plots `sequence` and `fits_waveform`: layout as single plot figures by
default.
### Fixed

9
src/apps/grond.py

@ -768,7 +768,12 @@ def command_forward(args):
from grond.environment import Environment
def setup(parser):
pass
parser.add_option(
'--show', dest='show', metavar='WHAT',
default='filtered',
choices=('filtered', 'processed'),
help='select whether to show only "filtered" or fully "processed" '
'(i.e. tapered) waveforms (default "%default").')
parser, options, args = cl_parse('forward', args, setup)
if len(args) < 1:
@ -776,7 +781,7 @@ def command_forward(args):
try:
env = Environment(args)
grond.forward(env)
grond.forward(env, show=options.show)
except grond.GrondError as e:
die(str(e))

18
src/core.py

@ -93,7 +93,7 @@ def sarr(a):
return ' '.join('%15g' % x for x in a)
def forward(env):
def forward(env, show='filtered'):
payload = []
if env.have_rundir():
env.setup_modelling()
@ -123,10 +123,18 @@ def forward(env):
for result in results:
if isinstance(result, WaveformMisfitResult):
result.filtered_obs.set_codes(location='ob')
result.filtered_syn.set_codes(location='sy')
all_trs.append(result.filtered_obs)
all_trs.append(result.filtered_syn)
if show == 'filtered':
result.filtered_obs.set_codes(location='ob')
result.filtered_syn.set_codes(location='sy')
all_trs.append(result.filtered_obs)
all_trs.append(result.filtered_syn)
elif show == 'processed':
result.processed_obs.set_codes(location='ob')
result.processed_syn.set_codes(location='sy')
all_trs.append(result.processed_obs)
all_trs.append(result.processed_syn)
else:
raise ValueError('Invalid argument for show: %s' % show)
for station in ds.get_stations():
stations[station.nsl()] = station

Loading…
Cancel
Save