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
fe362a65
Commit
fe362a65
authored
Nov 27, 2017
by
Marius Isken
Browse files
Started new listeners
parent
0ead9fe5
Changes
21
Hide whitespace changes
Inline
Side-by-side
setup.py
View file @
fe362a65
#!/usr/bin/env python
import
os
from
distutils.core
import
setup
from
setuptools
import
setup
def
grond_completion
():
...
...
@@ -12,13 +12,31 @@ def grond_completion():
setup
(
name
=
'grond'
,
description
=
'What do you want to bust today?!'
,
version
=
'0.
1
'
,
version
=
'0.
2
'
,
author
=
'Sebastian Heimann'
,
author_email
=
'sebastian.heimann@gfz-potsdam.de'
,
packages
=
[
'grond'
,
'grond.baraddur'
,
'grond.problems'
,
'grond.optimizers'
,
'grond.analysers'
,
'grond.listeners'
,
'grond.targets'
],
packages
=
[
'grond'
,
'grond.apps'
,
'grond.baraddur'
,
'grond.targets'
,
'grond.targets.waveform'
,
'grond.targets.satellite'
,
'grond.problems'
,
'grond.problems.cmt'
,
'grond.problems.double_dc'
,
'grond.problems.rectangular'
,
'grond.optimizers'
,
'grond.optimizers.highscore'
,
'grond.analysers'
,
'grond.listeners'
,
],
python_requires
=
'>=3.5'
,
scripts
=
[
'apps/grond'
],
entry_points
=
{
'console_scripts'
:
[
'grond = grond.apps.__main__:main'
,
]
},
package_dir
=
{
'grond'
:
'src'
},
package_data
=
{
'grond'
:
[
'baraddur/templates/*.html'
,
'baraddur/res/*'
]},
...
...
src/__init__.py
View file @
fe362a65
...
...
@@ -4,7 +4,6 @@ from .problems import * # noqa
from
.targets
import
*
# noqa
from
.meta
import
*
# noqa
from
.synthetic_tests
import
*
# noqa
from
.solvers
import
*
# noqa
from
.optimizers
import
*
# noqa
__version__
=
'0.2'
apps/
grond
→
src/
apps/
__main__.py
View file @
fe362a65
...
...
@@ -81,6 +81,32 @@ To get further help and a list of available options for any subcommand run:
'''
%
usage_tdata
def
main
(
args
=
None
):
if
not
args
:
args
=
sys
.
argv
args
=
list
(
sys
.
argv
)
if
len
(
args
)
<
2
:
sys
.
exit
(
'Usage: %s'
%
usage
)
args
.
pop
(
0
)
command
=
args
.
pop
(
0
)
if
command
in
subcommands
:
globals
()[
'command_'
+
d2u
(
command
)](
args
)
elif
command
in
(
'--help'
,
'-h'
,
'help'
):
if
command
==
'help'
and
args
:
acommand
=
args
[
0
]
if
acommand
in
subcommands
:
globals
()[
'command_'
+
acommand
]([
'--help'
])
sys
.
exit
(
'Usage: %s'
%
usage
)
else
:
die
(
'no such subcommand: %s'
%
command
)
def
add_common_options
(
parser
):
parser
.
add_option
(
'--loglevel'
,
...
...
@@ -206,7 +232,8 @@ def command_init(args):
elif
options
.
static
:
config_type
=
'static'
sub_dirs
+=
[
'scenes'
]
sub_dirs
+=
[
'scenes'
,
'gnss'
]
dataset_config
=
grond
.
DatasetConfig
(
events_path
=
'events.txt'
,
kite_scene_paths
=
[
'scenes'
],
...
...
@@ -245,14 +272,14 @@ def command_init(args):
engine_config
=
grond
.
EngineConfig
(
gf_store_superdirs
=
[
'.'
])
solv
er_config
=
grond
.
HighScore
Solv
erConfig
()
optimiz
er_config
=
grond
.
HighScore
Optimiz
erConfig
()
config
=
grond
.
Config
(
rundir_template
=
op
.
join
(
'rundir'
,
'${problem_name}.grun'
),
dataset_config
=
dataset_config
,
target_groups
=
target_groups
,
problem_config
=
problem_config
,
solv
er_config
=
solv
er_config
,
optimiz
er_config
=
optimiz
er_config
,
engine_config
=
engine_config
)
events
=
'''name = 2011-myanmar
...
...
@@ -706,24 +733,4 @@ def command_qc_polarization(args):
if
__name__
==
'__main__'
:
if
len
(
sys
.
argv
)
<
2
:
sys
.
exit
(
'Usage: %s'
%
usage
)
args
=
list
(
sys
.
argv
)
args
.
pop
(
0
)
command
=
args
.
pop
(
0
)
if
command
in
subcommands
:
globals
()[
'command_'
+
d2u
(
command
)](
args
)
elif
command
in
(
'--help'
,
'-h'
,
'help'
):
if
command
==
'help'
and
args
:
acommand
=
args
[
0
]
if
acommand
in
subcommands
:
globals
()[
'command_'
+
acommand
]([
'--help'
])
sys
.
exit
(
'Usage: %s'
%
usage
)
else
:
die
(
'no such subcommand: %s'
%
command
)
main
()
src/dataset.py
View file @
fe362a65
from
__future__
import
print_function
import
glob
import
copy
import
logging
...
...
src/optimizers/__init__.py
View file @
fe362a65
from
.base
import
*
# noqa
from
.highscore
import
*
# noqa
from
.highscore
.optimizer
import
*
# noqa
src/optimizers/highscore/__init__.py
0 → 100644
View file @
fe362a65
src/optimizers/highscore.py
→
src/optimizers/highscore
/optimizer
.py
View file @
fe362a65
...
...
@@ -9,9 +9,11 @@ import numpy as num
from
pyrocko.guts
import
StringChoice
,
Int
,
Float
,
Object
,
List
from
pyrocko.guts_array
import
Array
from
..meta
import
GrondError
,
Forbidden
from
.base
import
Optimizer
,
OptimizerConfig
,
BadProblem
from
..problems.base
import
ModelHistory
from
grond.meta
import
GrondError
,
Forbidden
from
..base
import
Optimizer
,
OptimizerConfig
,
BadProblem
from
grond.problems.base
import
ModelHistory
guts_prefix
=
'grond'
...
...
@@ -374,7 +376,10 @@ class HighScoreOptimizer(Optimizer):
class
HighScoreOptimizerConfig
(
OptimizerConfig
):
sampler_phases
=
List
.
T
(
SamplerPhase
.
T
())
sampler_phases
=
List
.
T
(
SamplerPhase
.
T
(),
default
=
[
UniformSamplerPhase
(
niterations
=
1000
),
DirectedSamplerPhase
(
niterations
=
5000
)])
chain_length_factor
=
Float
.
T
(
default
=
8.
)
nbootstrap
=
Int
.
T
(
default
=
10
)
...
...
src/problems/__init__.py
View file @
fe362a65
from
.base
import
*
# noqa
from
.cmt
import
*
# noqa
from
.rectangular
import
*
# noqa
from
.double_dc
import
*
# noqa
from
.cmt
.problem
import
*
# noqa
from
.rectangular
.problem
import
*
# noqa
from
.double_dc
.problem
import
*
# noqa
src/problems/cmt/__init__.py
0 → 100644
View file @
fe362a65
src/problems/cmt.py
→
src/problems/cmt
/problem
.py
View file @
fe362a65
...
...
@@ -5,8 +5,9 @@ import logging
from
pyrocko
import
gf
,
util
,
moment_tensor
as
mtm
from
pyrocko.guts
import
String
,
Float
,
Dict
,
StringChoice
from
.base
import
Problem
,
ProblemConfig
from
..meta
import
Forbidden
,
expand_template
,
Parameter
from
grond.meta
import
Forbidden
,
expand_template
,
Parameter
from
..base
import
Problem
,
ProblemConfig
guts_prefix
=
'grond'
logger
=
logging
.
getLogger
(
'grond.problems'
).
getChild
(
'cmt'
)
...
...
src/problems/double_dc/__init__.py
0 → 100644
View file @
fe362a65
src/problems/double_dc.py
→
src/problems/double_dc
/problem
.py
View file @
fe362a65
...
...
@@ -4,8 +4,9 @@ import logging
from
pyrocko
import
gf
,
util
from
pyrocko.guts
import
String
,
Float
,
Dict
from
.base
import
Problem
,
ProblemConfig
from
..meta
import
Forbidden
,
expand_template
,
Parameter
from
grond.meta
import
Forbidden
,
expand_template
,
Parameter
from
..base
import
Problem
,
ProblemConfig
guts_prefix
=
'grond'
...
...
src/problems/rectangular/__init__.py
0 → 100644
View file @
fe362a65
src/problems/rectangular.py
→
src/problems/rectangular
/problem
.py
View file @
fe362a65
...
...
@@ -4,8 +4,9 @@ import logging
from
pyrocko
import
gf
from
pyrocko.guts
import
String
,
Bool
,
Float
,
Dict
,
Int
from
.base
import
Problem
,
ProblemConfig
from
..meta
import
expand_template
,
Parameter
from
grond.meta
import
expand_template
,
Parameter
from
..base
import
Problem
,
ProblemConfig
guts_prefix
=
'grond'
logger
=
logging
.
getLogger
(
'grond.problems'
).
getChild
(
'rectangular'
)
...
...
src/targets/__init__.py
View file @
fe362a65
from
.waveform
import
*
# noqa
from
.satellite
import
*
# noqa
from
.waveform
.target
import
*
# noqa
from
.satellite
.target
import
*
# noqa
from
.base
import
*
# noqa
src/targets/gnss_campaign/__init__.py
0 → 100644
View file @
fe362a65
src/targets/gnss.py
→
src/targets/gnss
_campaign/target
.py
View file @
fe362a65
...
...
@@ -2,7 +2,7 @@ import logging
from
pyrocko
import
gf
from
.base
import
MisfitTarget
,
MisfitConfig
,
MisfitResult
,
TargetGroup
from
.
.base
import
MisfitTarget
,
MisfitConfig
,
MisfitResult
,
TargetGroup
guts_prefix
=
'grond'
logger
=
logging
.
getLogger
(
'grond.target'
).
getChild
(
'gnss'
)
...
...
src/targets/satellite/__init__.py
0 → 100644
View file @
fe362a65
src/targets/satellite.py
→
src/targets/satellite
/target
.py
View file @
fe362a65
...
...
@@ -4,8 +4,9 @@ import numpy as num
from
pyrocko
import
gf
from
pyrocko.guts
import
String
,
Bool
,
Dict
,
List
from
.base
import
MisfitTarget
,
MisfitConfig
,
MisfitResult
,
TargetGroup
from
..meta
import
Parameter
from
grond.meta
import
Parameter
from
..base
import
MisfitTarget
,
MisfitConfig
,
MisfitResult
,
TargetGroup
guts_prefix
=
'grond'
logger
=
logging
.
getLogger
(
'grond.target'
).
getChild
(
'satellite'
)
...
...
@@ -138,10 +139,10 @@ class SatelliteMisfitTarget(MisfitTarget, gf.SatelliteTarget):
def
get_combined_weight
(
self
,
apply_balancing_weights
=
False
):
return
self
.
manual_weight
__all__
=
'''
SatelliteTargetGroup
SatelliteMisfitConfig
SatelliteMisfitTarget
SatelliteMisfitResult
'''
.
split
()
src/targets/waveform/__init__.py
0 → 100644
View file @
fe362a65
Prev
1
2
Next
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