Browse Source

IDS curved: bugfix

pull/4/head
mmetz 1 year ago
parent
commit
02436d2933
  1. 21
      src/io/ids.py
  2. 2
      src/si/ids/targets/waveform.py

21
src/io/ids.py

@ -884,8 +884,8 @@ def load_curved_source(
east_shift=easts[ip],
x_coordinate=xs[ip],
y_coordinate=ys[ip],
length=patch_length,
width=patch_width,
length=patch_length[ip],
width=patch_width[ip],
slip=slips[ip],
strike=strikes[ip],
dip=dips[ip],
@ -902,9 +902,9 @@ def load_curved_source(
length=0.,
width=0.,
time=config['time'],
strike=config['strike'],
dip=config['dip'],
rake=config['rake'],
strike=None,
dip=None,
rake=None,
nucleation_x=None,
nucleation_y=None,
patches=patches,
@ -973,7 +973,6 @@ def load_ids_source(config_fn):
raise IDSUnpackError('Sampling rate of the patch source time '
'function is not uniform.')
patch_length, patch_width = num.unique(lns), num.unique(wds)
nx, ny = num.unique(xs).shape[0], num.unique(ys).shape[0]
kwargs_source = dict(
@ -989,8 +988,8 @@ def load_ids_source(config_fn):
rakes=rakes,
xs=xs,
ys=ys,
patch_length=patch_length,
patch_width=patch_width,
patch_length=lns,
patch_width=wds,
nx=nx,
ny=ny,
mp_n_subfaults=mp_n_subfaults,
@ -1001,9 +1000,13 @@ def load_ids_source(config_fn):
moments=moments,
rundir=rundir)
if patch_length.shape[0] > 1 or patch_width.shape[0] > 1:
if num.unique(lns).shape[0] > 1 or num.unique(wds).shape[0] > 1:
source = load_curved_source(**kwargs_source)
else:
kwargs_source.update(dict(
patch_length=num.unique(lns),
patch_width=num.unique(wds)))
source = load_rectangular_source(**kwargs_source)
# Based on maximum decimal digit of eq_mp file moment

2
src/si/ids/targets/waveform.py

@ -124,7 +124,7 @@ class WaveformTargetGroupConfig(TargetGroupConfig):
t_length = Float.T(
optional=True,
help='All traces are cutted to given length in [s], if given.')
help='If given, all traces are cutted to given length in [s].')
static_weight = Float.T(
default=0.,

Loading…
Cancel
Save