Skip to content

Commit c8d8e83

Browse files
committed
Made resolution 1 base map, and changed well plot
1 parent 7ee8e37 commit c8d8e83

File tree

12 files changed

+2077
-1591
lines changed

12 files changed

+2077
-1591
lines changed

Resolution-1_well_plot.jpg

1.24 MB
Loading

opal_ct/opal_ct_inversion.py

Lines changed: 101 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"""
77

88
import pandas as pd
9+
import numpy as np
910
import matplotlib.pyplot as plt
11+
import statsmodels.formula.api as sm
1012

1113
# Read in data
1214
data = pd.read_csv("opal_ct.csv")
@@ -18,6 +20,7 @@
1820
ax1.set_ylabel('Depth below seafloor')
1921
# Make the y-axis label, ticks and tick labels match the line color.
2022
ax1.set_xlabel('Count', color='b')
23+
plt.xlim(0,20)
2124
ax1.tick_params('x', colors='b')
2225
ax2 = ax1.twiny()
2326
ax2.hist(data2['Depth_below_seafloor'], normed=1, histtype='step',cumulative=True, color='r', orientation='horizontal')
@@ -31,15 +34,110 @@
3134
data2['burial_rate'] = data2['Depth_below_seafloor'] / data2['Age_host_seds']
3235

3336
# Plot data on a semilog plot
34-
plt.scatter(data2['burial_rate'][data2['burial_rate'] < 3], data2['Depth_below_seafloor'][data2['burial_rate'] < 3], color='b')
35-
plt.scatter(data2['burial_rate'][data2['burial_rate'] > 3], data2['Depth_below_seafloor'][data2['burial_rate'] > 3], color='c')
36-
plt.scatter(data2['burial_rate'][data2['burial_rate']> 30], data2['Depth_below_seafloor'][data2['burial_rate'] > 30], color='r')
37+
plt.scatter(data2['burial_rate'][data2['burial_rate'] < 4], data2['Depth_below_seafloor'][data2['burial_rate'] < 4], color='b')
38+
plt.scatter(data2['burial_rate'][data2['burial_rate'] > 4], data2['Depth_below_seafloor'][data2['burial_rate'] > 4], color='c')
39+
plt.scatter(data2['burial_rate'][data2['burial_rate']> 40], data2['Depth_below_seafloor'][data2['burial_rate'] > 40], color='r')
3740
plt.xlabel('Burial rate (m/Ma)')
3841
plt.ylabel('Depth (m)')
42+
plt.ylim(0,1000)
3943
ax = plt.gca()
4044
ax.invert_yaxis()
4145
ax.set_xscale('log')
4246
plt.show()
4347

48+
# Make cumulative hist for subsets of data
49+
fig, ax1 = plt.subplots(figsize=(4,5))
50+
ax1.hist(data2['Depth_below_seafloor'][data2['burial_rate'] < 4], color='b', orientation='horizontal', bins=range(0,1000,100))
51+
ax1.set_ylabel('Depth below seafloor')
52+
# Make the y-axis label, ticks and tick labels match the line color.
53+
ax1.set_xlabel('Count', color='b')
54+
ax1.set_xlim(0,15)
55+
ax1.set_ylim([0,1000])
56+
ax1.tick_params('x', colors='b')
57+
ax2 = ax1.twiny()
58+
ax2.hist(data2['Depth_below_seafloor'][data2['burial_rate'] < 4], normed=1, histtype='step',cumulative=True, color='r', orientation='horizontal')
59+
ax2.set_xlabel('Cumulative frequency', color='r')
60+
ax2.tick_params('x', colors='r')
61+
ax2.set_ylim([0,1000])
62+
plt.gca().invert_yaxis()
63+
fig.tight_layout()
64+
plt.show()
65+
66+
fig, ax1 = plt.subplots(figsize=(4,5))
67+
ax1.hist(data2.loc[(data2["burial_rate"] > 4) & (data2["burial_rate"] < 40), "Depth_below_seafloor"], color='c', orientation='horizontal', bins=range(0,1000,100))
68+
ax1.set_ylabel('Depth below seafloor')
69+
# Make the y-axis label, ticks and tick labels match the line color.
70+
ax1.set_xlabel('Count', color='c')
71+
ax1.set_xlim(0,15)
72+
ax1.set_ylim([0,1000])
73+
ax1.tick_params('x', colors='c')
74+
ax2 = ax1.twiny()
75+
ax2.hist(data2.loc[(data2["burial_rate"] > 4) & (data2["burial_rate"] < 40), "Depth_below_seafloor"], normed=1, histtype='step',cumulative=True, color='r', orientation='horizontal')
76+
ax2.set_xlabel('Cumulative frequency', color='r')
77+
ax2.tick_params('x', colors='r')
78+
ax2.set_ylim([0,1000])
79+
plt.gca().invert_yaxis()
80+
fig.tight_layout()
81+
plt.show()
82+
83+
fig, ax1 = plt.subplots(figsize=(4,5))
84+
ax1.hist(data2['Depth_below_seafloor'][data2['burial_rate'] >40], color='r', orientation='horizontal', bins=range(0,1000,100))
85+
ax1.set_ylabel('Depth below seafloor')
86+
# Make the y-axis label, ticks and tick labels match the line color.
87+
ax1.set_xlabel('Count', color='r')
88+
ax1.set_xlim(0,15)
89+
ax1.set_ylim([0,1000])
90+
ax1.tick_params('x', colors='r')
91+
ax2 = ax1.twiny()
92+
ax2.hist(data2['Depth_below_seafloor'][data2['burial_rate'] >40], normed=1, histtype='step',cumulative=True, color='r', orientation='horizontal')
93+
ax2.set_xlabel('Cumulative frequency', color='r')
94+
ax2.tick_params('x', colors='r')
95+
ax2.set_ylim([0,1000])
96+
plt.gca().invert_yaxis()
97+
fig.tight_layout()
98+
plt.show()
99+
100+
# 0th order
101+
## plot cumulative freq against time
102+
# time = depth / burial rate
103+
# fit regression line, slope is reaction rate k.
104+
105+
# For inversion, vector of A and vector of E (to make grid search).
106+
A = np.linspace(start=10e-2, stop=10e4, num=10)
107+
E = np.linspace(start=70, stop=110, num=10)
108+
misfit_grid = np.zeros((10,10))
109+
# find temp at each point with a geothermal gradient of 30 degrees c and a surface temp of 0.
110+
data2['temp'] = data2['Depth_below_seafloor']/1000 * 30
111+
# Find misfit as abs(predicted - real). Fill it into grid search.
112+
# Sort by depth
113+
data3 = data2.sort_values(by='Depth_below_seafloor')
114+
# Make column of cumulative percentage
115+
data3['cum_perc'] = np.cumsum(data3['Depth_below_seafloor'].values)/np.max(np.cumsum(data3['Depth_below_seafloor'].values)) * 100
116+
result = sm.ols(formula="cum_perc ~ Depth_below_seafloor", data=data3).fit()
117+
k = result.params['Depth_below_seafloor']
118+
119+
120+
121+
122+
123+
# 1st order
124+
## plot ln(cumulative freq) against time
125+
# time = depth / burial rate
126+
# fit regression line, slope is -ve reaction rate k.
127+
128+
# For inversion, vector of A and vector of E (to make grid search).
129+
# find temp at each point with a geothermal gradient of 30 degrees c and a surface temp of 0.
130+
# Find misfit as abs(predicted - real). Fill it into grid search.
131+
132+
133+
# Nucleation and growth reaction
134+
## plot ln(cumulative freq) against time
135+
# time = depth / burial rate
136+
# fit regression line, slope is -ve reaction rate k.
137+
138+
# For inversion, vector of A and vector of E (to make grid search).
139+
# find temp at each point with a geothermal gradient of 30 degrees c and a surface temp of 0.
140+
# Find misfit as abs(predicted - real). Fill it into grid search.
141+
44142

45143

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
,murray,murray-Latitude-E5430-non-vPro,11.12.2017 21:55,file:///home/murray/.config/libreoffice/4;

resolution_1/Resolution-TD_curve.pdf

11.4 KB
Binary file not shown.

resolution_1/Wireline/.~lock.resolution-1_final.las#

Lines changed: 0 additions & 1 deletion
This file was deleted.

resolution_1/resolution_1_2.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
ax5.axvline(x=1900, color='red')
5050
ax5.axvline(x=1220, color='blue')
5151
fig.subplots_adjust(wspace=0, hspace=0)
52-
plt.savefig("/home/murray/Documents/thesis_python_code/Resolution-1_well_plot.pdf")
52+
#plt.savefig("/home/murray/Documents/thesis_python_code/Resolution-1_well_plot.pdf")
5353
plt.show()
5454

5555
## Fill log data with dummy values for water and sed. Create a dataframe of the filled values,
@@ -70,6 +70,8 @@
7070
temp_dataframe = pd.DataFrame({'DEPTH':depths, 'BS':BS, 'CALI':CALI, 'DTC':DTC, 'GR':GR, 'GR_CORR':GR_CORR, 'RESD':RESD, 'RESS':RESS, 'SP':SP})
7171
log_data = pd.concat((temp_dataframe,log_data), ignore_index=True)
7272

73+
# Add the water column
74+
7375
# Interpolate missing values to enable the cumulative integration
7476
log_data.loc[0,'DT_s_per_m'] = (1.0/1500)
7577
log_data['DT_s_per_m'] = log_data['DT_s_per_m'].interpolate()
@@ -89,7 +91,7 @@
8991
plt.xticks(np.arange(1500, 6000, 1000))
9092
plt.xlabel(r'$Vp \quad ms^{-1}$', fontsize=18)
9193
plt.ylabel("Depth (m)", fontsize=14)
92-
plt.savefig("/home/mxh909/Desktop/magee_resolution_images/Resolution-1_Vp_plot.pdf",bbox_inches='tight')
94+
#plt.savefig("/home/mxh909/Desktop/magee_resolution_images/Resolution-1_Vp_plot.pdf",bbox_inches='tight')
9395
plt.show()
9496

9597

@@ -99,14 +101,16 @@
99101
# Cumulativly integrate to form the time depth curve
100102
from scipy.integrate import cumtrapz
101103
time_s = 2*(cumtrapz(y=log_data['DT_s_per_m'], x=log_data['DEPTH'])) # x2 as log is in one-way-time
102-
time_s += 0.1 # add in the value of the seafloor from the seismic. Entered here rather than calculated, as well is a little upslope.
104+
#time_s += 0.1 # add in the value of the seafloor from the seismic. Entered here rather than calculated, as well is a little upslope.
103105
plt.figure()
104106
plt.plot(time_s, log_data['DEPTH'][:-1])
105-
plt.gca().invert_yaxis()
106107
plt.title("Time-depth curve")
107108
plt.xlabel("Time (s)")
108109
plt.ylabel("Depth (m)")
109-
plt.savefig("/home/mxh909/Desktop/magee_resolution_images/Resolution-TD_curve.pdf",bbox_inches='tight')
110+
plt.xlim(0,1.8)
111+
plt.ylim(0,2100)
112+
plt.gca().invert_yaxis()
113+
plt.savefig("/home/murray/Documents/thesis_python_code/resolution_1/Resolution-TD_curve.pdf",bbox_inches='tight')
110114
plt.show()
111115

112116
np.savetxt("/home/mxh909/Desktop/magee_resolution_images/Resolution_1_time_depth_curve.txt", np.vstack((log_data['DEPTH'].values[:-1], time_s)).T, header="Depth_m Time_s")

0 commit comments

Comments
 (0)