Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sebastian Heimann
grond
Commits
cac27521
Commit
cac27521
authored
Mar 14, 2017
by
Sebastian Heimann
Browse files
Merge remote-tracking branch 'origin/master' into solver_plot
parents
82f9a344
61ad6a4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/core.py
View file @
cac27521
...
...
@@ -775,6 +775,7 @@ class SyntheticTest(Object):
respect_data_availability
=
Bool
.
T
(
default
=
False
)
real_noise_scale
=
Float
.
T
(
default
=
0.0
)
white_noise_scale
=
Float
.
T
(
default
=
0.0
)
relative_white_noise_scale
=
Float
.
T
(
default
=
0.0
)
random_response_scale
=
Float
.
T
(
default
=
0.0
)
real_noise_toffset
=
Float
.
T
(
default
=-
3600.
)
random_seed
=
Int
.
T
(
optional
=
True
)
...
...
@@ -818,26 +819,33 @@ class SyntheticTest(Object):
for
iresult
,
result
in
enumerate
(
results
):
tr
=
result
.
trace
.
pyrocko_trace
()
tfade
=
tr
.
tmax
-
tr
.
tmin
tr_orig
=
tr
.
copy
()
tr
.
extend
(
tr
.
tmin
-
tfade
,
tr
.
tmax
+
tfade
)
rstate
=
num
.
random
.
RandomState
(
(
self
.
random_seed
or
0
)
+
iresult
)
if
self
.
random_response_scale
!=
0
:
tf
=
RandomResponse
(
scale
=
self
.
random_response_scale
)
rstate
=
num
.
random
.
RandomState
(
(
self
.
random_seed
or
0
)
+
iresult
)
tf
.
set_random_state
(
rstate
)
tr
=
tr
.
transfer
(
tfade
=
tfade
,
transfer_function
=
tf
)
if
self
.
white_noise_scale
!=
0.0
:
rstate
=
num
.
random
.
RandomState
(
(
self
.
random_seed
or
0
)
+
iresult
)
u
=
rstate
.
normal
(
scale
=
self
.
white_noise_scale
,
size
=
tr
.
data_len
())
tr
.
ydata
+=
u
if
self
.
relative_white_noise_scale
!=
0.0
:
u
=
rstate
.
normal
(
scale
=
self
.
relative_white_noise_scale
*
num
.
std
(
tr_orig
.
ydata
),
size
=
tr
.
data_len
())
tr
.
ydata
+=
u
synthetics
[
result
.
trace
.
codes
]
=
tr
self
.
_synthetics
=
synthetics
...
...
@@ -1929,16 +1937,20 @@ def check(
freqlimits
[
3
]
=
0.5
/
deltat
freqlimits
=
tuple
(
freqlimits
)
trs_projected
,
trs_restituted
,
trs_raw
=
\
ds
.
get_waveform
(
target
.
codes
,
tmin
=
tmin
+
tobs_shift
,
tmax
=
tmax
+
tobs_shift
,
tfade
=
tfade
,
freqlimits
=
freqlimits
,
deltat
=
deltat
,
backazimuth
=
target
.
get_backazimuth_for_waveform
(),
debug
=
True
)
try
:
trs_projected
,
trs_restituted
,
trs_raw
=
\
ds
.
get_waveform
(
target
.
codes
,
tmin
=
tmin
+
tobs_shift
,
tmax
=
tmax
+
tobs_shift
,
tfade
=
tfade
,
freqlimits
=
freqlimits
,
deltat
=
deltat
,
backazimuth
=
target
.
get_backazimuth_for_waveform
(),
debug
=
True
)
except
dataset
.
NotFound
,
e
:
logger
.
warn
(
str
(
e
))
continue
trs_projected
=
copy
.
deepcopy
(
trs_projected
)
trs_restituted
=
copy
.
deepcopy
(
trs_restituted
)
...
...
@@ -2066,8 +2078,8 @@ def check(
event
.
name
or
util
.
time_to_str
(
event
.
time
),
str
(
e
)))
if
show_waveforms
:
trace
.
snuffle
(
trs_all
,
stations
=
ds
.
get_stations
(),
markers
=
markers
)
if
show_waveforms
:
trace
.
snuffle
(
trs_all
,
stations
=
ds
.
get_stations
(),
markers
=
markers
)
g_state
=
{}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment