Exemplo n.º 1
0
def gss(t, s):
    '''THN_GSS - First guess for the parameters of the Theis model with a no-flow boundary

 Syntax: p = hp.thn.gss(t,s)

   p(1) = a  = slope of Jacob straight line 
   p(2) = t0 = intercept of the Jacob straight line 
   p(3) = ti = time of intersection between the 2 straight lines
   t    = time
   s    = drawdown

 Description:
   First guess for the parameters of theis solution with a no-flow
   boundary

 See also: thn_dmo, thn_rpt, thn_dim
'''

    #Automatic identification of the "control" points
    td, d = hp.ldiffs(t, s, npoints=10)  #First log derivative
    tdd, dd = hp.ldiffs(td, d, npoints=10)  #Second log derivative

    #Calculation of the parameters of the model
    tmp = np.amax(dd)

    tmp = np.float(tmp)
    i = np.argmax(dd)

    ti = tdd[i - 1]

    #Slope of Jacob's straight line

    a = d[-1] * 2.30 / 2

    #Origin of jacob straight line
    t0 = math.pow(10, (a * math.log10(t[-1] * t[-1] / ti) - s[-1]) / a)

    p = []

    p.append(a)
    p.append(t0)
    p.append(ti)

    return p
Exemplo n.º 2
0
Arquivo: pcw.py Projeto: merhug/hypy
def gss(t, s):
    '''PCW_GSS - First guess for the parameters of the Papadopulos Cooper solution

 Syntax: p = hp.pcw.gss(t,s)

   p(1) = a   = slope of Jacob straight line for late time
   p(2) = t0  = intercept of the Jacob straight line for late time
   p(3) = Cd  = Dimensionless coefficient (1/2alpha)

   t    = time
   s    = drawdown

 Description:
   First guess for the parameters of Papadopulos Cooper solution

 See also: pcw_dim, pcw_dmo, pcw_rpt'''

    td, d = hp.ldiffs(t, s, npoints=10)

    if d[-1] > 0:
        a = math.log(10) * d[-1]
        t0 = t[-1] * math.exp(-s[-1] / d[-1])

    else:
        p = hp.ths.gss(t, s)
        a = p[0]
        t0 = p[1]

    if t0 <= 0:
        t0 = 1e-5

    condition = (np.greater(t, 0) & np.greater(s, 0))
    sp = np.extract(condition, s)
    tp = np.extract(condition, t)

    if not tp.all():
        print(
            'HYTOOL: Error in pcw_gss - the vector t and s do not contain positive data'
        )
        p = float('NaN')
        return
    else:
        cd = 0.8905356 * d[-1] / sp[0] * tp[0] / t0

    p = []

    p.append(a)
    p.append(t0)
    p.append(cd)

    return p
Exemplo n.º 3
0
Arquivo: war.py Projeto: Pianarol/hypy
def gss(t,s):
    '''WAR_GSS - First guess for the parameters of the Warren and Root solution

 Syntax: p = war_gss(t,s)

   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    = time
   s    = drawdown

 Description: 
   First guess for the parameters of the Warren and Root solution

   See also: war_dmo, war_dim, war_rpt'''


    td,d = hp.ldiffs(t,s,npoints=40)
    
    dd = np.mean(d[len(d)-4:len(d)])
    
    a = math.log(10)*dd
    
    t0 = t[0]/math.exp(s[-1]/dd)
    
    t1 = t[-1]/math.exp(s[-1]/dd)
    
    
    i = np.argmin(d)
    

    
    
    tm = td[i-2]
    tm = np.float(tm)

    p = []
    
    p.append(a)
    p.append(t0)
    p.append(t1)
    p.append(tm)
    
    return p
Exemplo n.º 4
0
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')
Exemplo n.º 5
0
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')
Exemplo n.º 6
0
Arquivo: pcw.py Projeto: merhug/hypy
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')
Exemplo n.º 7
0
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')
Exemplo n.º 8
0
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')
Exemplo n.º 9
0
def gss(t, s):
    '''THC_GSS - First guess for the parameters of the Theis model with a constant head boundary.

 Syntax:  p = hp.thc.gss(t,s)

   p(1) = a  = slope of Jacob straight line 
   p(2) = t0 = iintercept of the first segment of straight line 
   p(3) = ti = time of intersection between the 2 straight lines

   t    = time
   s    = drawdown

 Description:
   First guess for the parameters of theis solution with a constant head
   boundary.

 See also: thc_dim, thc_dmo, thc_rpt
  '''

    td, d = hp.ldiffs(t, s, npoints=10)

    sl = np.amax(s)
    sl = np.float(sl)

    du = np.amax(d)
    du = np.float(du)
    i = np.argmax(d)

    tu = td[i]
    tu = np.float(tu)

    condition = np.greater(t, tu)
    l = np.where(condition == True)
    w = l[0][0]

    ta = t[w]

    sa = s[w]

    ts = td[-1]
    ds = d[-1]

    #Calculation of the parameters of the model

    #Dimensionless distance

    a = sl / du

    rd = ird(a)

    #Slope of Jacob's straight line
    b = sl / 2 / math.log10(rd)

    #Origin of jacob straight line
    if rd < 50:
        t0 = 2 * tu * math.log(rd) / (0.5625 * (math.pow(rd, 2) - 1))
    else:
        t0 = ta * math.pow(10, -sa / b)

    #Origin of the second line
    t1 = math.pow(rd, 2) * t0

    #Time of intersection of the two lines
    ti = math.pow(t1, 2) / t0

    p = []

    p.append(b)
    p.append(t0)
    p.append(ti)

    return p