Ejemplo n.º 1
0
import pyMT.data_structures as WSDS
import pyMT.utils as utils
from scipy.interpolate import griddata
import naturalneighbor as nn
import matplotlib.pyplot as plt
import numpy as np
import e_colours.colourmaps as cm
from mpl_toolkits.axes_grid1 import make_axes_locatable


cmap = cm.jet_plus(64)
# listfile = r'C:\Users\eric\Documents\MATLAB\MATLAB\Inversion\Regions\dbr15\j2\allsites.lst'
# listfile = r'C:\Users\eric\Documents\MATLAB\MATLAB\Inversion\Regions\MetalEarth\j2\allbb.lst')
# datafile = r'C:\Users\eric\Documents\MATLAB\MATLAB\Inversion\Regions\MetalEarth\j2\allbb.data')
# datafile = 'C:/Users/eric/Documents/MATLAB/MATLAB/Inversion/Regions/MetalEarth/swayze/swz_cull1/swz_cull1f_Z.dat'
datafile = 'C:/Users/eric/phd/ownCloud/data/Regions/MetalEarth/j2/cull_allSuperior.data'
listfile = 'C:/Users/eric/phd/ownCloud/data/Regions/MetalEarth/j2/culled_allSuperior.lst'
data = WSDS.Data(datafile=datafile, listfile=listfile)
raw = WSDS.RawData(listfile=listfile)
raw.locations = raw.get_locs(mode='latlong')
for ii in range(len(raw.locations)):
    lon, lat = utils.project((raw.locations[ii, 1], raw.locations[ii, 0]), zone=16, letter='U')[2:]
    raw.locations[ii, 1], raw.locations[ii, 0] = lon, lat
data.locations = raw.locations
save_path = 'C:/Users/eric/phd/ownCloud/Documents/Seminars/Seminar 3/Figures/Pseudosections/culled/'
# rmsites = [site for site in data.site_names if site[0] == 'e' or site[0] == 'd']
# data.remove_sites(rmsites)
# data.sort_sites(order='west-east')
rho = {site.name: utils.compute_rho(site)[0] for site in data.sites.values()}
pha = {site.name: utils.compute_phase(site)[0] for site in data.sites.values()}
rho_lim = [0, 5]
Ejemplo n.º 2
0
new_vals = np.transpose(new_vals, [1, 0, 2])
ii = np.argmin(abs(np.array(dz[1:]) - mod.dz[1]))
new_vals[:, :, 0:ii] = np.transpose(np.tile(new_vals[:, :, ii], [ii, 1, 1]), [1, 2, 0])
# vals = interp()
if write_it:
    mod.vals = new_vals
    mod.dx, mod.dy, mod.dz = (x_mesh, y_mesh, dz)
    mod.write(model_out, file_format=file_format)
    center = mod.center
    data.locations[:, 0] -= center[0]
    data.locations[:, 1] -= center[1]
    data.write(outfile=data_out, file_format=file_format)
if plot_it:
    fig, axes = plt.subplots(nrows=1, ncols=2, sharex=True, sharey=True)
    axes[0].pcolormesh(y, x, np.log10(mod.vals[:, :, 36]),
                       cmap=cm.jet_plus(64), vmin=1, vmax=5,
                       edgecolor='k', linewidth=0.01)
    axes[0].plot(base_data.locations[:, 1], base_data.locations[:, 0], 'kv')
    axes[0].plot(data.locations[:, 1], data.locations[:, 0], 'w^')
    axes[1].pcolormesh(Y, X, np.log10(new_vals[:, :, 44]),
                       cmap=cm.jet_plus(64), vmin=1, vmax=5,
                       edgecolor='k', linewidth=0.01)
    axes[1].plot(data.locations[:, 1], data.locations[:, 0], 'kv')
    # axes[0].invert_yaxis()
    # axes[1].invert_yaxis()
    # fig2, axes2 = plt.subplots(nrows=1, ncols=2, sharex=True, sharey=True)
    # axes2[0].pcolormesh(y, x, np.log10(mod.vals[:, :, 36]),
    #                     cmap=cm.jet_plus(64), vmin=1, vmax=5)
    # axes[0].plot(base_data.locations[:, 1], base_data.locations[:, 0], 'kv')
    # axes2[0].plot(data.locations[:, 1], data.locations[:, 0], 'w^')
    # axes2[1].pcolormesh(Y, X, np.log10(new_vals[:, :, 44]),