コード例 #1
0
def plot_synth():
    # Load synthetic data
    data = numpy.loadtxt('data.txt', unpack=True)
    x, y, z = data[0:3]
    tensor = data[-3:]
    with open('model.pickle') as f:
        model = pickle.load(f)
    for comp in tensor:
        shape = (51, 51)
        pyplot.figure(figsize=(5, 4))
        pyplot.axis('scaled')
        levels = vis.contourf(y * 0.001, x * 0.001, comp, shape, 8)
        vis.contour(y * 0.001, x * 0.001, comp, shape, levels)
        pyplot.xlabel('Horizontal coordinate y (km)')
        pyplot.ylabel('Horizontal coordinate x (km)')
    pyplot.show()

    extent = [0, 5000, 0, 5000, 0, 1500]
    vis.mayavi_figure()
    vis.prisms3D(model, extract('density', model))
    vis.add_axes3d(vis.add_outline3d(extent),
                   ranges=[i * 0.001 for i in extent],
                   fmt='%.1f',
                   nlabels=6)
    vis.wall_bottom(extent)
    vis.wall_north(extent)
    vis.mlab.show()
コード例 #2
0
def plot_result():
    data = numpy.loadtxt("data.txt", unpack=True)
    x, y, z, topo = data[0:4]
    tensor = data[-3:]

    # Load the inversion results
    with open(sys.argv[1]) as f:
        results = pickle.load(f)
    predicted = results["predicted"]

    shape = (60, 100)
    for true, pred in zip(tensor, predicted):
        pyplot.figure()
        pyplot.axis("scaled")
        levels = vis.contourf(y * 0.001, x * 0.001, true, shape, 12, interpolate=True)
        pyplot.colorbar()
        vis.contour(y * 0.001, x * 0.001, pred, shape, levels, color="k", interpolate=True)
        pyplot.xlabel("Horizontal coordinate y (km)")
        pyplot.ylabel("Horizontal coordinate x (km)")
    pyplot.show()

    extent = [x.min(), x.max(), y.min(), y.max(), -topo.max(), -400]
    # density_model = vfilter(900, 1200, 'density', results['mesh'])
    seeds = [results["mesh"][s] for s in results["seeds"]]

    vis.mayavi_figure()
    vis.prisms3D(seeds, extract("density", seeds), vmin=0)
    # vis.prisms3D(density_model, extract('density', density_model), vmin=0)
    vis.prisms3D(results["mesh"], results["mesh"].props["density"], vmin=0)
    vis.add_axes3d(vis.add_outline3d(extent), ranges=[i * 0.001 for i in extent], fmt="%.1f", nlabels=6)
    vis.wall_bottom(extent)
    vis.wall_north(extent)
    vis.mlab.show()
コード例 #3
0
def plot_synth():
    # Load synthetic data
    data = numpy.loadtxt('data.txt', unpack=True)
    x, y, z = data[0:3]
    tensor = data[3:]
    with open('model.pickle') as f:
        model = pickle.load(f)
    for comp in tensor:
        shape = (26, 26)
        pyplot.figure(figsize=(5,4))
        pyplot.axis('scaled')
        levels = vis.contourf(y*0.001, x*0.001, comp, shape, 8)
        vis.contour(y*0.001, x*0.001, comp, shape, levels)
        pyplot.xlabel('Horizontal coordinate y (km)')
        pyplot.ylabel('Horizontal coordinate x (km)')
    pyplot.show()
    
    extent = [0, 5000, 0, 5000, 0, 1000]    
    vis.mayavi_figure()
    vis.prisms3D(model, extract('density', model))
    vis.add_axes3d(vis.add_outline3d(extent), ranges=[i*0.001 for i in extent],
        fmt='%.1f', nlabels=6)
    vis.wall_bottom(extent)
    vis.wall_north(extent)
    vis.mlab.show()
コード例 #4
0
def plot_data():
    data = numpy.loadtxt('data.txt', unpack=True)
    predicted = numpy.loadtxt('predicted.txt', unpack=True, usecols=[3, 4, 5])
    xs, ys = numpy.loadtxt('seeds.txt', unpack=True, usecols=[0, 1])
    x, y, z = data[0:3]
    tensor = data[-3:]
    shape = (60, 100)
    for comp, pred in zip(tensor, predicted):
        pyplot.figure(figsize=(4, 4))
        pyplot.subplots_adjust(bottom=0.2)
        pyplot.axis('scaled')
        levels = vis.contourf(y * 0.001,
                              x * 0.001,
                              comp,
                              shape,
                              8,
                              interpolate=True)
        pyplot.colorbar()
        vis.contour(y * 0.001,
                    x * 0.001,
                    pred,
                    shape,
                    levels,
                    interpolate=True)
        pyplot.plot(ys * 0.001, xs * 0.001, '.w')
        pyplot.xlabel('Horizontal coordinate y (km)')
        pyplot.ylabel('Horizontal coordinate x (km)')
    pyplot.show()
コード例 #5
0
def plot_result():
    data = numpy.loadtxt('data.txt', unpack=True)
    x, y, z, topo = data[0:4]
    tensor = data[-3:]

    # Load the inversion results
    with open(sys.argv[1]) as f:
        results = pickle.load(f)
    predicted = results['predicted']

    shape = (60, 100)
    for true, pred in zip(tensor, predicted):
        pyplot.figure()
        pyplot.axis('scaled')
        levels = vis.contourf(y * 0.001,
                              x * 0.001,
                              true,
                              shape,
                              12,
                              interpolate=True)
        pyplot.colorbar()
        vis.contour(y * 0.001,
                    x * 0.001,
                    pred,
                    shape,
                    levels,
                    color='k',
                    interpolate=True)
        pyplot.xlabel('Horizontal coordinate y (km)')
        pyplot.ylabel('Horizontal coordinate x (km)')
    pyplot.show()

    extent = [x.min(), x.max(), y.min(), y.max(), -topo.max(), -400]
    #density_model = vfilter(900, 1200, 'density', results['mesh'])
    seeds = [results['mesh'][s] for s in results['seeds']]

    vis.mayavi_figure()
    vis.prisms3D(seeds, extract('density', seeds), vmin=0)
    #vis.prisms3D(density_model, extract('density', density_model), vmin=0)
    vis.prisms3D(results['mesh'], results['mesh'].props['density'], vmin=0)
    vis.add_axes3d(vis.add_outline3d(extent),
                   ranges=[i * 0.001 for i in extent],
                   fmt='%.1f',
                   nlabels=6)
    vis.wall_bottom(extent)
    vis.wall_north(extent)
    vis.mlab.show()
コード例 #6
0
def plot_result():
    # Load synthetic data
    data = numpy.loadtxt('data.txt', unpack=True)
    x, y, z = data[0:3]
    tensor = data[3:]
    with open('model.pickle') as f:
        model = pickle.load(f)

    # Load the inversion results
    with open(sys.argv[1]) as f:
        results = pickle.load(f)
    predicted = results['predicted']

    shape = (26, 26)
    names = ['gxx', 'gxy', 'gxz', 'gyy', 'gyz', 'gzz']
    i = 0
    for true, pred in zip(tensor, predicted):
        pyplot.figure(figsize=(3.33, 4))
        pyplot.axis('scaled')
        levels = vis.contourf(y * 0.001, x * 0.001, true, shape, 8)
        cb = pyplot.colorbar(orientation='horizontal', shrink=0.95)
        cb.set_ticks([l for j, l in enumerate(levels) if j % 2 != 0])
        vis.contour(y * 0.001, x * 0.001, pred, shape, levels, color='k')
        pyplot.xlabel('Horizontal coordinate y (km)')
        pyplot.ylabel('Horizontal coordinate x (km)')
        pyplot.savefig('.'.join([names[i], 'pdf']))
        i += 1
    pyplot.show()

    extent = [0, 5000, 0, 5000, 0, 1000]
    density_model = vfilter(-2000, -1, 'density', results['mesh'])
    density_model.extend(vfilter(1, 2000, 'density', results['mesh']))
    seeds = [results['mesh'][s] for s in results['seeds']]

    vis.mayavi_figure()
    vis.prisms3D(model, extract('density', model), style='wireframe')
    vis.prisms3D(seeds, extract('density', seeds))
    vis.prisms3D(density_model, extract('density', density_model))
    vis.add_axes3d(vis.add_outline3d(extent),
                   ranges=[i * 0.001 for i in extent],
                   fmt='%.1f',
                   nlabels=3)
    vis.wall_bottom(extent)
    vis.wall_north(extent)
    vis.mlab.show()
