Browse Source

gf_store stored_quantity rotation from qssp2017

undefined
braunfuss 2 months ago
parent
commit
5f331110a9
3 changed files with 42 additions and 36 deletions
  1. +40
    -36
      src/fomosto/qssp.py
  2. +1
    -0
      src/gf/meta.py
  3. +1
    -0
      src/gf/seismosizer.py

+ 40
- 36
src/fomosto/qssp.py View File

@@ -32,7 +32,6 @@ program_bins = {
'qssp.2010': 'fomosto_qssp2010',
'qssp.2017': 'fomosto_qssp2017',
'qssp.ppeg2017': 'fomosto_qsspppeg2017',
'qssp.rot2017': 'fomosto_qssp2017',
}


@@ -192,6 +191,7 @@ class QSSPConfigFull(QSSPConfig):
receiver_depth = Float.T(default=0.0)
sampling_interval = Float.T(default=5.0)

stored_quantity = String.T(default='displacement')
output_filename = String.T(default='receivers')
output_format = Int.T(default=1)
output_time_window = Float.T(optional=True)
@@ -216,18 +216,19 @@ class QSSPConfigFull(QSSPConfig):
@property
def components(self):
if self.qssp_version == '2017':
fmt = 3
if self.stored_quantity == "rotation":
fmt = 5
else:
fmt = 3
elif self.qssp_version == 'ppeg2017':
fmt = 4
elif self.qssp_version == 'rot2017':
fmt = 5
else:
fmt = self.output_format

return qssp_components[fmt]

def get_output_filenames(self, rundir):
if self.qssp_version in ('2017', 'ppeg2017', 'rot2017'):
if self.qssp_version in ('2017', 'ppeg2017'):
return [
pjoin(rundir, self.output_filename + c + '.dat')
for c in self.components]
@@ -267,13 +268,12 @@ class QSSPConfigFull(QSSPConfig):
model_str, nlines = cake_model_to_config(self.earthmodel_1d)
d['n_model_lines'] = nlines
d['model_lines'] = model_str
if self.qssp_version == '2017':
d['output_displacement'] = 1
d['output_rotation'] = 0

if self.qssp_version == 'rot2017':
if self.stored_quantity == "rotation":
d['output_rotation'] = 1
d['output_displacement'] = 0
else:
d['output_displacement'] = 1
d['output_rotation'] = 0

if len(self.sources) == 0 or isinstance(self.sources[0], QSSPSourceMT):
d['point_source_type'] = 1
@@ -302,7 +302,7 @@ class QSSPConfigFull(QSSPConfig):
self.lowpass_order,
self.lowpass_corner)

elif self.qssp_version in ('2010', '2017', 'ppeg2017', 'rot2017'):
elif self.qssp_version in ('2010', '2017', 'ppeg2017'):
d['scutoff_doc'] = '''
# (SH waves), minimum and maximum cutoff harmonic degrees
# Note: if the near-field static displacement is desired, the minimum
@@ -328,7 +328,7 @@ class QSSPConfigFull(QSSPConfig):
self.bandpass_order,
self.bandpass_corner_low,
self.bandpass_corner_high)
if self.qssp_version in ('2017', 'ppeg2017', 'rot2017'):
if self.qssp_version in ('2017', 'ppeg2017'):
template = '''# autogenerated QSSP input by qssp.py
#
# This is the input file of FORTRAN77 program "qssp2017" for calculating
@@ -786,29 +786,34 @@ class QSSPGFBuilder(gf.builder.Builder):

self.store = gf.store.Store(store_dir, 'w')
baseconf = self.store.get_extra('qssp')

