|
|
@ -13,7 +13,7 @@ logger = logging.getLogger('main') |
|
|
|
|
|
|
|
def d2u(d): |
|
|
|
if isinstance(d, dict): |
|
|
|
return dict((k.replace('-', '_'), v) for (k, v) in d.iteritems()) |
|
|
|
return dict((k.replace('-', '_'), v) for (k, v) in d.items()) |
|
|
|
else: |
|
|
|
return d.replace('-', '_') |
|
|
|
|
|
|
@ -21,7 +21,7 @@ def d2u(d): |
|
|
|
def str_to_time(s): |
|
|
|
try: |
|
|
|
return util.str_to_time(s) |
|
|
|
except util.TimeStrError, e: |
|
|
|
except util.TimeStrError as e: |
|
|
|
raise lassie.LassieError(str(e)) |
|
|
|
|
|
|
|
|
|
|
@ -83,7 +83,7 @@ def cl_parse(command, args, setup=None): |
|
|
|
usage = subcommand_usages[command] |
|
|
|
descr = subcommand_descriptions[command] |
|
|
|
|
|
|
|
if isinstance(usage, basestring): |
|
|
|
if isinstance(usage, str): |
|
|
|
usage = [usage] |
|
|
|
|
|
|
|
susage = '%s %s' % (program_name, usage[0]) |
|
|
@ -147,7 +147,7 @@ def command_init(args): |
|
|
|
else: |
|
|
|
stations_path = 'STATIONS_PATH' |
|
|
|
|
|
|
|
print '''%%YAML 1.1 |
|
|
|
print('''%%YAML 1.1 |
|
|
|
--- !lassie.Config |
|
|
|
|
|
|
|
## Configuration file for Lassie, your friendly earthquake detector |
|
|
@ -242,7 +242,7 @@ detector_threshold: 150. |
|
|
|
## directory |
|
|
|
save_figures: true |
|
|
|
|
|
|
|
## Mapping of phase ID to phase definition in cake syntax (used e.g. in the |
|
|
|
## Mapping of phase ID to phase definition in cake syntax (used e.g. in the |
|
|
|
## CakePhaseShifter config sections) |
|
|
|
tabulated_phases: |
|
|
|
- !pf.TPDef |
|
|
@ -252,7 +252,7 @@ tabulated_phases: |
|
|
|
id: 's' |
|
|
|
definition: 'S,s' |
|
|
|
|
|
|
|
## Mapping of earthmodel ID to the actual earth model in nd format (used in |
|
|
|
## Mapping of earthmodel ID to the actual earth model in nd format (used in |
|
|
|
## the CakePhaseShifter config sections) |
|
|
|
earthmodels: |
|
|
|
- !lassie.CakeEarthmodel |
|
|
@ -280,7 +280,7 @@ earthmodels: |
|
|
|
120.0 8.15 4.57 3.3 |
|
|
|
''' % dict( |
|
|
|
stations_path=stations_path, |
|
|
|
s_data_paths=s_data_paths) |
|
|
|
s_data_paths=s_data_paths)) |
|
|
|
|
|
|
|
|
|
|
|
def command_search(args): |
|
|
@ -356,7 +356,7 @@ def command_search(args): |
|
|
|
nparallel=nparallel, |
|
|
|
bark=options.bark) |
|
|
|
|
|
|
|
except lassie.LassieError, e: |
|
|
|
except lassie.LassieError as e: |
|
|
|
die(str(e)) |
|
|
|
|
|
|
|
|
|
|
|