コード例 #7
0
def plot_data():
    data = numpy.loadtxt("data.txt", unpack=True)
    predicted = numpy.loadtxt("predicted.txt", unpack=True, usecols=[3, 4, 5])
    xs, ys = numpy.loadtxt("seeds.txt", unpack=True, usecols=[0, 1])
    x, y, z = data[0:3]
    tensor = data[-3:]
    shape = (60, 100)
    for comp, pred in zip(tensor, predicted):
        pyplot.figure(figsize=(4, 4))
        pyplot.subplots_adjust(bottom=0.2)
        pyplot.axis("scaled")
        levels = vis.contourf(y * 0.001, x * 0.001, comp, shape, 8, interpolate=True)
        pyplot.colorbar()
        vis.contour(y * 0.001, x * 0.001, pred, shape, levels, interpolate=True)
        pyplot.plot(ys * 0.001, xs * 0.001, ".w")
        pyplot.xlabel("Horizontal coordinate y (km)")
        pyplot.ylabel("Horizontal coordinate x (km)")
    pyplot.show()
コード例 #8
0
def plot_result():
    # Load synthetic data
    data = numpy.loadtxt('data.txt', unpack=True)
    x, y, z = data[0:3]
    tensor = data[3:]
    with open('model.pickle') as f:
        model = pickle.load(f)

    # Load the inversion results
    with open(sys.argv[1]) as f:
        results = pickle.load(f)
    predicted = results['predicted']

    shape = (26, 26)
    names = ['gxx', 'gxy', 'gxz', 'gyy', 'gyz', 'gzz']
    i = 0
    for true, pred in zip(tensor, predicted):
        pyplot.figure(figsize=(3.33,4))
        pyplot.axis('scaled')
        levels = vis.contourf(y*0.001, x*0.001, true, shape, 8)
        cb = pyplot.colorbar(orientation='horizontal', shrink=0.95)
        cb.set_ticks([l for j, l in enumerate(levels) if j%2 != 0])
        vis.contour(y*0.001, x*0.001, pred, shape, levels, color='k')
        pyplot.xlabel('Horizontal coordinate y (km)')
        pyplot.ylabel('Horizontal coordinate x (km)')
        pyplot.savefig('.'.join([names[i], 'pdf']))
        i += 1
    pyplot.show()

    extent = [0, 5000, 0, 5000, 0, 1000]
    density_model = vfilter(-2000, -1, 'density', results['mesh'])
    density_model.extend(vfilter(1, 2000, 'density', results['mesh']))
    seeds = [results['mesh'][s] for s in results['seeds']]

    vis.mayavi_figure()
    vis.prisms3D(model, extract('density', model), style='wireframe')
    vis.prisms3D(seeds, extract('density', seeds))
    vis.prisms3D(density_model, extract('density', density_model))
    vis.add_axes3d(vis.add_outline3d(extent), ranges=[i*0.001 for i in extent],
        fmt='%.1f', nlabels=3)
    vis.wall_bottom(extent)
    vis.wall_north(extent)
    vis.mlab.show()
