From d01c977159c39b30f845fb277856df00f828f9d9 Mon Sep 17 00:00:00 2001 From: GeoArkadeep Date: Fri, 12 Apr 2024 00:40:25 +0530 Subject: [PATCH] RC1_Patch1 --- src/WellMasterGeoMech/BoreStab.py | 1 + src/WellMasterGeoMech/app.py | 43 ++++++++++++++++++++++++++++-- src/WellMasterGeoMech/plotangle.py | 7 ++--- 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/src/WellMasterGeoMech/BoreStab.py b/src/WellMasterGeoMech/BoreStab.py index c578816..5967e2b 100644 --- a/src/WellMasterGeoMech/BoreStab.py +++ b/src/WellMasterGeoMech/BoreStab.py @@ -504,6 +504,7 @@ def getHoop(inc,azim,s1,s2,s3,deltaP,Pp, ucs, alpha=0,beta=0,gamma=0,nu=0.35,pat if path is not None: #print("Width = ",width/20,", omega =",np.max(angle), " at inclination = ",inc, " and azimuth= ",azim) #plt2.scatter(np.array(range(0,360)),frac) + plt2.title("Hoop Stresses and Principal Stress Angles") plt2.plot(angle) plt2.plot(line) plt2.plot(line2) diff --git a/src/WellMasterGeoMech/app.py b/src/WellMasterGeoMech/app.py index 524d0f0..ab93893 100644 --- a/src/WellMasterGeoMech/app.py +++ b/src/WellMasterGeoMech/app.py @@ -25,7 +25,7 @@ model_lock = Lock() import time -user_home = os.path.expanduser("~/documents") +user_home = os.path.expanduser("~/Documents") app_data = os.getenv("APPDATA") output_dir = os.path.join(user_home, "pp_app_plots") output_dir1 = os.path.join(user_home, "pp_app_data") @@ -41,6 +41,8 @@ output_fileVec = os.path.join(output_dir, "PlotVec.png") output_fileBHI = os.path.join(output_dir, "PlotBHI.png") output_fileHoop = os.path.join(output_dir, "PlotHoop.png") +output_fileFrac = os.path.join(output_dir, "PlotFrac.png") +output_fileAll = os.path.join(output_dir, "PlotAll.png") output_file2 = os.path.join(output_dir1, "output.csv") output_file3 = os.path.join(output_dir1, "output.las") modelpath = os.path.join(input_dir, "model.csv") @@ -1524,6 +1526,10 @@ def plotPPzhang(well,rhoappg = 16.33, lamb=0.0008, a = 0.630, nu = 0.4, sfs = 1. gradient = lithostatic/(tvdf)*1.48816 rhoppg[0] = rhoappg rhogcc[0] = rhoappg*0.11982642731 + try: + rhogcc = [rhogcc[i] if math.isnan(zden2[i]) else zden2[i] for i in range(len(zden2))] + except: + pass #rhoppg = interpolate_nan(rhoppg) #rhogcc[0] = 0.01 @@ -1774,6 +1780,8 @@ def plotPPzhang(well,rhoappg = 16.33, lamb=0.0008, a = 0.630, nu = 0.4, sfs = 1. sgHMpsi[i] = (result[2])*145.038 sgHMpsiL[i] = (result[0])*145.038 sgHMpsiU[i] = (result[1])*145.038 + if psifg[i]0: plotHoop(doi) drawBHimage(doi) + combineHarvest() """ #Preview Plot @@ -2351,6 +2389,7 @@ def plotHoop(doi): # Save the modified plot plt.gcf().set_size_inches(15, 10) plt.savefig(output_file)#,dpi=600) + return df3 def readDevFromAsciiHeader(devpath, delim = r'[ , ]'): diff --git a/src/WellMasterGeoMech/plotangle.py b/src/WellMasterGeoMech/plotangle.py index 782e853..a25bdc5 100644 --- a/src/WellMasterGeoMech/plotangle.py +++ b/src/WellMasterGeoMech/plotangle.py @@ -54,7 +54,7 @@ def plotfracsQ(data): #plt.show() -def plotfrac(data): +def plotfrac(data,path): tvd,fr,angles,minangle,maxangle = data dia = 8.5 #inches, bit circumference = np.pi*dia #in inches @@ -96,8 +96,9 @@ def plotfrac(data): plt.plot(yj) #Setting axis limits plt.xlim(0, 360) - #plt.ylim(-180, 180) - plt.savefig('frac.png') + plt.ylim(-180, 180) + plt.title("Fracture Morphology") + plt.savefig(path) print(yj) yj[(maxangle-10)%360:(maxangle+15)%360]=np.nan yj[(maxangle+170)%360:(maxangle+195)%360]=np.nan