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
lassie
Commits
cbcc8836
Commit
cbcc8836
authored
Jul 05, 2016
by
Marius Kriegerowski
Browse files
snuffle results
parent
2f88f082
Changes
2
Hide whitespace changes
Inline
Side-by-side
apps/lassie
View file @
cbcc8836
...
...
@@ -28,13 +28,15 @@ def str_to_time(s):
subcommand_descriptions
=
{
'init'
:
'create initial configuration file'
,
'scan'
:
'detect seismic events'
,
'map-geometry'
:
'make station map'
'map-geometry'
:
'make station map'
,
'snuffle'
:
'snuffle'
}
subcommand_usages
=
{
'init'
:
'init'
,
'scan'
:
'scan <configfile> [options]'
,
'map-geometry'
:
'map-geometry <configfile> [options]'
,
'snuffle'
:
'snuffle <configfile>'
,
}
subcommands
=
subcommand_descriptions
.
keys
()
...
...
@@ -51,6 +53,7 @@ Subcommands:
init %(init)s
scan %(scan)s
map-geometry %(map_geometry)s
snuffle %(snuffle)s
To get further help and a list of available options for any subcommand run:
...
...
@@ -292,6 +295,18 @@ def command_map_geometry(args):
lassie
.
map_geometry
(
config
,
output_path
)
def
command_snuffle
(
args
):
parser
,
options
,
args
=
cl_parse
(
'snuffle'
,
args
)
if
len
(
args
)
!=
1
:
help_and_die
(
parser
,
'missing arguments'
)
config_path
=
args
[
0
]
config
=
lassie
.
read_config
(
config_path
)
lassie
.
snuffle
(
config
)
if
__name__
==
'__main__'
:
usage_sub
=
'fomosto %s [options]'
...
...
src/plot.py
View file @
cbcc8836
import
time
import
numpy
as
num
from
pyrocko
import
automap
from
pyrocko
import
automap
,
pile
,
snuffler
,
model
,
gui_util
,
util
from
pyrocko
import
orthodrome
from
lassie
import
receiver
,
grid
as
gridmod
,
geo
...
...
@@ -225,6 +226,7 @@ def plot_detection(
t
-
t0
,
dist
+
scalefactor
*
amp
+
ishifter
*
scalefactor
*
0.1
,
color
=
color
)
axes3
.
text
(
t
[
0
]
-
t0
,
dist
,
'.'
.
join
(
tr
.
nslc_id
),
verticalalignment
=
'top'
)
for
tr
in
trs_raw
:
istation
=
station_index
[
tr
.
nslc_id
[:
3
]]
...
...
@@ -296,10 +298,42 @@ def plot_detection(
plt
.
show
()
def
snuffle
(
config
):
receivers
=
config
.
get_receivers
()
stations
=
set
()
for
r
in
receivers
:
n
,
s
,
l
=
r
.
codes
[:
3
]
stations
.
add
(
model
.
Station
(
lat
=
r
.
lat
,
lon
=
r
.
lon
,
network
=
n
,
station
=
s
,
location
=
l
))
markers
=
[]
detections_path
=
config
.
detections_path
with
open
(
config
.
detections_path
,
'r'
)
as
f
:
for
line
in
f
.
readlines
():
data
=
line
.
split
()
i
,
t_d
,
t_t
,
apeak
,
latpeak
,
lonpeak
,
xpeak
,
ypeak
,
zpeak
=
data
lat
,
lon
=
orthodrome
.
ne_to_latlon
(
float
(
latpeak
),
float
(
lonpeak
),
float
(
ypeak
),
float
(
xpeak
))
t
=
util
.
str_to_time
(
"%s %s"
%
(
t_d
,
t_t
))
label
=
"%s-%s"
%
(
i
,
apeak
)
e
=
model
.
Event
(
lat
=
lat
,
lon
=
lon
,
depth
=
float
(
zpeak
)
*
1000.
,
name
=
label
,
time
=
t
)
m
=
gui_util
.
EventMarker
(
e
)
markers
.
append
(
m
)
trs
=
[]
paths
=
config
.
data_paths
paths
.
append
(
'stackmax'
)
p
=
pile
.
make_pile
(
paths
=
paths
,
fileformat
=
'detect'
)
snuffler
.
snuffle
(
p
,
markers
=
markers
,
stations
=
stations
)
__all__
=
[
'map_geometry'
,
'map_gmt'
,
'plot_detection'
,
'plot_geometry_carthesian'
,
'plot_receivers'
,
'snuffle'
,
]
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