コード例 #9
0
def plot_result():
    # Load synthetic data
    data = numpy.loadtxt('data.txt', unpack=True)
    x, y, z = data[0:3]
    tensor = data[-3:]
    with open('model.pickle') as f:
        model = pickle.load(f)

    # Load the inversion results
    with open(sys.argv[1]) as f:
        results = pickle.load(f)
    predicted = results['predicted']

    shape = (51, 51)
    for true, pred in zip(tensor, predicted):
        pyplot.figure(figsize=(5, 4))
        pyplot.axis('scaled')
        levels = vis.contourf(y * 0.001, x * 0.001, true, shape, 8)
        pyplot.colorbar()
        vis.contour(y * 0.001, x * 0.001, pred, shape, levels, color='k')
        pyplot.xlabel('Horizontal coordinate y (km)')
        pyplot.ylabel('Horizontal coordinate x (km)')
    pyplot.show()

    extent = [0, 5000, 0, 5000, 0, 1500]
    density_model = vfilter(1100, 1200, 'density', results['mesh'])
    seeds = [results['mesh'][s] for s in results['seeds']]

    vis.mayavi_figure()
    vis.prisms3D(model, extract('density', model), style='wireframe')
    vis.prisms3D(seeds, extract('density', seeds), vmin=0)
    vis.prisms3D(density_model, extract('density', density_model), vmin=0)
    vis.add_axes3d(vis.add_outline3d(extent),
                   ranges=[i * 0.001 for i in extent],
                   fmt='%.1f',
                   nlabels=6)
    vis.wall_bottom(extent)
    vis.wall_north(extent)
    vis.mlab.show()
コード例 #10
0
def plot_result():
    # Load synthetic data
    data = numpy.loadtxt('data.txt', unpack=True)
    x, y, z = data[0:3]
    tensor = data[-3:]
    with open('model.pickle') as f:
        model = pickle.load(f)

    # Load the inversion results
    with open(sys.argv[1]) as f:
        results = pickle.load(f)
    predicted = results['predicted']

    shape = (51, 51)
    for true, pred in zip(tensor, predicted):
        pyplot.figure(figsize=(5,4))
        pyplot.axis('scaled')
        levels = vis.contourf(y*0.001, x*0.001, true, shape, 8)
        pyplot.colorbar()
        vis.contour(y*0.001, x*0.001, pred, shape, levels, color='k')
        pyplot.xlabel('Horizontal coordinate y (km)')
        pyplot.ylabel('Horizontal coordinate x (km)')
    pyplot.show()

    extent = [0, 5000, 0, 5000, 0, 1500]
    density_model = vfilter(1100, 1200, 'density', results['mesh'])
    seeds = [results['mesh'][s] for s in results['seeds']]

    vis.mayavi_figure()
    vis.prisms3D(model, extract('density', model), style='wireframe')
    vis.prisms3D(seeds, extract('density', seeds), vmin=0)
    vis.prisms3D(density_model, extract('density', density_model), vmin=0)
    vis.add_axes3d(vis.add_outline3d(extent), ranges=[i*0.001 for i in extent],
        fmt='%.1f', nlabels=6)
    vis.wall_bottom(extent)
    vis.wall_north(extent)
    vis.mlab.show()
コード例 #11
0
        #pylab.savefig("adjustment_%s.pdf" % (field))

pylab.legend(loc='lower left', prop={'size':9}, shadow=True)
#pylab.savefig("comparison_raw.pdf")

pylab.figure(figsize=(16,8))
pylab.subplots_adjust(wspace=0.4, hspace=0.3)

for i, field in enumerate(['gxx', 'gxy', 'gxz', 'gyy', 'gyz', 'gzz']):

    if field in data:

        pylab.subplot(2, 3, i + 1)
        pylab.title(field)
        pylab.axis('scaled')
        levels = vis.contourf(data[field], 10)
        vis.contourf(adjusted[field], levels)
        cb = pylab.colorbar(shrink=0.9)
        cb.set_label(r'$E\"otv\"os$', fontsize=14)
        pylab.xlabel('X [m]')
        pylab.ylabel('Y [m]')

#pylab.savefig("adjusted_raw.pdf")

pylab.figure(figsize=(16,8))
pylab.subplots_adjust(wspace=0.4, hspace=0.3)

for i, field in enumerate(['gxx', 'gxy', 'gxz', 'gyy', 'gyz', 'gzz']):

    if field in data:
