From 3d815bb6bdf2e5cd4e0bb52f6b3cc50087616385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Luiz=20Albano?= Date: Fri, 22 Mar 2024 19:41:43 -0300 Subject: [PATCH] v0.1.9.2 --- components/__pycache__/about.cpython-312.pyc | Bin 6117 -> 6051 bytes .../__pycache__/help_window.cpython-312.pyc | Bin 6244 -> 6178 bytes .../tomi_calculations.cpython-312.pyc | Bin 6463 -> 6397 bytes components/about.py | 1 - components/help_window.py | 1 - components/tomi_calculations.py | 1 - kraken.py | 420 +++++++++++++----- pressao_automatizada.py | 14 +- uploads/dry_gas.csv | 11 + uploads/fresh_water.csv | 11 + uploads/ogx.csv | 52 +++ uploads/oil_limit.csv | 11 + .../color_constants.cpython-312.pyc | Bin 423 -> 419 bytes .../fluid_pressure.cpython-312.pyc | Bin 1510 -> 1506 bytes utility/__pycache__/icons.cpython-312.pyc | Bin 2775 -> 2771 bytes utility/__pycache__/utilities.cpython-312.pyc | Bin 4981 -> 4977 bytes utility/fluid_pressure.py | 21 - 17 files changed, 394 insertions(+), 149 deletions(-) create mode 100644 uploads/dry_gas.csv create mode 100644 uploads/fresh_water.csv create mode 100644 uploads/ogx.csv create mode 100644 uploads/oil_limit.csv delete mode 100644 utility/fluid_pressure.py diff --git a/components/__pycache__/about.cpython-312.pyc b/components/__pycache__/about.cpython-312.pyc index 5b16e9fc8f54c063ed7dff1da9ad46237956e1b0..8093e3d6129ee972901b3705f68e4723581d6660 100644 GIT binary patch delta 943 zcmZ8fOHUI~7@b>M#bRxtotC1Q5~I*W%fqHh%OgOcZGuoAM7-2A)0qKA=TYxW1!|%$ zj2pwkToT=wsH_ZeVOZ-Qz#m{{sd3>7-5C;%_nV3_%;L;<&iU@0GvB>mdpCQ1J3gP6 zV^4hNm;B+WFY5Y@-t`QiCaoV+0d@KjCvj4nI;f>_TFYR%j-m-i3##MV1fI~cIIB(K zNo@*GX*rzJ@;LAKNG;%k9JsYXyZk})jDAOaf9N&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)H1MW!szvMu#`R>(GVg7_1DpR{@ql#Lph^w}E`eLr`4a8yrEbJ|2vr z^dnCZIFQ(5sJ+NIQ~=m^kHDVvOOCfMpx?XbWP7v~1v9c*e-T0mmH9#6ZbEe(lbFuV zg`-c&LL%8Xu5A*FS=G%QLRcRt%D=d&SrwaKQAcHVns2LN{!|^2*;)Qd9pYcqewmH& tAL{&hO*DC9v3;oi&-$-mohx)1;W diff --git a/components/__pycache__/tomi_calculations.cpython-312.pyc b/components/__pycache__/tomi_calculations.cpython-312.pyc index eda344b60e33d04804d34ae3a8095adb93ec7781..d97d416a7587cf37514120fb84769400c784a5ff 100644 GIT binary patch delta 985 zcmY+B%TE(g6vpTF0R$Ln5lTygR!J&NS-*5>CSJ@W)Ub?%l#sHk9mI!yq!V`%KlYOV4v-)Yk}ljuLO4Xaako)d ztzITQxQF!OUebsANEnAnKkg?H95M1pjpC?mOE1CqPG9Ne(=kNzLdtt~6K$bl3JE45 zCZuXsg;ed9si@(ri%4>?ee`i>+a#I7om{4V4&BV*@pukm$#8r^m#H2fNhYWozpf?o zM9$>&cudI+=jY;CD(iYeV=ikHwd_n_N%gq zrK{X%l&w`=;G^GFwTX~=FVGN_1=*h}mwST0-sZPn%CRc^H6bxj%+InKTZ{h|m-lQO zl7-&k4|*2>E7CEJ0(vT$sRhF0jZ|9$>SQl%J~YTa+s30tQ^`qF!JN~wlDS~fm6Uwk z!gG>`PQkRYaV@LLk7bn_cK5NH_GT1jkL-=8mA$sVt+)t-ynsd)u5K8rhu8DaDkc+Z zawew{Wo9my;l6<_{}-jRP*na$4*l3&_NlggGz|hYuLwWODh;njr4ky4;`@LHfG)rq;03@KRkR(#_7gNSpTjL0 z3DBf#^f|ldm`0RsJD#8^)>=32tw=7Y8r8B3i>gZDC<IJ9(WfM}j85%bV_)l9 zoCW(yqWDx~oq|K`u&#+UIqNNr5Ja3VhMn#fV~Nv?9h60gmddO00Nv!J@Z0(uw&5IM Kd(JTntoaWaljBJM delta 1039 zcmY+C%}*0S7{+%>`3Q9Bhtd`ZT0v-+LM@cfLLsq6KqDUk4UQEk-IXrxbn9%Z5);Kp zG~UEHnBdJA6N7r;uJPiSv&OY0}9bY=d@1j^K z@M}ZZQ|_#bwdmWr|4#%7vLHLPX3~ONh#&h&00)SKCDMvpNe~A~8*U@*xSfP>$n14# zYzoyrB0ac=^x|GqJE8TFe%w!@I7$Za02#!CB!**T2oIS)(uVP{;#gjV=O4e8pB%5D zS`y@wZ_p+xI!LexBZ6GBCdlqhOHsq6=U0&AVLRxPz514xSLOLERSY9fm92G4n`J1> z`)CJ;QNrQ#`SvfTqKT`9LXAW+sVycmdg6kf$`d7%GZG_eZZyA`7@MZlw<7k4(_A`9qQ+rUH~ov8DRxeSjB(l|OOO|k`79g46At}qI1eQ= pressures[0] and -1.*round(slope_top,4) < pressures[1]: + top_fluid = fluid + + # Find the fluid that matches the bottom slope + for fluid, pressures in pressure_values.items(): + if -1.*round(slope_bottom,4) >= pressures[0] and -1.*round(slope_bottom,4) < pressures[1]: + bottom_fluid = fluid + + # Get the names of the top and bottom fluids + top_fluid_name = fluid_pressure[top_fluid]['name'] + bottom_fluid_name = fluid_pressure[bottom_fluid]['name'] + + # Print the names of the top and bottom fluids + print(top_fluid_name, "|", bottom_fluid_name) + + + x_intercept = (intercept_bottom - intercept_top) / (slope_top - slope_bottom) + y_intercept = slope_top * x_intercept + intercept_top + print('O ponto de interseção das retas é',x_intercept,y_intercept) + + diff = np.diff(top_prof) + print(diff) + + # Extended top curve + mean_cota_top = np.mean(np.diff(top_prof)) + extended_cota_top = [(np.abs(mean_cota_top) + np.max(top_prof))] + list(top_prof) + extended_pressure_top = np.array(extended_cota_top)*slope_top + intercept_top + + # Extended bot curve + mean_cota_bot = np.mean(np.diff(bottom_prof)) + extended_cota_bot = list(bottom_prof) + [(np.min(bottom_prof) + mean_cota_bot)] + extended_pressure_bot = np.array(extended_cota_bot)*slope_bottom + intercept_bottom + + # Calculate the line of best fit for the top and bottom fluids + line_top = slope_top * np.array(top_prof) + intercept_top + line_bottom = slope_bottom * np.array(bottom_prof) + intercept_bottom + + plt.figure(figsize=(13,5)) + + plt.subplot(131) + plt.plot(top_pressao,top_prof,'o',c="C0",label='top curve '+str(round(slope_top,4))) + plt.plot(bottom_pressao,bottom_prof,'o',c="C3",label='bot curve '+str(round(slope_bottom,4))) + plt.legend(fontsize='small') + plt.xlabel('Pressão (PSI)') + plt.ylabel('Cota (M)') + plt.grid() + # plt.show() # Plota o gráfico com os clusters divididos + + plt.subplot(132) + # Plot the data points for the top and bottom fluids + plt.plot(top_pressao, top_prof, 'o', c="C0", label=top_fluid_name) + plt.plot(bottom_pressao, bottom_prof, 'o', c="C3", label=bottom_fluid_name) + + # Plot the lines of best fit for the top and bottom fluids + plt.plot(line_top, top_prof, c="C9", label=f'{top_fluid_name} {round(slope_top, 4)}') + plt.plot(line_bottom, bottom_prof, c="C1", label=f'{bottom_fluid_name} {round(slope_bottom, 4)}') + + # Add a legend, labels, and a grid + plt.legend(fontsize='small') + plt.xlabel('Pressão (PSI)') + plt.ylabel('Cota (M)') + plt.grid() + + plt.subplot(133) + plt.plot(top_pressao,top_prof,'o',c="C0",label=top_fluid_name) + plt.plot(bottom_pressao,bottom_prof,'o',c="C3",label=bottom_fluid_name) + + plt.plot(extended_pressure_top,extended_cota_top,c="C9",label=bottom_fluid_name+" "+str(round(slope_bottom,4))) + plt.plot(extended_pressure_bot,extended_cota_bot,c="C1",label=top_fluid_name+" "+str(round(slope_top,4))) + plt.plot(y_intercept,x_intercept,'s',c="k",label="Intersection "+str(round(x_intercept,4)) ) + plt.legend(fontsize='small') + plt.xlabel('Pressure (PSI)') + plt.ylabel('Level (M)') + plt.grid() + + plt.tight_layout() + plt.show() + + def call_plot_trends(self): + self.plot_trends() class SheetEditor: diff --git a/pressao_automatizada.py b/pressao_automatizada.py index d0e8b59..53b47e9 100644 --- a/pressao_automatizada.py +++ b/pressao_automatizada.py @@ -6,7 +6,7 @@ fluid_pressure = fluid_pressure() # dictionary of fluid pressures -df = pd.read_csv('./uploads/pressao_exemplo_2.csv', +df = pd.read_csv('./uploads/ogx.csv', sep=";", skiprows=1, names=["prof", "pressao"]) @@ -32,13 +32,7 @@ def calculate_slope(ps_a, ps_b): coefficients = np.polyfit(ps_a, ps_b, 1) return coefficients[0] -# testing the function -# calculate_slope( -# np.array([prof[0], prof[1]]), -# np.array([pressao[0], pressao[1]]) -# ) -# Calculate the slope between each pair of consecutive points slopes = [] slope_indices = {} for i in range(len(prof) - 1): @@ -48,8 +42,6 @@ def calculate_slope(ps_a, ps_b): slopes.append(slope) slope_indices[slope] = [i, i + 1] -# print(slope_indices) - # Convert the list of slopes to a numpy array slopes_array = np.array([slopes, slopes]) @@ -148,12 +140,12 @@ def convert_classification(class_data): # Extended top curve mean_cota_top = np.mean(np.diff(top_prof)) -extended_cota_top = list(top_prof) + [mean_cota_top + np.min(top_prof)] +extended_cota_top = [(np.abs(mean_cota_top) + np.max(top_prof))] + list(top_prof) extended_pressure_top = np.array(extended_cota_top)*slope_top + intercept_top # Extended bot curve mean_cota_bot = np.mean(np.diff(bottom_prof)) -extended_cota_bot = [(np.max(bottom_prof) - mean_cota_bot)] + list(bottom_prof) +extended_cota_bot = list(bottom_prof) + [(np.min(bottom_prof) + mean_cota_bot)] extended_pressure_bot = np.array(extended_cota_bot)*slope_bottom + intercept_bottom # Calculate the line of best fit for the top and bottom fluids diff --git a/uploads/dry_gas.csv b/uploads/dry_gas.csv new file mode 100644 index 0000000..0da2aec --- /dev/null +++ b/uploads/dry_gas.csv @@ -0,0 +1,11 @@ +prof; pressao +-1175.00; 1980.00 +-1180.00; 1985.00 +-1185.00; 1990.00 +-1190.00; 1995.00 +-1195.00; 2000.00 +-1200.00; 2005.00 +-1205.00; 2010.00 +-1210.00; 2015.00 +-1215.00; 2020.00 +-1220.00; 2025.00 \ No newline at end of file diff --git a/uploads/fresh_water.csv b/uploads/fresh_water.csv new file mode 100644 index 0000000..8eb5219 --- /dev/null +++ b/uploads/fresh_water.csv @@ -0,0 +1,11 @@ +prof; pressao +-1200.00; 2000.00 +-1210.00; 2010.00 +-1220.00; 2020.00 +-1230.00; 2030.00 +-1240.00; 2040.00 +-1250.00; 2050.00 +-1260.00; 2060.00 +-1270.00; 2070.00 +-1280.00; 2080.00 +-1290.00; 2090.00 diff --git a/uploads/ogx.csv b/uploads/ogx.csv new file mode 100644 index 0000000..d745085 --- /dev/null +++ b/uploads/ogx.csv @@ -0,0 +1,52 @@ +prof;pressao +-1306.0;172.1 +-1306.1;172.0 +-1309.5;172.3 +-1309.7;172.3 +-1309.0;172.1 +-1312.0;172.4 +-1315.5;172.8 +-1319.0;173.2 +-1322.5;173.7 +-1322.2;173.5 +-1322.0;173.5 +-1325.3;173.8 +-1325.5;173.8 +-1327.2;173.9 +-1326.5;173.8 +-1327.0;173.8 +-1332.5;174.4 +-1339.0;175.2 +-1344.0;175.7 +-1348.5;176.2 +-1353.5;176.8 +-1359.2;177.4 +-1359.2;177.4 +-1359.5;177.3 +-1359.7;177.3 +-1362.0;177.5 +-1375.0;179.1 +-1378.0;179.3 +-1380.5;179.6 +-1383.5;179.9 +-1386.2;180.1 +-1394.3;181.1 +-1406.2;182.6 +-1420.0;184.3 +-1450.0;188.1 +-1514.5;196.1 +-465.0;62.4 +-465.5;62.5 +-475.5;63.7 +-495.0;66.2 +-495.3;66.2 +-525.0;70.0 +-668.3;88.5 +-668.5;88.5 +-724.5;95.7 +-777.2;102.4 +-921.0;120.7 +-982.8;128.5 +-1070.2;139.6 +-1091.0;142.2 +-1146.0;148.4 diff --git a/uploads/oil_limit.csv b/uploads/oil_limit.csv new file mode 100644 index 0000000..8798c1e --- /dev/null +++ b/uploads/oil_limit.csv @@ -0,0 +1,11 @@ +prof; pressao +-1236.50; 2026.35 +-1245.50; 2027.77 +-1251.00; 2029.19 +-1255.50; 2028.45 +-1260.30; 2030.62 +-1265.00; 2032.04 +-1267.00; 2034.88 +-1270.00; 2039.15 +-1275.00; 2044.84 +-1280.00; 2056.21 diff --git a/utility/__pycache__/color_constants.cpython-312.pyc b/utility/__pycache__/color_constants.cpython-312.pyc index 7ee3b127a6b7af4c706d90e8985d503fbb85d1c9..f867948ebe7416db32b10894e8d1ebd9d319ca63 100644 GIT binary patch delta 65 zcmZ3^yqKB$G%qg~0}$k2|FMyqi&4WV*(xTqIJKxa#xpswC@01xKe;qFHLs*N#yzvd Tqcka|peVJtI5B^+BV!r>rG^$w delta 69 zcmZ3?yquZ)G%qg~0}zz&{JD{vi&4id*(xTqIJKxaCNVK5DKRfU#w9)jOinDyiE+tKF3nBND=Cg~&n)pM TO^PWfN-Zu<%-=kN#g7pHok11> delta 69 zcmaFF{fwLIG%qg~0}$j2Zsba0(Q!?-iU}=FEh>&lOw372%*&5)$xklLP0cGQj&aW{ X@hDA-aW6_t2`EY}F5Wza#g7pH^2`@Y diff --git a/utility/__pycache__/icons.cpython-312.pyc b/utility/__pycache__/icons.cpython-312.pyc index a308a504b41375faef7519522a3de00cd1cbbf06..db47166d9e575c677d713b8de28dc3bfdccf9500 100644 GIT binary patch delta 66 zcmcaEdRdhFG%qg~0}wQBe7}+VE4zk8vQ(JG%qg~0}!l@|FDt!E4z+OvQMv>NpXyO YW{F2>QjB|1VoE?!YH{&q4UW}J0AiIHL;wH) diff --git a/utility/__pycache__/utilities.cpython-312.pyc b/utility/__pycache__/utilities.cpython-312.pyc index bb49c40019044ccdb41cc24c2ca2b0ed70f4db6f..73a2ff07a5294b3ba3754f6d074d49405aa11154 100644 GIT binary patch delta 66 zcmeyW_EC-dG%qg~0}yZ>`MZ(3iAlpI*(xTqIJKxa#xpswC@01xKe;qFHLs*N#yzvd Uqcka|peVJtI5B_oPNqEq0QLzOE&u=k delta 70 zcmeyU_EnAhG%qg~0}zz&{JD|4iAl#H*(xTqIJKxaCNVK5DKRfU#w9