Esempio n. 1
0
# Calculate all the components of the gradient tensor
error = 2

pylab.figure(figsize=(16, 8))
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)
Esempio n. 2
0
model.append({'x1':1000, 'x2':2000, 'y1':1000, 'y2':2000, 'z1':1000, 'z2':2000,
               'value':1000})
model = numpy.array(model)

x1, x2 = 0, 3000
y1, y2 = 0, 3000
z1, z2 = 0, 3000
extent = [x1, x2, y1, y2, -z2, -z1]

# Now calculate all the components of the gradient tensor and contaminate the
# data with gaussian noise
error = 0.2
fields = ['gzz', 'gyz']
data = {}
for i, field in enumerate(fields):
    data[field] = synthetic.from_prisms(model, x1=0, x2=3000, y1=0, y2=3000,
                                        nx=50, ny=50, height=150, field=field)
    data[field]['value'] = utils.contaminate(data[field]['value'],
                                                    stddev=error,
                                                    percent=False)
    data[field]['error'] = error*numpy.ones(len(data[field]['value']))

# PERFORM THE INVERSION
################################################################################
#~ # Generate a prism mesh
mesh = fatiando.mesh.prism_mesh(x1=x1, x2=x2, y1=y1, y2=y2, z1=z1, z2=z2,
                                nx=30, ny=30, nz=30)
 
# Set the seeds and save them for later use
log.info("Setting seeds in mesh:")
seeds = []
seeds.append(gplant.get_seed((1501, 1501, 1501), 1000, mesh))
Esempio n. 3
0
fig = mlab.figure()
fig.scene.background = (1, 1, 1)
plot = vis.plot_prism_mesh(model, style='surface', xy2ne=True)
axes = mlab.axes(plot, nb_labels=5, extent=extent, color=(0,0,0))
axes.label_text_property.color = (0,0,0)
axes.title_text_property.color = (0,0,0)
axes.axes.label_format = "%-#.0f"
mlab.outline(color=(0,0,0), extent=extent)
mlab.show()

# Now calculate all the components of the gradient tensor
fields = ['gyy', 'gyz', 'gzz']
error = 0.5
data = {}
for i, field in enumerate(fields):
    data[field] = synthetic.from_prisms(model, x1=0, x2=5000, y1=0, y2=5000,
                                        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)
Esempio n. 4
0
                 ranges=ranges,
                 color=(0, 0, 0))
axes.label_text_property.color = (0, 0, 0)
axes.title_text_property.color = (0, 0, 0)
axes.axes.label_format = "%-#.0f"
mlab.outline(color=(0, 0, 0), extent=extent)
mlab.show()

# Now calculate all the components of the gradient tensor
error = 0.5
data = {}
data['gz'] = synthetic.from_prisms(model,
                                   x1=0,
                                   x2=extent[3],
                                   y1=0,
                                   y2=extent[1],
                                   nx=50,
                                   ny=25,
                                   height=0,
                                   field='gz')
data['gz']['value'], error = utils.contaminate(data['gz']['value'],
                                               stddev=error,
                                               percent=False,
                                               return_stddev=True)
data['gz']['error'] = error * numpy.ones(len(data['gz']['value']))
io.dump('gz.txt', data['gz'])

# Plot the data
pylab.figure()
pylab.axis('scaled')
vis.contour(data['gz'], 8, xkey='y', ykey='x', nx=31, ny=61)
Esempio n. 5
0
# Show the model before calculating to make sure it's right
fig = mlab.figure()
fig.scene.background = (1, 1, 1)
plot = vis.plot_prism_mesh(model, style='surface', xy2ne=True)
axes = mlab.axes(plot, nb_labels=5, extent=extent, ranges=ranges, color=(0,0,0))
axes.label_text_property.color = (0,0,0)
axes.title_text_property.color = (0,0,0)
axes.axes.label_format = "%-#.0f"
mlab.outline(color=(0,0,0), extent=extent)
mlab.show()

# Now calculate all the components of the gradient tensor
error = 0.5
data = {}
data['gz'] = synthetic.from_prisms(model, x1=0, x2=extent[3], y1=0, y2=extent[1],
                                   nx=50, ny=25, height=0, field='gz')
data['gz']['value'], error = utils.contaminate(data['gz']['value'],
                                               stddev=error,
                                               percent=False,
                                               return_stddev=True)
data['gz']['error'] = error*numpy.ones(len(data['gz']['value']))
io.dump('gz.txt', data['gz'])

# Plot the data
pylab.figure()
pylab.axis('scaled')
vis.contour(data['gz'], 8, xkey='y', ykey='x', nx=31, ny=61)
#cb = pylab.colorbar()
#cb.set_label('mGal')
pylab.xlabel("Easting (m)")
pylab.ylabel("Northing (m)")
Esempio n. 6
0
# Pickle the model so that it can be shown next to the inversion result later
modelfile = open('model.pickle', 'w') 
pickle.dump(prisms, modelfile)
modelfile.close()

# Calculate all the components of the gradient tensor
error = 2

pylab.figure(figsize=(16,8))
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)
Esempio n. 7
0
axes.label_text_property.color = (0, 0, 0)
axes.title_text_property.color = (0, 0, 0)
axes.axes.label_format = "%-#.0f"
mlab.outline(color=(0, 0, 0), extent=extent)
mlab.show()

# Now calculate all the components of the gradient tensor
fields = ['gyy', 'gyz', 'gzz']
error = 0.5
data = {}
for i, field in enumerate(fields):
    data[field] = synthetic.from_prisms(model,
                                        x1=0,
                                        x2=5000,
                                        y1=0,
                                        y2=5000,
                                        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):