コード例 #12
0
                                 x1=0,
                                 x2=5000,
                                 y1=0,
                                 y2=5000,
                                 nx=50,
                                 ny=50,
                                 height=150,
                                 field=field)

    data['value'], error = utils.contaminate(data['value'],
                                             stddev=error,
                                             percent=False,
                                             return_stddev=True)

    data['error'] = error * numpy.ones(len(data['value']))

    io.dump('%s_data.txt' % (field), data)

    pylab.subplot(2, 3, i + 1)
    pylab.axis('scaled')
    pylab.title(field)
    vis.contourf(data, 10)
    vis.contourf(data, 10)
    cb = pylab.colorbar(shrink=0.9)
    cb.set_label(r'$E\"otv\"os$', fontsize=14)
    pylab.xlabel('X [m]')
    pylab.ylabel('Y [m]')

pylab.savefig("data_ftg_raw.pdf")

pylab.show()
コード例 #13
0
ファイル: run_synthetic.py プロジェクト: leouieda/seg2011
                                        nx=25, ny=25, height=150, field=field)
    data[field]['value'], error = utils.contaminate(data[field]['value'],
                                                    stddev=error,
                                                    percent=False,
                                                    return_stddev=True)
    data[field]['error'] = error*numpy.ones(len(data[field]['value']))
    io.dump('%s.txt' % (field), data[field])

# Plot the data
pylab.figure()
pylab.suptitle(r'Synthetic FTG data with %g $E\"otv\"os$ noise' % (error))
for i, field in enumerate(fields):
    pylab.subplot(1, 3, i + 1)
    pylab.axis('scaled')
    pylab.title(field)
    vis.contourf(data[field], 10, xkey='y', ykey='x', nx=31, ny=31)
    cb = pylab.colorbar()
    cb.set_label(r'$E\"otv\"os$')
    pylab.xlabel("Easting [m]")
    pylab.ylabel("Northing [m]")
pylab.savefig("data_raw.pdf")

# RUN THE INVERSION
################################################################################
# Generate a model space mesh
x1, x2 = 0, 5000
y1, y2 = 0, 5000
z1, z2 = 0, 1500
mesh = fatiando.mesh.prism_mesh(x1=x1, x2=x2, y1=y1, y2=y2, z1=z1, z2=z2, 
                                nx=50, ny=50, nz=15)
コード例 #14
0
ファイル: plotres.py プロジェクト: cloudroid/sbgf2011
contour2y = 0.001*numpy.array(contour2y)
seed1x = 0.001*seed1x
seed1y = 0.001*seed1y
seed2x = 0.001*seed2x
seed2y = 0.001*seed2y
data['x'] = 0.001*data['x']
data['y'] = 0.001*data['y']
adjusted['x'] = 0.001*adjusted['x']
adjusted['y'] = 0.001*adjusted['y']

matplotlib.rcParams['contour.negative_linestyle'] = 'solid'

# Plot the data
pylab.figure()
pylab.axis('scaled')
vis.contourf(data, levels=15, xkey='y', ykey='x', nx=25, ny=50)
cb = pylab.colorbar()
cb.set_label("mGal")
pylab.plot(contour1y, contour1x, '-k', linewidth=2)
pylab.plot(contour2y, contour2x, '-k', linewidth=2)
size = 4
alpha = 1
pylab.plot(seed1y, seed1x, 'ob', markersize=size, alpha=alpha)
pylab.plot(seed2y, seed2x, 'or', markersize=size, alpha=alpha)
#cb = pylab.colorbar()
#cb.set_label('mGal')
pylab.xlabel("Easting (km)")
pylab.ylabel("Northing (km)")
#pylab.savefig("data_raw.pdf")

# Make a mesh for the seeds to plot them
コード例 #15
0
ファイル: plotres.py プロジェクト: whigg/sbgf2011
contour2y = 0.001 * numpy.array(contour2y)
seed1x = 0.001 * seed1x
seed1y = 0.001 * seed1y
seed2x = 0.001 * seed2x
seed2y = 0.001 * seed2y
data['x'] = 0.001 * data['x']
data['y'] = 0.001 * data['y']
adjusted['x'] = 0.001 * adjusted['x']
adjusted['y'] = 0.001 * adjusted['y']

matplotlib.rcParams['contour.negative_linestyle'] = 'solid'

