Commit fe362a65 authored by Marius Isken's avatar Marius Isken

Started new listeners

parent 0ead9fe5
#!/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/*']},
......
......@@ -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'
......@@ -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=['.'])
solver_config = grond.HighScoreSolverConfig()
optimizer_config = grond.HighScoreOptimizerConfig()
config = grond.Config(
rundir_template=op.join('rundir', '${problem_name}.grun'),
dataset_config=dataset_config,
target_groups=target_groups,
problem_config=problem_config,
solver_config=solver_config,
optimizer_config=optimizer_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()
from __future__ import print_function
import glob
import copy
import logging
......
from .base import * # noqa
from .highscore import * # noqa
from .highscore.optimizer import * # noqa
......@@ -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)
......
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
......@@ -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')
......
......@@ -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'
......
......@@ -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')
......
from .waveform import * # noqa
from .satellite import * # noqa
from .waveform.target import * # noqa
from .satellite.target import * # noqa
from .base import * # noqa
......@@ -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')
......
......@@ -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()
......@@ -7,10 +7,10 @@ from pyrocko.guts import (Object, String, Float, Bool, Int, StringChoice,
Timestamp, List)
from pyrocko.guts_array import Array
from .base import (MisfitConfig, MisfitTarget, TargetGroup,
MisfitResult, TargetAnalysisResult)
from grond.dataset import NotFound
from ..dataset import NotFound
from ..base import (MisfitConfig, MisfitTarget, TargetGroup,
MisfitResult, TargetAnalysisResult)
guts_prefix = 'grond'
logger = logging.getLogger('grond.target').getChild('waveform')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment