Modelo de hipótese para dados de Well Logging
In [1]:
#Pacotes
#% matplotlib inline
from sys import maxsize
import numpy as np
from numpy import set_printoptions
import pylab as py
import matplotlib.pyplot as plt
import matplotlib.image as img
from matplotlib import style
import random
from random import shuffle
import scipy as sp
from scipy import ndimage
from scipy import misc
from PIL import Image, ImageFilter
from IPython.display import Latex
#----------------------------------
#novos pacotes de imagem
import imageio
from skimage import data, io, filters
from skimage import img_as_float
from skimage.transform import radon, rescale
from skimage.morphology import reconstruction
In [2]:
im = Image.open('amazonas.png')
plt.show()
In [3]:
#antigo método de leitura de rasters
ma = img.imread('amazonas.png') #carrega o modelo de hipótese H1 e transforma o raster em uma matriz de dados. Função imread()
#ma = misc.imread('amazonas.png',mode='P')
#ma = imageio.imread('amazonas.png')
#print(ma.shape) #mostra a matriz
#print(ma[:50,:50,1])
# no 'mode' usar:
#* 'L' (8-bit pixels, black and white)
#* 'P' (8-bit pixels, mapped to any other mode using a color palette)
#* 'RGB' (3x8-bit pixels, true color)
#* 'RGBA' (4x8-bit pixels, true color with transparency mask)
#* 'CMYK' (4x8-bit pixels, color separation)
#* 'YCbCr' (3x8-bit pixels, color video format)
#* 'I' (32-bit signed integer pixels)
#* 'F' (32-bit floating point pixels)
#plt.matshow(ma,vmin=0.0,vmax=4.0)#Cria o gráfico com a matriz da imagem (cria um valor mínimo e máximo)
#plt.colorbar()#Define o tipo de cor da barra de dados
#plt.show()#mostra o gráfico
In [2]:
ma = io.imread( "amazonas.png", as_gray=False)
plt.style.use(['classic'])
py.rcParams['figure.figsize'] = (20.0, 30.0)#new figure dimension
plt.title("Modelo")
plt.imshow(ma)
plt.grid()
plt.show()
#np.set_printoptions(threshold=maxsize)
#np.set_printoptions(threshold=np.nan)
#np.set_printoptions(threshold=np.inf)
#print(ma)
#print(np.array2string(ma, threshold=np.nan, max_line_width=np.nan))
In [58]:
############################################### PERFILAGEM ###########################################################
mb = ma[:,250]#Faz uma amostragem vertical na seção. Essa amostragem simula o poço. Poço 1.
#print('mb', np.array2string(mb, threshold=np.nan, max_line_width=np.nan))#imprime o RGBA do poço teste
############################################### DENSIDADE ###########################################################
# densidade
# 0 = folhelho | 2.4 |
# 1 = A2 | 2.1 |
# 2 = A1 | 2.05 |
# 3 = marga | 2.2 |
# 4 = Basalto | 2.8 |
RHOmb = [0.0]*len(mb)
prof = []#cria um vetor vazio
for i in range(len(mb)): #Cria um Laço com índice i que varia de 0 até o tamanho de mb menos 1. Ou seja, 999 elementos.
if mb[i].all() == 0: #declara que quando o índice i for igual a 0 na posição mn ...
RHOmb[i] = 2.4 #o elemento do vetor assumirá o valor de 2.4...e assim sucessivamente ...
if mb[i].all() == 1:
RHOmb[i] = 2.1
if mb[i].all() == 2:
RHOmb[i] = 2.05
if mb[i].all() == 3:
RHOmb[i] = 2.2
if mb[i].all() == 4:
RHOmb[i] = 2.6
prof.append(i)# Preenche o vetor prof com os valores do índice i. Comando append()
## Adiconando ruído randômico gaussiano normal
pure = np.linspace(-0.1, 0.1, len(RHOmb)) # Cria um vetor para receber a imagem da função densidade de probabilidade
noise = np.random.normal(0, 0.06, pure.shape) #Vetor ruído
signal_RHOmb = RHOmb + noise # sinal original com ruído
##########################################################################################################
############################################## RAIO GAMA ################################################
##########################################################################################################
# Raio-Gama
# 0 = Folhelho | 120.00 |
# 1 = A2 | 10.00 |
# 2 = A1 | 4.80 |
# 3 = marga | 7.20 |
# 4 = Basalto | 1.20 |
GRmb = [0.0]*len(mb)
prof = []
for i in range(len(mb)):
if mb[i].all() == 0:
GRmb[i] = 120.00
if mb[i].all() == 1:
GRmb[i] = 10.00
if mb[i].all() == 2:
GRmb[i] = 4.80
if mb[i].all() == 3:
GRmb[i] = 7.20
if mb[i].all() == 4:
GRmb[i] = 1.20
prof.append(i)
#print(prof)
#print(GRmb)
## Adiconando ruído randômico gaussiano normal
pure = np.linspace(-0.1, 0.1, len(GRmb)) # Cria um vetor para receber a imagem da função densidade de probabilidade
noise = np.random.normal(0, 7, pure.shape) #Vetor ruído
signal_GRmb = GRmb + noise # sinal original com ruído
################################## Gerando o gráfico da perfilagem ###################################################
#plotando os dados
fig, (ax1, ax2, ax3) = plt.subplots(nrows=1, ncols=3, sharey=True)
ax1.set_aspect(0.5)
ax1.set_ylim(0, 640)
ax1.set_xlim(1, 3)
ax1.invert_yaxis()
ax1.set_title('Litologia')
ax1.imshow(mb,cmap='viridis', interpolation='nearest')
ax1.set_aspect(1)
ax2.set_title('Densidade')
ax2.plot(signal_RHOmb, prof, 'b')
#ax2.imshow(mb,cmap='hsv')
ax2.set_xlim(1, 3)
ax2.invert_yaxis()
ax2.grid()
#ax2.set_aspect(1)
ax3.set_title('Raio-gama')
ax3.plot(signal_GRmb, prof, 'r')
#ax3.imshow(mb,cmap='hsv')
ax3.invert_yaxis()
ax3.grid()
#ax3.set_aspect(1)
fig.subplots_adjust(hspace=0.2,wspace=0.9)
#ax2.set_title("Densidade x Raio-Gama")
#ax2.set_xlabel('$Po\c{c}o$ mb', fontsize='xx-large')
#plt.title('Perfilagem do $Po\c{c}o$ mb', fontsize='xx-large', loc='center')
plt.draw()
plt.show()
In [6]:
############################################### PERFILAGEM ###########################################################
#mc = ma[:,300]#Faz uma amostragem vertical na seção. Essa amostragem simula um segundo poço. Poço 2.
#print (mc)