# Plot the data
pylab.figure()
pylab.axis('scaled')
vis.contourf(data, levels=15, xkey='y', ykey='x', nx=25, ny=50)
cb = pylab.colorbar()
cb.set_label("mGal")
pylab.plot(contour1y, contour1x, '-k', linewidth=2)
pylab.plot(contour2y, contour2x, '-k', linewidth=2)
size = 4
alpha = 1
pylab.plot(seed1y, seed1x, 'ob', markersize=size, alpha=alpha)
pylab.plot(seed2y, seed2x, 'or', markersize=size, alpha=alpha)
#cb = pylab.colorbar()
#cb.set_label('mGal')
pylab.xlabel("Easting (km)")
pylab.ylabel("Northing (km)")
#pylab.savefig("data_raw.pdf")

# Make a mesh for the seeds to plot them
コード例 #16
0
import cPickle as pickle
import numpy
from fatiando import vis
from fatiando.mesher.volume import extract, vfilter
pyplot = vis.pyplot

# Load the inversion results
name = sys.argv[1].split('.')[0]
with open(sys.argv[1]) as f:
    results = pickle.load(f)
predicted = results['predicted']

# Load synthetic data
data = numpy.loadtxt(sys.argv[2], unpack=True)
x, y, z = data[0:3]
tensor = data[3:]

fdir = 'figs'

shape = (51, 51)
pyplot.figure(figsize=(3.33,4))
pyplot.axis('scaled')
levels = vis.contourf(y*0.001, x*0.001, tensor[-1], shape, 6)
pyplot.colorbar(orientation='horizontal', shrink=0.8)
vis.contour(y*0.001, x*0.001, predicted[-1], shape, levels, color='k',
    style='dashed', linewidth=1.0)
pyplot.xlabel('Horizontal coordinate y (km)')
pyplot.ylabel('Horizontal coordinate x (km)')
pyplot.savefig('.'.join([name, 'pdf']))
#pyplot.show()
コード例 #17
0
pylab.figure(figsize=(15,10))
pylab.subplots_adjust(hspace=0.4, wspace=0.3)
levels = 12
angle = 40
nx, ny = 40, 60

for i, field in enumerate(['gxx', 'gxy', 'gxz', 'gyy', 'gyz', 'gzz']):

    data = io.load('%s.txt' % (field))

    ax = pylab.subplot(2, 3, i + 1)
    pylab.title(field)
    pylab.axis('scaled')
    #pylab.plot(data['x'], data['y'], '.k')
    vis.contourf(data, levels, nx=nx, ny=ny)
    vis.contourf(data, levels, nx=nx, ny=ny)
    cb = pylab.colorbar()
    cb.set_label(r'$E\"otv\"os$', fontsize=14)
    labels = ax.get_xticklabels()
    for label in labels:
        label.set_rotation(angle)
    pylab.xlabel('Northing [m]')
    pylab.ylabel('Easting [m]')

pylab.savefig("ftg_data_raw.pdf")

datatopo = io.load_topo('topo.txt')

pylab.figure(figsize=(8,10))
pylab.title("Topography [m]")
コード例 #18
0
pylab.suptitle(r'Synthetic FTG data with %g $E\"otv\"os$ noise' 
               % (error), fontsize=16)
pylab.subplots_adjust(wspace=0.4, hspace=0.3)

for i, field in enumerate(['gxx', 'gxy', 'gxz', 'gyy', 'gyz', 'gzz']):

    data = synthetic.from_prisms(prisms, x1=0, x2=5000, y1=0, y2=5000,
                                 nx=50, ny=50, height=150, field=field)
    
    data['value'], error = utils.contaminate(data['value'], 
                                             stddev=error, 
                                             percent=False, 
                                             return_stddev=True)
    
    data['error'] = error*numpy.ones(len(data['value']))

    io.dump('%s_data.txt' % (field), data)

    pylab.subplot(2, 3, i + 1)
    pylab.axis('scaled')
    pylab.title(field)
    vis.contourf(data, 10)
    vis.contourf(data, 10)
    cb = pylab.colorbar(shrink=0.9)
    cb.set_label(r'$E\"otv\"os$', fontsize=14)
    pylab.xlabel('X [m]')
    pylab.ylabel('Y [m]')

