Skip to content
GitLab
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
7ad727c6
Commit
7ad727c6
authored
Jul 19, 2016
by
Sebastian Heimann
Browse files
guess channel orientations when missing in stations file
parent
baf70e32
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dataset.py
View file @
7ad727c6
...
...
@@ -367,7 +367,7 @@ class Dataset(object):
tmax
=
tmax
+
toffset_noise_extract
,
tpad
=
tpad
,
trace_selector
=
lambda
tr
:
tr
.
nslc_id
==
(
net
,
sta
,
loc
,
cha
),
want_incomplete
=
Tru
e
)
want_incomplete
=
Fals
e
)
if
toffset_noise_extract
!=
0.0
:
for
tr
in
trs
:
...
...
@@ -401,6 +401,40 @@ class Dataset(object):
return
tr
.
transfer
(
tfade
=
tfade
,
freqlimits
=
freqlimits
,
transfer_function
=
resp
,
invert
=
True
)
def
get_projections
(
self
,
station
,
source
,
target
,
tmin
,
tmax
):
# fill in missing channel information (happens when station file
# does not contain any channel information)
if
not
station
.
get_channels
():
station
=
copy
.
deepcopy
(
station
)
nsl
=
station
.
nsl
()
trs
=
self
.
pile
.
all
(
tmin
=
tmin
,
tmax
=
tmax
,
trace_selector
=
lambda
tr
:
tr
.
nslc_id
[:
3
]
==
nsl
,
load_data
=
False
)
channels
=
list
(
set
(
tr
.
channel
for
tr
in
trs
))
station
.
set_channels_by_name
(
*
channels
)
projections
=
[]
projections
.
extend
(
station
.
guess_projections_to_enu
(
out_channels
=
(
'E'
,
'N'
,
'Z'
)))
if
source
is
not
None
and
target
is
not
None
:
backazimuth
=
source
.
azibazi_to
(
target
)[
1
]
if
backazimuth
is
not
None
:
projections
.
extend
(
station
.
guess_projections_to_rtu
(
out_channels
=
(
'R'
,
'T'
,
'Z'
),
backazimuth
=
backazimuth
))
if
not
projections
:
raise
NotFound
(
'cannot determine projection of data components'
,
nslc
)
return
projections
def
get_waveform
(
self
,
obj
,
quantity
=
'displacement'
,
...
...
@@ -473,25 +507,11 @@ class Dataset(object):
else
:
abs_delay_max
=
0.0
mios
=
[]
mios
.
extend
(
station
.
guess_projections_to_enu
(
out_channels
=
(
'E'
,
'N'
,
'Z'
)))
if
source
is
not
None
and
target
is
not
None
:
backazimuth
=
source
.
azibazi_to
(
target
)[
1
]
if
backazimuth
is
not
None
:
mios
.
extend
(
station
.
guess_projections_to_rtu
(
out_channels
=
(
'R'
,
'T'
,
'Z'
),
backazimuth
=
backazimuth
))
if
not
mios
:
raise
NotFound
(
'cannot determine projection of data components'
,
nslc
)
projections
=
self
.
get_projections
(
station
,
source
,
target
,
tmin
,
tmax
)
try
:
trs_projected
=
[]
for
matrix
,
in_channels
,
out_channels
in
m
ios
:
for
matrix
,
in_channels
,
out_channels
in
project
io
n
s
:
deps
=
trace
.
project_dependencies
(
matrix
,
in_channels
,
out_channels
)
...
...
Sebastian Heimann
@heimann
mentioned in commit
ce4fb7dd
·
Jul 19, 2016
mentioned in commit
ce4fb7dd
mentioned in commit ce4fb7dd368296d40bbf5b10a425b0f4c1c10a02
Toggle commit list
Sebastian Heimann
@heimann
Mentioned in commit
ce4fb7dd
·
Oct 14, 2016
Mentioned in commit
ce4fb7dd
Mentioned in commit ce4fb7dd368296d40bbf5b10a425b0f4c1c10a02
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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