Commit 7d58cb05 authored by Marius Isken's avatar Marius Isken
Browse files

Fixed grond init // temp fixes listeners and highscore solver

parent b1ccc7de
......@@ -171,15 +171,15 @@ def command_init(args):
events_path='events.txt',
waveform_paths=['data'])
target_configs = [grond.TargetConfig(
super_group='time_domain',
group='all',
target_groups = [grond.WaveformTargetGroup(
normalisation_family='time_domain',
path='all',
distance_min=10*km,
distance_max=1000*km,
channels=['Z', 'R', 'T'],
interpolation='multilinear',
store_id='gf_store',
inner_misfit_config=grond.InnerMisfitConfig(
misfit_config=grond.WaveformMisfitConfig(
fmin=0.01,
fmax=0.1))]
......@@ -213,14 +213,21 @@ def command_init(args):
kite_scene_paths=['scenes'],
)
target_configs = [grond.TargetConfig(
super_group='insar_target',
group='all',
target_groups = [grond.SatelliteTargetGroup(
normalisation_family='insar_target',
path='all',
interpolation='multilinear',
store_id='gf_store',
kite_scenes=['*all'],
inner_misfit_config=grond.InnerSatelliteMisfitConfig(
use_weight_focal=False))]
misfit_config=grond.SatelliteMisfitConfig(
use_weight_focal=False,
optimize_orbital_ramp=True,
ranges={
'offset': '-0.5 .. 0.5',
'ramp_north': '-1e-4 .. 1e4',
'ramp_east': '-1e-4 .. 1e4'
}
))]
problem_config = grond.RectangularProblemConfig(
name_template='rect_source',
......@@ -242,7 +249,7 @@ def command_init(args):
config = grond.Config(
rundir_template=op.join(op.abspath(op.curdir), 'rundir'),
dataset_config=dataset_config,
target_configs=target_configs,
target_groups=target_groups,
problem_config=problem_config,
engine_config=engine_config)
......@@ -289,8 +296,9 @@ def command_events(args):
config_path = args[0]
config = grond.read_config(config_path)
print 'Available Events:'
for event_name in grond.get_event_names(config):
print event_name
print '* %s' % event_name
def command_check(args):
......@@ -355,6 +363,18 @@ def command_go(args):
help='start the Barad-dur plotting server')
parser, options, args = cl_parse('go', args, setup)
if len(args) == 1:
config_path = args[0]
config = grond.read_config(config_path)
print 'Available Events:'
for event_name in grond.get_event_names(config):
print '* %s' % event_name
print '\n'
help_and_die(parser, 'missing arguments')
if len(args) < 2:
help_and_die(parser, 'missing arguments')
......
......@@ -119,7 +119,7 @@ class CursesListener(object):
def set_screen(self, scr):
self.scr = scr
def set_state(self, state):
def state(self, state):
self.state = state
self.parameter_pad.update(state)
self.header_pad.update(state)
......
......@@ -47,9 +47,6 @@ class TerminalListener(Listener):
def fmt(s):
return util.gform(s, significant_digits=(self.col_width-1-6)/2)
print state.parameter_names
print state.parameter_sets
out_ln = self.row_name +\
''.join([self.parameter_fmt] * len(state.parameter_sets))
col_param_width = max([len(p) for p in state.parameter_names]) + 2
......
......@@ -104,14 +104,15 @@ def solve(problem,
state.problem_name = problem.name
state.parameter_names = problem.parameter_names + ['Misfit']
npar = len(state.parameter_names)
state.parameter_sets = OrderedDict()
state.parameter_sets['BS mean'] = num.zeros(problem.nparameters + 1)
state.parameter_sets['BS std'] = num.zeros(problem.nparameters + 1)
state.parameter_sets['Global mean'] = num.zeros(problem.nparameters + 1)
state.parameter_sets['Global std'] = num.zeros(problem.nparameters + 1)
state.parameter_sets['Global best'] = num.zeros(problem.nparameters + 1)
state.parameter_sets['BS mean'] = num.zeros(npar)
state.parameter_sets['BS std'] = num.zeros(npar)
state.parameter_sets['Global mean'] = num.zeros(npar)
state.parameter_sets['Global std'] = num.zeros(npar)
state.parameter_sets['Global best'] = num.zeros(npar)
for par in state.parameter_sets.values():
par.fill(num.nan)
......@@ -362,11 +363,11 @@ def solve(problem,
else:
assert False, 'invalid standard_deviation_estimator choice'
state.parameter_sets['BS mean'][:-1] = mbx
state.parameter_sets['BS std'][:-1] = sbx
state.parameter_sets['Global mean'][:-1] = mgx
state.parameter_sets['Global std'][:-1] = sgx
state.parameter_sets['Global best'][:-1] = bgx
state.parameter_sets['BS mean'][:-1-problem.ndependants] = mbx
state.parameter_sets['BS std'][:-1-problem.ndependants] = sbx
state.parameter_sets['Global mean'][:-1-problem.ndependants] = mgx
state.parameter_sets['Global std'][:-1-problem.ndependants] = sgx
state.parameter_sets['Global best'][:-1-problem.ndependants] = bgx
state.parameter_sets['Global mean'][-1] = num.mean(gms)
state.parameter_sets['Global std'][-1] = num.std(gms)
......
from .waveform import WaveformTargetGroup, WaveformMisfitTarget # noqa
from .satellite import SatelliteTargetGroup, SatelliteMisfitTarget # noqa
from .waveform import WaveformTargetGroup, WaveformMisfitTarget, WaveformMisfitConfig # noqa
from .satellite import SatelliteTargetGroup, SatelliteMisfitTarget, SatelliteMisfitConfig # noqa
from .base import TargetAnalysisResult # noqa
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