pylab.savefig("data_ftg_raw.pdf")

pylab.show()
コード例 #19
0
ファイル: plant.py プロジェクト: whigg/eage2011
spoints.append((11000, 16900, -900))
sdens.append(-400)
spoints.append((11920, 16070, -950))
sdens.append(-400)
spoints.append((11670, 15225, -900))
sdens.append(-400)

seeds = [gplant.get_seed(p, dens, mesh) for p, dens in zip(spoints, sdens)]

# Make a mesh for the seeds to plot them
seed_mesh = numpy.array([seed['cell'] for seed in seeds])

# Show the seeds before starting
pylab.figure()
pylab.axis('scaled')
l = vis.contourf(data['gzz'], 10, nx=40, ny=60)
vis.contour(data['gzz'], l, nx=40, ny=60)
for p in spoints:
    pylab.plot(p[0], p[1], '*k', markersize=9)
labels = pylab.gca().get_xticklabels()
for label in labels:
    label.set_rotation(30)
pylab.savefig('seeds.pdf')
pylab.xlabel('Northing [m]')
pylab.ylabel('Easting [m]')

pylab.show()

fig = mlab.figure()
fig.scene.background = (1, 1, 1)
fig.scene.camera.yaw(230)
コード例 #20
0
ファイル: plot_data.py プロジェクト: whigg/eage2011
pylab.figure(figsize=(15, 10))
pylab.subplots_adjust(hspace=0.4, wspace=0.3)
levels = 12
angle = 40
nx, ny = 40, 60

for i, field in enumerate(['gxx', 'gxy', 'gxz', 'gyy', 'gyz', 'gzz']):

    data = io.load('%s.txt' % (field))

    ax = pylab.subplot(2, 3, i + 1)
    pylab.title(field)
    pylab.axis('scaled')
    #pylab.plot(data['x'], data['y'], '.k')
    vis.contourf(data, levels, nx=nx, ny=ny)
    vis.contourf(data, levels, nx=nx, ny=ny)
    cb = pylab.colorbar()
    cb.set_label(r'$E\"otv\"os$', fontsize=14)
    labels = ax.get_xticklabels()
    for label in labels:
        label.set_rotation(angle)
    pylab.xlabel('Northing [m]')
    pylab.ylabel('Easting [m]')

pylab.savefig("ftg_data_raw.pdf")

datatopo = io.load_topo('topo.txt')

pylab.figure(figsize=(8, 10))
pylab.title("Topography [m]")
コード例 #21
0
spoints.append((11000, 16900, -900))
sdens.append(-400)
spoints.append((11920, 16070, -950))
sdens.append(-400)
spoints.append((11670, 15225, -900))
sdens.append(-400)

seeds = [gplant.get_seed(p, dens, mesh) for p, dens in zip(spoints, sdens)]

# Make a mesh for the seeds to plot them
seed_mesh = numpy.array([seed['cell'] for seed in seeds])

# Show the seeds before starting
pylab.figure()
pylab.axis('scaled')
l = vis.contourf(data['gzz'], 10, nx=40, ny=60)
vis.contour(data['gzz'], l, nx=40, ny=60)
for p in spoints:
    pylab.plot(p[0], p[1], '*k', markersize=9)
labels = pylab.gca().get_xticklabels()
for label in labels:
    label.set_rotation(30)
pylab.savefig('seeds.pdf')
pylab.xlabel('Northing [m]')
pylab.ylabel('Easting [m]')

pylab.show()

fig = mlab.figure()
fig.scene.background = (1, 1, 1)
fig.scene.camera.yaw(230)
コード例 #22
0
ファイル: plotfit.py プロジェクト: whigg/sbgf2011
def xy2ne(g):
    g['x'], g['y'] = g['y'], g['x']
    return g

xy2ne(data)
xy2ne(adj)
    
pylab.figure()
pylab.axis('scaled')
levels = vis.contour(data, levels=8, color='b', label="Observed")
vis.contour(adj, levels=levels, color='r', label="Predicted")
pylab.xlabel("E (km)")
pylab.ylabel("N (km)")

