Skip to content

Commit

Permalink
EditingColumnName
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderJuestel committed Jun 8, 2024
1 parent d17bc75 commit 49e29a6
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions pyborehole/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ def plot_well_logs(logs,
if len(tracks) == 1:
tracks = tracks[0]

# Adding N/G if add_net_to_gross is provided
if add_net_to_gross:
if 'N/G' not in df.columns:
raise ValueError('Net to gross has not been calculated yet')

net_to_gross = df['N/G']

# Selecting tracks
df = df[tracks + [depth_column]].reset_index()

# Selecting tracks if tracks are provided as a list of string
elif isinstance(tracks, list):

Expand Down Expand Up @@ -261,15 +271,15 @@ def plot_well_logs(logs,

# Setting x label
ax[j + k].set_xlabel(tracks + ' [%s]' %
logs.curves[logs.curves['original_mnemonic'] == tracks].reset_index(drop=True)[
logs.curves[logs.curves['mnemonic'] == tracks].reset_index(drop=True)[
'unit'].iloc[
0],
color='black',
labelpad=10,
fontsize=fontsize_xlabels)

# Setting y label
ax[0 + k].set_ylabel(depth_column + ' [%s]' % logs.curves.at[logs.curves[logs.curves['original_mnemonic'] == depth_column].index.tolist()[0], 'unit'],
ax[0 + k].set_ylabel(depth_column + ' [%s]' % logs.curves.at[logs.curves[logs.curves['mnemonic'] == depth_column].index.tolist()[0], 'unit'],
fontsize=fontsize_ylabels)

# Fill between curve
Expand Down Expand Up @@ -374,7 +384,7 @@ def plot_well_logs(logs,

# Setting x label
ax[j + k + l].set_xlabel(tracks + ' [%s]' %
logs.curves[logs.curves['original_mnemonic'] == tracks].reset_index(drop=True)[
logs.curves[logs.curves['mnemonic'] == tracks].reset_index(drop=True)[
'unit'].iloc[
0],
color='black',
Expand Down Expand Up @@ -402,7 +412,7 @@ def plot_well_logs(logs,
depth_min - buffer)

# Setting y label
ax[0].set_ylabel(depth_column + ' [%s]' % logs.curves.at[logs.curves[logs.curves['original_mnemonic'] == depth_column].index.tolist()[0], 'unit'],
ax[0].set_ylabel(depth_column + ' [%s]' % logs.curves.at[logs.curves[logs.curves['mnemonic'] == depth_column].index.tolist()[0], 'unit'],
fontsize=fontsize_ylabels)

# Plotting tracks
Expand Down Expand Up @@ -436,7 +446,7 @@ def plot_well_logs(logs,

# Setting x label
ax[i + j + k].set_xlabel(tracks[i] + ' [%s]' %
logs.curves[logs.curves['original_mnemonic'] == tracks[i]].reset_index(
logs.curves[logs.curves['mnemonic'] == tracks[i]].reset_index(
drop=True)[
'unit'].iloc[0],
color='black' if isinstance(colors[i], type(None)) else colors[i], labelpad=10,
Expand Down Expand Up @@ -718,7 +728,7 @@ def plot_logs_multiple_wells(wells: list,
# Setting x label
ax[i].set_xlabel(params[i]['track'] + ' [%s]' %
wells[i].logs.curves[
wells[i].logs.curves['original_mnemonic'] == params[i]['track']].reset_index(
wells[i].logs.curves['mnemonic'] == params[i]['track']].reset_index(
drop=True)[
'unit'].iloc[0],
color='black' if isinstance(colors[i], type(None)) else colors[i])
Expand Down Expand Up @@ -750,7 +760,7 @@ def plot_logs_multiple_wells(wells: list,
ax_second.plot(df_well_logs[param['track']], df_well_logs[param['depth_column']], color='purple', linewidth=0.5)
ax_second.set_xlabel(param['track'] + ' [%s]' %
wells[param['ax']].logs.curves[
wells[param['ax']].logs.curves['original_mnemonic'] == param['track']].reset_index(
wells[param['ax']].logs.curves['mnemonic'] == param['track']].reset_index(
drop=True)[
'unit'].iloc[0],
color='purple')
Expand Down

0 comments on commit 49e29a6

Please sign in to comment.