def cmp(p, t, s, name): #keep only the positive time t, s = hp.hyclean(t, s) #define regular points to plot the calculated drawdown tc = np.logspace(np.log10(t[0]), np.log10(t[len(t) - 1]), num=len(t), endpoint=True, base=10.0, dtype=np.float64) #compute the drawdown with the model string = 'hp.' + name + '.dim(p,tc)' sc = eval(string) #keep only the positive drawdown tc, sc = hp.hyclean(tc, sc) #Compute the residuals and their statistics residuals = s - hp.ths.dim(p, t) mr = np.mean(residuals) sr = 2 * np.nanstd(residuals) rms = math.sqrt(np.mean(residuals**2)) return tc, sc, mr, sr, rms
def rpt(p, t, s, d, name, ttle='Interference test', Author='My name', Rapport='My Rapport', filetype='img'): '''THN_RPT - Produces the final figure and results for the Theis model with a no flow boundary Syntax: hp.thn.rpt( p, t, s, d, ttle ) p = parameters of the model t = measured time s = measured drawdown d(1) = Q = Pumping rate d(2) = r = Distance between the observation and the pumping well ttle = Title of the figure (Optional) Description: Produces the final figure and results for Theis model (1935) with a no flow boundary. See also: thn_dmo, thn_dim, thn_gss''' #rename the parameters for a more intuitive check of the formulas a = p[0] t0 = p[1] ti = p[2] q = d[0] r = d[1] #Compute the transmissivity, storativity and radius of influence T = 0.1832339 * q / a S = 2.458394 * T * t0 / r**2 Ri = math.sqrt(2.2458394 * T * ti / S) #Calls an internalscript that computes drawdown, derivative and residuals #script rpt.cmp tc, sc, mr, sr, rms = hp.script.cmp(p, t, s, 'thn') #script rpt_plt #calculate the derivative of the data td, sd = hp.ldiffs(t, s, npoints=30) #keep only positive derivatives td, sd = hp.hyclean(td, sd) #compute the derivative of the model tdc, sdc = hp.ldiff(tc, sc) #keep only positive derivatives tdc, sdc = hp.hyclean(tdc, sdc) #plots the data and model in bi-logarithmic scale if filetype == 'pdf': fig = plt.figure() fig.set_size_inches(8, 6) fig.text(0.125, 1, Author, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, 0.95, Rapport, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.05, 'Test Data : ', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.1, 'Discharge rate : {:3.2e} m³/s'.format(q), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.15, 'Radial distance : {:0.2g} m '.format(r), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.25, 'Hydraulic parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.3, 'Transmissivity T : {:3.1e} m²/s'.format(T), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.35, 'Storativity S : {:3.1e} '.format(S), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.40, 'Distance to image well Ri : {:0.2g} m'.format(Ri), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.5, 'Fitting parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.55, 'slope a : {:0.2g} m '.format(a), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.60, 'intercept t0 : {:0.2g} m'.format(t0), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.65, 'intercept ti : {:0.2g} m'.format(ti), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.70, 'mean residual : {:0.2g} m'.format(mr), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.75, '2 standard deviation : {:0.2g} m'.format(sr), fontsize=14, transform=plt.gcf().transFigure) ax1 = fig.add_subplot(111) ax1.set_xlabel('Time in seconds') ax1.set_ylabel('Drawdown in meters') ax1.set_title(ttle) ax1.loglog(t, s, c='r', marker='+', linestyle='', label='drawdown') ax1.loglog(td, sd, c='b', marker='x', linestyle='', label='Derivative') ax1.loglog(tc, sc, c='g', label='Theis (1935) Model') ax1.loglog(tdc, sdc, c='y', label='Model derivative') ax1.grid(True) ax1.legend() plt.show() fig.savefig('thn_rapport.pdf', bbox_inches='tight') if filetype == 'img': fig = plt.figure() fig.set_size_inches(8, 6) fig.text(0.125, 1, Author, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, 0.95, Rapport, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.05, 'Test Data : ', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.1, 'Discharge rate : {:3.2e} m³/s'.format(q), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.15, 'Radial distance : {:0.2g} m '.format(r), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.25, 'Hydraulic parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.3, 'Transmissivity T : {:3.1e} m²/s'.format(T), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.35, 'Storativity S : {:3.1e} '.format(S), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.40, 'Distance to image well Ri : {:0.2g} m'.format(Ri), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.5, 'Fitting parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.55, 'slope a : {:0.2g} m '.format(a), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.60, 'intercept t0 : {:0.2g} m'.format(t0), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.65, 'intercept ti : {:0.2g} m'.format(ti), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.70, 'mean residual : {:0.2g} m'.format(mr), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.75, '2 standard deviation : {:0.2g} m'.format(sr), fontsize=14, transform=plt.gcf().transFigure) ax1 = fig.add_subplot(111) ax1.set_xlabel('Time in seconds') ax1.set_ylabel('Drawdown in meters') ax1.set_title(ttle) ax1.loglog(t, s, c='r', marker='+', linestyle='', label='drawdown') ax1.loglog(td, sd, c='b', marker='x', linestyle='', label='Derivative') ax1.loglog(tc, sc, c='g', label='Theis (1935) Model') ax1.loglog(tdc, sdc, c='y', label='Model derivative') ax1.grid(True) ax1.legend() plt.show() fig.savefig('thn_rapport.png', bbox_inches='tight')
def rpt(p, t, s, d, name, ttle='Interference test', Author='My name', Rapport='My Rapport', filetype='img'): '''THS_RPT - Reports graphically the results of a pumping test interpreted with the Theis (1935) model. Syntax: ths_rpt( p, t, s, d, name, ttle, Author, Rapport, filetype ) p = parameters of the model p(1) = a = slope of the straight line p(2) = t0 = intercept with the horizontal axis for s = 0 t = measured time % s = measured drawdown d(1) = q = Pumping rate d(2) = r = distance from the pumping well ttle = Title of the figure Description: Produces the final figure and results for Theis model (1935). See also: ths_dmo, ths_dim, ths_gss''' #rename the parameters for a more intuitive check of the formulas a = p[0] t0 = p[1] q = d[0] r = d[1] #Compute the transmissivity, storativity and radius of influence T = 0.1832339 * q / a S = 2.458394 * T * t0 / r**2 Ri = 2 * math.sqrt(T * t[len(t) - 1] / S) #Calls an internalscript that computes drawdown, derivative and residuals #script rpt.cmp #keep only the positive time t, s = hp.hyclean(t, s) #define regular points to plot the calculated drawdown tc = np.logspace(np.log10(t[0]), np.log10(t[len(t) - 1]), num=len(t), endpoint=True, base=10.0, dtype=np.float64) #compute the drawdown with the model if name == 'ths': sc = hp.ths.dim(p, tc) if name == 'Del': sc = hp.Del.dim(p, tc) #keep only the positive drawdown tc, sc = hp.hyclean(tc, sc) #Compute the residuals and their statistics residuals = s - hp.ths.dim(p, t) mr = np.mean(residuals) sr = 2 * np.nanstd(residuals) rms = math.sqrt(np.mean(residuals**2)) #script rpt_plt #calculate the derivative of the data td, sd = hp.ldiffs(t, s, npoints=30) #keep only positive derivatives td, sd = hp.hyclean(td, sd) #compute the derivative of the model tdc, sdc = hp.ldiff(tc, sc) #keep only positive derivatives tdc, sdc = hp.hyclean(tdc, sdc) #plots the data and model in bi-logarithmic scale if filetype == 'pdf': fig = plt.figure() fig.set_size_inches(8, 6) fig.text(0.125, 1, Author, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, 0.95, Rapport, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.05, 'Test Data : ', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.1, 'Discharge rate : {:3.2e} m³/s'.format(q), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.15, 'Radial distance : {:0.2g} m '.format(r), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.25, 'Hydraulic parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.3, 'Transmissivity T : {:3.2e} m²/s'.format(T), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.35, 'Storativity S : {:3.2e} '.format(S), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.40, 'Radius of Investigation Ri : {:0.2g} m'.format(Ri), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.5, 'Fitting parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.55, 'slope a : {:0.2g} m '.format(a), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.60, 'intercept t0 : {:0.2g} m'.format(t0), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.65, 'mean residual : {:0.2g} m'.format(mr), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.70, '2 standard deviation : {:0.2g} m'.format(sr), fontsize=14, transform=plt.gcf().transFigure) ax1 = fig.add_subplot(111) ax1.set_xlabel('Time in seconds') ax1.set_ylabel('Drawdown in meters') ax1.set_title(ttle) ax1.loglog(t, s, c='r', marker='+', linestyle='', label='drawdown') ax1.loglog(td, sd, c='b', marker='x', linestyle='', label='Derivative') ax1.loglog(tc, sc, c='g', label='Theis (1935) Model') ax1.loglog(tdc, sdc, c='y', label='Model derivative') ax1.grid(True) ax1.legend() plt.show() fig.savefig('ths_rapport.pdf', bbox_inches='tight') if filetype == 'img': fig = plt.figure() fig.set_size_inches(8, 6) fig.text(0.125, 1, Author, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, 0.95, Rapport, fontsize=14, transform=plt.gcf().transFigure) fig.text(1, 0.85, 'Test Data : ', fontsize=14, transform=plt.gcf().transFigure) fig.text(1.05, 0.8, 'Discharge rate : {:3.2e} m³/s'.format(q), fontsize=14, transform=plt.gcf().transFigure) fig.text(1.05, 0.75, 'Radial distance : {:0.2g} m '.format(r), fontsize=14, transform=plt.gcf().transFigure) fig.text(1, 0.65, 'Hydraulic parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(1.05, 0.6, 'Transmissivity T : {:3.2e} m²/s'.format(T), fontsize=14, transform=plt.gcf().transFigure) fig.text(1.05, 0.55, 'Storativity S : {:3.2e} '.format(S), fontsize=14, transform=plt.gcf().transFigure) fig.text(1.05, 0.5, 'Radius of Investigation Ri : {:0.2g} m'.format(Ri), fontsize=14, transform=plt.gcf().transFigure) fig.text(1, 0.4, 'Fitting parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(1.05, 0.35, 'slope a : {:0.2g} m '.format(a), fontsize=14, transform=plt.gcf().transFigure) fig.text(1.05, 0.3, 'intercept t0 : {:0.2g} m'.format(t0), fontsize=14, transform=plt.gcf().transFigure) fig.text(1.05, 0.25, 'mean residual : {:0.2g} m'.format(mr), fontsize=14, transform=plt.gcf().transFigure) fig.text(1.05, 0.2, '2 standard deviation : {:0.2g} m'.format(sr), fontsize=14, transform=plt.gcf().transFigure) ax1 = fig.add_subplot(111) ax1.set_xlabel('Time in seconds') ax1.set_ylabel('Drawdown in meters') ax1.set_title(ttle) ax1.loglog(t, s, c='r', marker='+', linestyle='', label='drawdown') ax1.loglog(td, sd, c='b', marker='x', linestyle='', label='Derivative') ax1.loglog(tc, sc, c='g', label='Theis (1935) Model') ax1.loglog(tdc, sdc, c='y', label='Model derivative') ax1.grid(True) ax1.legend() plt.show() fig.savefig('ths_rapport.png', bbox_inches='tight')
def rpt(p, t, s, d, name, ttle='Interference test', Author='My name', Rapport='My Rapport', filetype='img'): '''PCW_RPT - Produces the final figure and results for the Papadopulos Cooper model Syntax: hp.pcw.rpt( p, t, s, d, ttle ) p(1) = a = slope of the late time straight line p(2) = t0 = intersept of late time straight line p(3) = Cd = Well bore storage coefficient t = measured time % s = measured drawdown d(1) = Q = Pumping rate d(2) = rw = Radius of well screen d(3) = rc = Radius of the casing ttle = Title of the figure % % Description: Produces the final figure and results for the Papadopulos-Cooper model Reference: Papadopulos, I.S., and H.H.J. Cooper. 1967. Drawdown in a well of large diameter. Water Resources Research 3, no. 1: 241-244. See also: pcw_dmo, pcw_pre, pcw_dim, pcw_gss''' #rename the parameters for a more intuitive check of the formulas q = d[0] rw = d[1] rc = d[2] a = p[0] t0 = p[1] cd = p[2] #Compute the transmissivity T = 0.1832339 * q / a #Calls an internalscript that computes drawdown, derivative and residuals #script rpt.cmp tc, sc, mr, sr, rms = hp.script.cmp(p, t, s, 'pcw') #script rpt_plt #calculate the derivative of the data td, sd = hp.ldiffs(t, s, npoints=30) #keep only positive derivatives td, sd = hp.hyclean(td, sd) #compute the derivative of the model tdc, sdc = hp.ldiff(tc, sc) #keep only positive derivatives tdc, sdc = hp.hyclean(tdc, sdc) #plots the data and model in bi-logarithmic scale if filetype == 'pdf': fig = plt.figure() fig.set_size_inches(8, 6) fig.text(0.125, 1, Author, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, 0.95, Rapport, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.05, 'Test Data : ', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.1, 'Discharge rate : {:3.2e} m³/s'.format(q), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.15, 'Well radius : {:0.2g} m '.format(rw), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.20, 'Casing radius : {:0.2g} m '.format(rc), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.30, 'Hydraulic parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.35, 'Transmissivity T : {:3.1e} m²/s'.format(T), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.45, 'Fitting parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.50, 'slope a : {:0.2g} m '.format(a), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.55, 'intercept t0 : {:0.2g} m'.format(t0), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.60, 'C_D exp(2s) : {:3.1e}'.format(cd), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.66, 'mean residual : {:0.2g} m'.format(mr), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.70, '2 standard deviation : {:0.2g} m'.format(sr), fontsize=14, transform=plt.gcf().transFigure) ax1 = fig.add_subplot(111) ax1.set_xlabel('Time in seconds') ax1.set_ylabel('Drawdown in meters') ax1.set_title(ttle) ax1.loglog(t, s, c='b', marker='o', linestyle='', label='drawdown') ax1.loglog(td, sd, c='r', marker='x', linestyle='', label='Derivative') ax1.loglog(tc, sc, c='g', label='Papadopulos-Cooper (1967) Model') ax1.loglog(tdc, sdc, c='y', label='Model derivative') ax1.grid(True) ax1.legend() plt.show() fig.savefig('pcw_rapport.pdf', bbox_inches='tight') if filetype == 'img': fig = plt.figure() fig.set_size_inches(8, 6) fig.text(0.125, 1, Author, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, 0.95, Rapport, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.05, 'Test Data : ', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.1, 'Discharge rate : {:3.2e} m³/s'.format(q), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.15, 'Well radius : {:0.2g} m '.format(rw), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.20, 'Casing radius : {:0.2g} m '.format(rc), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.30, 'Hydraulic parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.35, 'Transmissivity T : {:3.1e} m²/s'.format(T), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.45, 'Fitting parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.50, 'slope a : {:0.2g} m '.format(a), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.55, 'intercept t0 : {:0.2g} m'.format(t0), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.60, 'C_D exp(2s) : {:3.1e}'.format(cd), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.66, 'mean residual : {:0.2g} m'.format(mr), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.70, '2 standard deviation : {:0.2g} m'.format(sr), fontsize=14, transform=plt.gcf().transFigure) ax1 = fig.add_subplot(111) ax1.set_xlabel('Time in seconds') ax1.set_ylabel('Drawdown in meters') ax1.set_title(ttle) ax1.loglog(t, s, c='b', marker='o', linestyle='', label='drawdown') ax1.loglog(td, sd, c='r', marker='x', linestyle='', label='Derivative') ax1.loglog(tc, sc, c='g', label='Papadopulos-Cooper (1967) Model') ax1.loglog(tdc, sdc, c='y', label='Model derivative') ax1.grid(True) ax1.legend() plt.show() fig.savefig('pcw_rapport.png', bbox_inches='tight')
def rpt(p, t, s, d, name, ttle='Interference test', Author='My name', Rapport='My Rapport', filetype='img'): '''BLT_RPT - Reports the results of the interpretation with the Boulton model Syntax: blt_rpt( p, t, s, d, ttle ) p = parameters of the model p(1) = a = slope of the straight lines p(2) = t0 = intercept with the horizontal axis the first line p(3) = t1 = intercept with the horizontal axis the second line p(4) = phi = empirical parameter that trigger the delay d(1) = q = pumping rate d(2) = r = distance between pumping well and piezometer t = measured time s = measured drawdown ttle = Title of the figure Description: Produces the final figure and results for the Boulton model (1963). See also: blt_dmo, blt_dim, blt_pre, blt_gss''' #Rename the parameters for a more intuitive check of the formulas a = p[0] t0 = p[1] t1 = p[2] phi = p[3] q = d[0] r = d[1] #Compute the transmissivity, storativity and radius of influence T = 0.1832339 * q / a S = 2.2458394 * T * t0 / r**2 omegad = 2.2458394 * T * t1 / r**2 - S Ri = 2 * math.sqrt(T * t[-1] / omegad) #Calls an internalscript that computes drawdown, derivative and residuals #script rpt.cmp tc, sc, mr, sr, rms = hp.script.cmp(p, t, s, 'blt') #script rpt_plt #calculate the derivative of the data td, sd = hp.ldiffs(t, s, npoints=30) #keep only positive derivatives td, sd = hp.hyclean(td, sd) #compute the derivative of the model tdc, sdc = hp.ldiff(tc, sc) #keep only positive derivatives tdc, sdc = hp.hyclean(tdc, sdc) #plots the data and model in bi-logarithmic scale if filetype == 'pdf': fig = plt.figure() fig.set_size_inches(8, 6) fig.text(0.125, 1, Author, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, 0.95, Rapport, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.05, 'Test Data : ', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.1, 'Discharge rate : {:3.2e} m³/s'.format(q), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.15, 'Radial distance : {:0.2g} m '.format(r), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.25, 'Hydraulic parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.30, 'Transmissivity T : {:3.1e} m²/s'.format(T), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.35, 'Storativity S : {:3.1e}'.format(S), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.40, 'Drainage Porosity : {:3.1e}'.format(omegad), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.45, 'Radius of Investigation Ri : {:0.2g} m'.format(Ri), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.55, 'Fitting parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.60, 'slope a : {:0.2g} m '.format(a), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.65, 'intercept t0 : {:0.2g} s'.format(t0), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.70, 'intercept t1 : {:0.2g} s'.format(t1), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.75, 'phi : {:0.2g} m'.format(phi), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.80, 'mean residual : {:0.2g} m'.format(mr), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.85, '2 standard deviation : {:0.2g} m'.format(sr), fontsize=14, transform=plt.gcf().transFigure) ax1 = fig.add_subplot(111) ax1.set_xlabel('Time in seconds') ax1.set_ylabel('Drawdown in meters') ax1.set_title(ttle) ax1.loglog(t, s, c='b', marker='o', linestyle='', label='drawdown') ax1.loglog(td, sd, c='r', marker='x', linestyle='', label='Derivative') ax1.loglog(tc, sc, c='g', label='Boulton (1963) Model') ax1.loglog(tdc, sdc, c='y', label='Model derivative') ax1.grid(True) ax1.legend() plt.show() fig.savefig('blt_rapport.pdf', bbox_inches='tight') if filetype == 'img': fig = plt.figure() fig.set_size_inches(8, 6) fig.text(0.125, 1, Author, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, 0.95, Rapport, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.05, 'Test Data : ', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.1, 'Discharge rate : {:3.2e} m³/s'.format(q), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.15, 'Radial distance : {:0.2g} m '.format(r), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.25, 'Hydraulic parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.30, 'Transmissivity T : {:3.1e} m²/s'.format(T), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.35, 'Storativity S : {:3.1e}'.format(S), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.40, 'Drainage Porosity : {:3.1e}'.format(omegad), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.45, 'Radius of Investigation Ri : {:0.2g} m'.format(Ri), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.55, 'Fitting parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.60, 'slope a : {:0.2g} m '.format(a), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.65, 'intercept t0 : {:0.2g} s'.format(t0), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.70, 'intercept t1 : {:0.2g} s'.format(t1), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.75, 'phi : {:0.2g} m'.format(phi), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.80, 'mean residual : {:0.2g} m'.format(mr), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.85, '2 standard deviation : {:0.2g} m'.format(sr), fontsize=14, transform=plt.gcf().transFigure) ax1 = fig.add_subplot(111) ax1.set_xlabel('Time in seconds') ax1.set_ylabel('Drawdown in meters') ax1.set_title(ttle) ax1.loglog(t, s, c='b', marker='o', linestyle='', label='drawdown') ax1.loglog(td, sd, c='r', marker='x', linestyle='', label='Derivative') ax1.loglog(tc, sc, c='g', label='Boulton (1963) Model') ax1.loglog(tdc, sdc, c='y', label='Model derivative') ax1.grid(True) ax1.legend() plt.show() fig.savefig('blt_rapport.png', bbox_inches='tight')
def rpt(p, t, s, d, name, ttle='Interference test', Author='My name', Rapport='My Rapport', filetype='img'): '''WAR_RPT - Produces the final figure and results for the Warren and Root model Syntax: hp.war.rpt( p, t, s, d, ttle ) p(1) = a = slope of Jacob Straight Line p(2) = t0 = intercept with the horizontal axis for the early time asymptote p(3) = t1 = intercept with the horizontal axis for the late time asymptote p(4) = tm = time of the minimum of the derivative t = measured time s = measured drawdown d(1) = Q = Pumping rate d(2) = r = Distance to the pumping well ttle = Title of the figure Description: Produces the final figure and results for the Warren and Root model See also: war_dmo, war_dim, war_gss''' #Rename the parameters for a more intuitive check of the formulas Q = d[0] r = d[1] a = p[0] t0 = p[1] t1 = p[2] tm = p[3] #Compute the transmissivity, storativity and radius of influence Tf = 0.1832339 * Q / a Sf = 2.245839 * Tf * t0 / r**2 Sm = 2.245839 * Tf * t1 / r**2 - Sf sigma = (t1 - t0) / t0 lambada = 2.2458394 * t0 * math.log(t1 / t0) / tm #Calls an internalscript that computes drawdown, derivative and residuals #script rpt.cmp tc, sc, mr, sr, rms = hp.script.cmp(p, t, s, 'war') #script rpt_plt #calculate the derivative of the data td, sd = hp.ldiffs(t, s, npoints=30) #keep only positive derivatives td, sd = hp.hyclean(td, sd) #compute the derivative of the model tdc, sdc = hp.ldiff(tc, sc) #keep only positive derivatives tdc, sdc = hp.hyclean(tdc, sdc) #plots the data and model in bi-logarithmic scale if filetype == 'pdf': fig = plt.figure() fig.set_size_inches(8, 6) fig.text(0.125, 1, Author, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, 0.95, Rapport, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.05, 'Test Data : ', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.1, 'Discharge rate : {:3.2e} m³/s'.format(Q), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.15, 'Radial distance : {:0.2g} m '.format(r), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.25, 'Hydraulic parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.30, 'Transmissivity Tf : {:3.1e} m²/s'.format(Tf), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.35, 'Storativity Sf : {:3.1e}'.format(Sf), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.40, 'Storativity Sm : {:3.1e}'.format(Sm), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.45, 'Interporosity flow lambda : {:0.2e}'.format(lambada), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.55, 'Fitting parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.60, 'slope a : {:0.2g} m '.format(a), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.65, 'intercept t0 : {:0.2g} s'.format(t0), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.70, 'intercept t1 : {:0.2g} s'.format(t1), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.75, 'Minimum deruvatuve tm : {:0.2g} s'.format(tm), fontsize=14, transform=plt.gcf().transFigure) ax1 = fig.add_subplot(111) ax1.set_xlabel('Time in seconds') ax1.set_ylabel('Drawdown in meters') ax1.set_title(ttle) ax1.loglog(t, s, c='b', marker='o', linestyle='', label='drawdown') ax1.loglog(td, sd, c='r', marker='x', linestyle='', label='Derivative') ax1.loglog(tc, sc, c='g', label='Warren and Root (1965) Model') ax1.loglog(tdc, sdc, c='y', label='Model derivative') ax1.grid(True) ax1.legend() plt.show() fig.savefig('war_rapport.pdf', bbox_inches='tight') if filetype == 'img': fig = plt.figure() fig.set_size_inches(8, 6) fig.text(0.125, 1, Author, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, 0.95, Rapport, fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.05, 'Test Data : ', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.1, 'Discharge rate : {:3.2e} m³/s'.format(Q), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.15, 'Radial distance : {:0.2g} m '.format(r), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.25, 'Hydraulic parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.30, 'Transmissivity Tf : {:3.1e} m²/s'.format(Tf), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.35, 'Storativity Sf : {:3.1e}'.format(Sf), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.40, 'Storativity Sm : {:3.1e}'.format(Sm), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.45, 'Interporosity flow lambda : {:0.2e}'.format(lambada), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.125, -0.55, 'Fitting parameters :', fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.60, 'slope a : {:0.2g} m '.format(a), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.65, 'intercept t0 : {:0.2g} s'.format(t0), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.70, 'intercept t1 : {:0.2g} s'.format(t1), fontsize=14, transform=plt.gcf().transFigure) fig.text(0.135, -0.75, 'Minimum deruvatuve tm : {:0.2g} s'.format(tm), fontsize=14, transform=plt.gcf().transFigure) ax1 = fig.add_subplot(111) ax1.set_xlabel('Time in seconds') ax1.set_ylabel('Drawdown in meters') ax1.set_title(ttle) ax1.loglog(t, s, c='b', marker='o', linestyle='', label='drawdown') ax1.loglog(td, sd, c='r', marker='x', linestyle='', label='Derivative') ax1.loglog(tc, sc, c='g', label='Warren and Root (1965) Model') ax1.loglog(tdc, sdc, c='y', label='Model derivative') ax1.grid(True) ax1.legend() plt.show() fig.savefig('war_rapport.png', bbox_inches='tight')