# Read parameter file config = ConfigParser(defaults={'succession': 'native'}) with open(argv[1]) as fh: config.readfp(fh) # Kernel Parameters # TODO Estimate hyper-parameters tau = config.getfloat('Prior', 'tau') # A priori uncertainty; standard deviation ell = config.getfloat('Prior', 'ell') # Characteristic length mu = config.getfloat('Prior', 'mu') # Constant a priori velocity model # Read station coordinates station_file = config.get('Observations', 'station_file') all_stations = read_station_file(station_file) # Read pseudo data data_file = config.get('Observations', 'data') pseudo_data = np.genfromtxt(data_file, dtype=dt_obs) # Observations pairs = ListPairs(pseudo_data, all_stations) # XXX Appears a little clumsy to me if config.get('Observations', 'succession') == 'native': pass elif config.get('Observations', 'succession') == 'ascending': pairs.sort(key=lambda p: p.central_angle) elif config.get('Observations', 'succession') == 'descending': pairs.sort(key=lambda p: p.central_angle, reverse=True) elif config.get('Observations', 'succession') == 'random':
__author__ = "Stefan Mauerberger" __copyright__ = "Copyright (C) 2017 Stefan Mauerberger" __license__ = "GPLv3" ''' Save a plot of the reference velocity model ''' import numpy as np from matplotlib import pyplot as plt from gptt import dt_latlon, ListPairs, read_station_file from plotting import rcParams, prepare_map, lllat, lllon, urlat, urlon, cmap_mu from reference import c_act, dt_obs plt.rcParams.update(rcParams) # Read station coordinates all_stations = read_station_file('../dat/stations.dat') # Read pseudo data pseudo_data = np.genfromtxt('../dat/pseudo_data.dat', dtype=dt_obs) # Instantiate pairs = ListPairs(pseudo_data, all_stations) # Stations stations = pairs.stations # Prepare map fig = plt.figure() ax_map = fig.add_subplot(111) m = prepare_map(ax=ax_map) # Add axes for the colorbar bbox = ax_map.get_position() ax_cbr = fig.add_axes((bbox.x0, bbox.y0 - 0.06, bbox.width, 0.04))