import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import welly
import lasio
from pathlib import Path
import warnings
warnings.filterwarnings('ignore')
file_input = Path("Data/VOLVE-PETROPHYSICAL_INTERPRETATION/15_9-F-1 B/WLC_PETRO_COMPUTED_INPUT_1.LAS")
file_output = Path("Data/VOLVE-PETROPHYSICAL_INTERPRETATION/15_9-F-1 B/WLC_PETRO_COMPUTED_OUTPUT_1.LAS")
log_input = welly.Well.from_las(file_input)
log_output = welly.Well.from_las(file_output)
log_input
log_output
log_input.data
log_output.data
# Dataframe form the input well log
df_input = log_input.df()
df_input
# Dataframe for the output well log
df_output = log_output.df()
df_output
df_input.info()
df_output.info()
df_input.isnull().sum()
df_output.isnull().sum()
log_input.plot()
df_input['VSH'] = (df_input['GR'].max() - df_input['GR']) / (df_input['GR'].max() - df_input['GR'].min())
df_input.head()
log_input.data['VSH'] = welly.Curve(df_input['VSH'])
curves = ['GR', 'NPHI', 'VSH']
log_input.plot(tracks=curves)
df_output.columns
curves = ['KLOGH', 'PHIF', 'SW', 'VSH']
log_output.plot(tracks=curves)
# Curves to plot
curves = ['KLOGH', 'PHIF', 'SW', 'VSH']
# set size of the plot
fig, axes = plt.subplots(1, len(curves), figsize=(20, 10))
# Iterate through list curves
for ind, curve in enumerate(curves):
segment = log_output.data[curve].to_basis(start=3200, stop=3400)
segment.plot(ax=axes[ind])
axes[ind].set_title(curve)
axes[0].set_ylabel('Depth (m)', fontsize=12)
fig.suptitle("Well logs volve field", fontsize=20)
fig.tight_layout()
# Create function to automate well logs plot
def well_logs(log, curves, start, stop):
# set size of the plot
fig, axes = plt.subplots(1, len(curves), figsize=(20, 10))
# Iterate through list curves
for ind, curve in enumerate(curves):
segment = log.data[curve].to_basis(start=start, stop=stop)
segment.plot(ax=axes[ind])
axes[ind].set_title(curve)
axes[0].set_ylabel('Depth (m)', fontsize=12)
fig.suptitle("Well logs volve field", fontsize=20)
fig.tight_layout()
df_output.columns
# Curves to plot
curves = ['KLOGH', 'PHIF', 'SAND_FLAG', 'SW', 'VSH']
well_logs(log_output, curves, 3230, 3400)
well_logs(log_output, curves, 3200, 3450)