Commit cb04b480 authored by Sebastian Heimann's avatar Sebastian Heimann
Browse files

removed map-geometry subcommand

parent 0f2d334c
......@@ -28,7 +28,6 @@ subcommand_descriptions = {
'go': 'run Grond optimization',
'forward': 'run forward modelling',
'harvest': 'manually run harvesting',
'map-geometry': 'make station map',
'plot': 'plot optimization result',
'export': 'export results',
}
......@@ -39,7 +38,6 @@ subcommand_usages = {
'go': 'go <configfile> [options]',
'forward': 'forward <rundir> [options]',
'harvest': 'harvest <rundir> [options]',
'map-geometry': 'map-geometry <configfile> [options]',
'plot': 'plot <plotnames> <rundir> [options]',
'export': 'export (best|mean|ensemble|stats) <rundirs> ... [options]',
}
......@@ -60,7 +58,6 @@ Subcommands:
go %(go)s
forward %(forward)s
harvest %(harvest)s
map-geometry %(map_geometry)s
plot %(plot)s
export %(export)s
......@@ -278,19 +275,6 @@ def command_harvest(args):
weed=options.weed)
def command_map_geometry(args):
from grond import plot
parser, options, args = cl_parse('map-geometry', args)
if len(args) != 2:
help_and_die(parser, 'two arguments required')
config_path = args[0]
output_path = args[1]
config = grond.read_config(config_path)
plot.map_geometry(config, output_path)
def command_plot(args):
from grond import plot
......
......@@ -6,7 +6,7 @@ import os
import os.path as op
import numpy as num
from scipy import signal
from pyrocko import automap, beachball, guts, trace, util
from pyrocko import beachball, guts, trace, util
from pyrocko import hudson
from grond import core
from matplotlib import pyplot as plt
......@@ -84,50 +84,6 @@ def eigh_sorted(mat):
return evals[iorder], evecs[:, iorder]
def plot(stations, center_lat, center_lon, radius, output_path,
width=25., height=25.,
show_station_labels=False):
station_lats = num.array([s.lat for s in stations])
station_lons = num.array([s.lon for s in stations])
map = automap.Map(
width=width,
height=height,
lat=center_lat,
lon=center_lon,
radius=radius,
show_rivers=False,
show_topo=False,
illuminate_factor_land=0.35,
color_dry=(240, 240, 235),
topo_cpt_wet='white_sea_land',
topo_cpt_dry='white_sea_land')
map.gmt.psxy(
in_columns=(station_lons, station_lats),
S='t8p',
G='black',
*map.jxyr)
if show_station_labels:
for s in stations:
map.add_label(s.lat, s.lon, '%s' % s.station)
map.save(output_path)
def map_geometry(config, output_path):
stations = config.get_dataset().get_stations()
lat0, lon0, radius = core.stations_mean_latlondist(stations)
radius *= 1.5
plot(stations, lat0, lon0, radius, output_path,
show_station_labels=True)
class GrondModel(object):
def __init__(self, **kwargs):
self.listeners = []
......
Supports Markdown
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