pylab.figure()
pylab.axis('scaled')
levels = vis.contourf(data, levels=8)
vis.contour(data, levels=levels, color='k')
pylab.xlabel("E (km)")
pylab.ylabel("N (km)")

pylab.figure()
pylab.axis('scaled')
levels = vis.contourf(adj, levels=8)
vis.contour(adj, levels=levels, color='k')
pylab.xlabel("E (km)")
pylab.ylabel("N (km)")

pylab.show()
コード例 #23
0
ファイル: run_synthetic.py プロジェクト: whigg/seg2011
                                        field=field)
    data[field]['value'], error = utils.contaminate(data[field]['value'],
                                                    stddev=error,
                                                    percent=False,
                                                    return_stddev=True)
    data[field]['error'] = error * numpy.ones(len(data[field]['value']))
    io.dump('%s.txt' % (field), data[field])

# Plot the data
pylab.figure()
pylab.suptitle(r'Synthetic FTG data with %g $E\"otv\"os$ noise' % (error))
for i, field in enumerate(fields):
    pylab.subplot(1, 3, i + 1)
    pylab.axis('scaled')
    pylab.title(field)
    vis.contourf(data[field], 10, xkey='y', ykey='x', nx=31, ny=31)
    cb = pylab.colorbar()
    cb.set_label(r'$E\"otv\"os$')
    pylab.xlabel("Easting [m]")
    pylab.ylabel("Northing [m]")
pylab.savefig("data_raw.pdf")

# RUN THE INVERSION
################################################################################
# Generate a model space mesh
x1, x2 = 0, 5000
y1, y2 = 0, 5000
z1, z2 = 0, 1500
mesh = fatiando.mesh.prism_mesh(x1=x1,
                                x2=x2,
                                y1=y1,
コード例 #24
0
        #pylab.savefig("adjustment_%s.pdf" % (field))

pylab.legend(loc='lower left', prop={'size': 9}, shadow=True)
#pylab.savefig("comparison_raw.pdf")

pylab.figure(figsize=(16, 8))
pylab.subplots_adjust(wspace=0.4, hspace=0.3)

for i, field in enumerate(['gxx', 'gxy', 'gxz', 'gyy', 'gyz', 'gzz']):

    if field in data:

        pylab.subplot(2, 3, i + 1)
        pylab.title(field)
        pylab.axis('scaled')
        levels = vis.contourf(data[field], 10)
        vis.contourf(adjusted[field], levels)
        cb = pylab.colorbar(shrink=0.9)
        cb.set_label(r'$E\"otv\"os$', fontsize=14)
        pylab.xlabel('X [m]')
        pylab.ylabel('Y [m]')

#pylab.savefig("adjusted_raw.pdf")

pylab.figure(figsize=(16, 8))
pylab.subplots_adjust(wspace=0.4, hspace=0.3)

for i, field in enumerate(['gxx', 'gxy', 'gxz', 'gyy', 'gyz', 'gzz']):

    if field in data:
コード例 #25
0
seedpoints.append(((2001, 2751, 301), 1500))
seedpoints.append(((2501, 2751, 301), 1500))
seedpoints.append(((3001, 2751, 301), 1500))
seedpoints.append(((3501, 2751, 301), 1500))
seedpoints.append(((4001, 2751, 301), 1500))

seeds = [gplant.get_seed(point, dens, mesh) for point, dens in seedpoints]

# Make a mesh for the seeds to plot them
seed_mesh = numpy.array([seed['cell'] for seed in seeds])

# Plot the seeds ontop of the data
pylab.figure()
#pylab.title()
pylab.axis('scaled')
vis.contourf(data['gzz'], 10)
cb = pylab.colorbar()
cb.set_label(r'$E\"otv\"os$', fontsize=14)
xs = []
ys = []
for p, dens in seedpoints:
    xs.append(p[0])
    ys.append(p[1])
pylab.plot(xs, ys, '*k', markersize=9, label='Seeds')
pylab.xlabel('X [m]')
pylab.ylabel('Y [m]')
pylab.legend(shadow=True, loc='lower right')
pylab.savefig('seeds_raw.pdf')

#pylab.show()