if baseconf.qssp_version == '2017':
self.gfmapping = [
(MomentTensor(m=symmat6(1, 0, 0, 1, 0, 0)),
{'_disp_n': (0, -1), '_disp_e': (3, -1), '_disp_z': (5, -1)}),
(MomentTensor(m=symmat6(0, 0, 0, 0, 1, 1)),
{'_disp_n': (1, -1), '_disp_e': (4, -1), '_disp_z': (6, -1)}),
(MomentTensor(m=symmat6(0, 0, 1, 0, 0, 0)),
{'_disp_n': (2, -1), '_disp_z': (7, -1)}),
(MomentTensor(m=symmat6(0, 1, 0, 0, 0, 0)),
{'_disp_n': (8, -1), '_disp_z': (9, -1)}),
]
if baseconf.qssp_version == 'rot2017':
self.gfmapping = [
(MomentTensor(m=symmat6(1, 0, 0, 1, 0, 0)),
{'_rota_n': (0, -1), '_rota_e': (3, -1), '_rota_z': (5, -1)}),
(MomentTensor(m=symmat6(0, 0, 0, 0, 1, 1)),
{'_rota_n': (1, -1), '_rota_e': (4, -1), '_rota_z': (6, -1)}),
(MomentTensor(m=symmat6(0, 0, 1, 0, 0, 0)),
{'_rota_n': (2, -1), '_rota_z': (7, -1)}),
(MomentTensor(m=symmat6(0, 1, 0, 0, 0, 0)),
{'_rota_n': (8, -1), '_rota_z': (9, -1)}),
]
if self.store.config.stored_quantity == "rotation":
self.gfmapping = [
(MomentTensor(m=symmat6(1, 0, 0, 1, 0, 0)),
{'_rota_n': (0, -1), '_rota_e': (3, -1),
'_rota_z': (5, -1)}),
(MomentTensor(m=symmat6(0, 0, 0, 0, 1, 1)),
{'_rota_n': (1, -1), '_rota_e': (4, -1),
'_rota_z': (6, -1)}),
(MomentTensor(m=symmat6(0, 0, 1, 0, 0, 0)),
{'_rota_n': (2, -1), '_rota_z': (7, -1)}),
(MomentTensor(m=symmat6(0, 1, 0, 0, 0, 0)),
{'_rota_n': (8, -1), '_rota_z': (9, -1)}),
]
else:
self.gfmapping = [
(MomentTensor(m=symmat6(1, 0, 0, 1, 0, 0)),
{'_disp_n': (0, -1), '_disp_e': (3, -1),
'_disp_z': (5, -1)}),
(MomentTensor(m=symmat6(0, 0, 0, 0, 1, 1)),
{'_disp_n': (1, -1), '_disp_e': (4, -1),
'_disp_z': (6, -1)}),
(MomentTensor(m=symmat6(0, 0, 1, 0, 0, 0)),
{'_disp_n': (2, -1), '_disp_z': (7, -1)}),
(MomentTensor(m=symmat6(0, 1, 0, 0, 0, 0)),
{'_disp_n': (8, -1), '_disp_z': (9, -1)}),
]

elif baseconf.qssp_version == 'ppeg2017':
self.gfmapping = [
(MomentTensor(m=symmat6(1, 0, 0, 1, 0, 0)),
@@ -848,7 +853,6 @@ class QSSPGFBuilder(gf.builder.Builder):
conf.gf_directory = pjoin(store_dir, 'qssp_green')
conf.earthmodel_1d = self.store.config.earthmodel_1d
deltat = self.store.config.deltat

if 'time_window' not in shared:
d = self.store.make_timing_params(
conf.time_region[0], conf.time_region[1],
@@ -903,8 +907,8 @@ class QSSPGFBuilder(gf.builder.Builder):
runner = QSSPRunner(tmp=self.tmp)

conf.receiver_depth = rz/km
conf.stored_quantity = self.store.config.stored_quantity
conf.sampling_interval = 1.0 / self.gf_config.sample_rate

dx = self.gf_config.distance_delta

if self.step == 0:


+ 1
- 0
src/gf/meta.py View File

@@ -305,6 +305,7 @@ class NearfieldTermsType(StringChoice):
class QuantityType(StringChoice):
choices = [
'displacement',
'rotation',
'velocity',
'acceleration',
'pressure',


+ 1
- 0
src/gf/seismosizer.py View File

@@ -2933,6 +2933,7 @@ class StaticDisplacement(Rule):

channel_rules = {
'displacement': [VectorRule('displacement')],
'rotation': [VectorRule('rotation')],
'velocity': [
VectorRule('velocity'),
VectorRule('displacement', differentiate=1)],


Loading…
Cancel
Save