Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
sec2.1_ml
deeplearning
Commits
c3ae3c00
Commit
c3ae3c00
authored
Jul 20, 2018
by
Marius Kriegerowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
option: use absolute
parent
3c92f0cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
pinky/src/data.py
pinky/src/data.py
+7
-2
No files found.
pinky/src/data.py
View file @
c3ae3c00
...
...
@@ -3,7 +3,7 @@
import
tensorflow
as
tf
from
pyrocko.io
import
save
,
load
from
pyrocko.model
import
load_stations
from
pyrocko.guts
import
Object
,
String
,
Int
,
Float
,
Tuple
from
pyrocko.guts
import
Object
,
String
,
Int
,
Float
,
Tuple
,
Bool
from
pyrocko.gui
import
marker
from
pyrocko.gf.seismosizer
import
Engine
,
Target
from
pyrocko
import
orthodrome
...
...
@@ -47,6 +47,7 @@ class DataGenerator(Object):
_shape
=
None
fn_stations
=
String
.
T
()
need_same_dimensions
=
True
# bin mir nicht sicher, ob das sein muss...
absolute
=
Bool
.
T
(
help
=
'Use absolute amplitudes'
,
default
=
False
)
effective_deltat
=
Float
.
T
(
optional
=
True
)
sample_length
=
Float
.
T
(
help
=
'length [s] of data window'
)
reference_target
=
Target
.
T
(
...
...
@@ -97,6 +98,10 @@ class DataGenerator(Object):
def
fit_data_into_chunk
(
self
,
traces
,
chunk
,
indices
=
None
,
tref
=
0
):
indices
=
indices
or
range
(
len
(
traces
))
for
i
,
tr
in
zip
(
indices
,
traces
):
if
self
.
absolute
:
tr
.
data
=
num
.
abs
(
tr
.
data
)
data_len
=
len
(
tr
.
data
)
istart_trace
=
int
((
tr
.
tmin
-
tref
)
/
tr
.
deltat
)
istart_array
=
max
(
istart_trace
,
0
)
...
...
@@ -203,7 +208,7 @@ class PileData(DataGenerator):
_trs
.
append
(
tr
)
trs
=
_trs
if
not
len
(
trs
):
logging
.
debug
(
'
n
o data at tmin=%s'
%
m
.
tmin
)
logging
.
debug
(
'
N
o data at tmin=%s'
%
m
.
tmin
)
continue
chunk
=
self
.
get_raw_data_chunk
()
indices
=
[
nslc_to_index
[
tr
.
nslc_id
]
for
tr
in
trs
]
...
...
Write
Preview
Markdown
is supported
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