Esempio n. 1
0
import numpy
from fatiando.heat import climatesignal
from fatiando import vis, utils
import cPickle as pickle

amplitude = 5
idade = 78
ruido = 0.05
zp = numpy.arange(10, 110, 1)
temp, error = utils.contaminate(climatesignal.linear(amplitude,
    idade, zp), ruido, percent=True, return_stddev=True)

with open('exercicio5.pickle', 'w') as f:
    pickle.dump([zp, temp], f)
Esempio n. 2
0
from matplotlib import pyplot
import numpy
from fatiando.heat import climatesignal
from fatiando.inversion.gradient import levmarq
from fatiando import vis, utils

params = __import__('exercicio3e4_entrada')
zp = numpy.arange(0, 100, 1)
temp, error = utils.contaminate(climatesignal.linear(params.amplitude,
                                                     params.idade, zp),
                                params.ruido,
                                percent=True,
                                return_stddev=True)
solver = levmarq(initial=params.inicial)
p, residuals = climatesignal.invert_linear(temp, zp, solver)
est_amp, est_age = p

pyplot.figure(figsize=(12, 5))
pyplot.subplot(1, 2, 1)
pyplot.title("Sinal climatico")
pyplot.plot(temp, zp, 'ok', label='Observado')
pyplot.plot(temp - residuals, zp, '--r', linewidth=3, label='Predito')
pyplot.legend(loc='lower right', numpoints=1)
pyplot.xlabel("Temperatura (C)")
pyplot.ylabel("Z")
pyplot.ylim(100, 0)
ax = pyplot.subplot(1, 2, 2)
ax2 = pyplot.twinx()
pyplot.title("Idade e amplitude")
width = 0.3
ax.bar([1 - width], [params.idade], width, color='b', label="Verdadeiro")
Esempio n. 3
0
import numpy
from fatiando.heat import climatesignal
from fatiando import vis, utils
import cPickle as pickle

amplitude = 5
idade = 78
ruido = 0.05
zp = numpy.arange(10, 110, 1)
temp, error = utils.contaminate(climatesignal.linear(amplitude, idade, zp),
                                ruido,
                                percent=True,
                                return_stddev=True)

with open('exercicio5.pickle', 'w') as f:
    pickle.dump([zp, temp], f)