예제 #1
0
def Em(airtemp = scipy.array([]),\
       rh = scipy.array([]),\
       airpress = scipy.array([]),\
       Rs = scipy.array([])):
    '''
    Function to calculate Makkink evaporation (in mm/day). The Makkink
    evaporation is a reference crop evaporation used in the Netherlands,
    which is combined with a crop factor to provide an estimate of actual
    crop evaporation. Source: De Bruin, H.A.R.,1987. From Penman to
    Makkink', in Hooghart, C. (Ed.), Evaporation and Weather, Proceedings
    and Information. Comm. Hydrological Research TNO, The Hague. pp. 5-30.

    
    Input (measured at 2 m height):
        - airtemp: (array of) daily average air temperatures [Celsius]
        - rh: (array of) daily average relative humidity values[%]
        - airpress: (array of) daily average air pressure data [Pa]
        - Rs: (array of) average daily incoming solar radiation [J/m2/day]
   
    Output:
        - Em: (array of) Makkink evaporation values [mm]

    Examples:
        >>> Em_data = Em(T,RH,press,Rs)
        >>> Em(21.65,67.0,101300,24200000)
        4.5038304791979913
    '''
    # Calculate Delta and gamma constants
    DELTA = meteolib.Delta_calc(airtemp)
    gamma = meteolib.gamma_calc(airtemp, rh, airpress)
    Lambda = meteolib.L_calc(airtemp)
    # Determine length of array
    l = scipy.size(airtemp)
    # Check if we have a single value or an array
    if l < 2:  # Dealing with single value...
        # calculate Em [mm/day]
        Em = 0.65 * DELTA / (DELTA + gamma) * Rs / Lambda
    else:  # Dealing with an array
        # Initiate output array
        Em = scipy.zeros(l)
        for i in range(0, l):
            # calculate Em [mm/day]
            Em[i] = 0.65 * DELTA[i] / (DELTA[i] + gamma[i]) * Rs[i] / Lambda[i]
        Em = scipy.array(Em)
    return Em
예제 #2
0
def Ept(airtemp = scipy.array([]),\
        rh = scipy.array([]),\
        airpress = scipy.array([]),\
        Rn = scipy.array([]),\
        G = scipy.array([])):
    '''
    Function to calculate daily Priestley - Taylor evaporation (in mm).
    Source: Priestley, C.H.B. and R.J. Taylor, 1972. On the assessment
    of surface heat flux and evaporation using large-scale parameters.
    Mon. Weather Rev. 100:81-82.
    
    Input (measured at 2 m height):
        - airtemp: (array of) daily average air temperatures [Celsius]
        - rh: (array of) daily average relative humidity values[%]
        - airpress: (array of) daily average air pressure data [Pa]
        - Rn: (array of) average daily net radiation [J/m2/day]
        - G: (array of) average daily soil heat flux [J/m2/day]
   
    Output:
        - Ept: (array of) Priestley Taylor evaporation values [mm]

    Examples:
        >>> Ept_data = Ept(T,RH,press,Rn,G)
        >>> Ept(21.65,67.0,101300,18200000,600000)
        6.3494561161280778
    '''
    # Calculate Delta and gamma constants
    DELTA = meteolib.Delta_calc(airtemp)
    gamma = meteolib.gamma_calc(airtemp, rh, airpress)
    Lambda = meteolib.L_calc(airtemp)
    # Determine length of array
    l = scipy.size(airtemp)
    # Check if we have a single value or an array
    if l < 2:  # Dealing with single value...
        # calculate Em [mm/day]
        Ept = 1.26 * DELTA / (DELTA + gamma) * (Rn - G) / Lambda
    else:  # Dealing with an array
        # Initiate output array
        Ept = scipy.zeros(l)
        for i in range(0, l):
            # calculate Ept [mm/day]
            Ept[i] = 1.26 * DELTA[i] / (DELTA[i] +
                                        gamma[i]) * (Rn[i] - G[i]) / Lambda[i]
        Ept = scipy.array(Ept)
    return Ept
예제 #3
0
def ET0pm(airtemp = scipy.array([]),\
          rh = scipy.array([]),\
          airpress = scipy.array([]), \
          Rs = scipy.array([]),\
          N = scipy.array([]),\
          Rext = scipy.array([]),\
          u = scipy.array([]), \
          Z=0.0):
    '''
    Function to calculate daily Penman Monteith reference evaporation
    (in mm/day). Source: R.G. Allen, L.S. Pereira, D. Raes and M. Smith
    (1998). Crop evapotranspiration - Guidelines for computing crop
    water requirements - FAO Irrigation and drainage paper 56. FAO -
    Food and Agriculture Organization of the United Nations, Rome, 1998 
    
    Input (measured at 2 m height):
        - airtemp: (array of) daily average air temperatures [Celsius]
        - rh: (array of) daily average relative humidity values[%]
        - airpress: (array of) daily average air pressure data [hPa]
        - Rs: (array of) total incoming shortwave radiation [J/m2/day]
        - N: daylength [h]
        - Rext: Incoming shortwave radiation at the top of the atmosphere [J/m2/day]
        - u: windspeed [m/s]
        - Z: elevation [m], default is 0.0 m
   
    Output:
        - ET0pm: (array of) Penman Monteith reference evaporation (short grass with optimum water supply) values [mm] 

    Examples:--
        >>> Eref_data = ET0pm(T,RH,press,Rs,N,Rext,u)    
    '''
    # Set constants
    albedo = 0.23  # short grass albedo
    sigma = 4.903E-3  # Stefan Boltzmann constant J/m2/K4/d
    # Calculate Delta, gamma and lambda
    DELTA = meteolib.Delta_calc(airtemp)  # [Pa/K]
    gamma = meteolib.gamma_calc(airtemp, rh, airpress)  # [Pa/K]
    Lambda = meteolib.L_calc(airtemp)  # [J/kg]
    # Calculate saturated and actual water vapour pressures
    es = meteolib.es_calc(airtemp)  # [Pa]
    ea = meteolib.ea_calc(airtemp, rh)  # [Pa]
    # Determine length of array
    l = scipy.size(airtemp)
    # Check if we have a single value or an array
    if l < 2:  # Dealing with single value...
        Rns = (1.0 - albedo) * Rs  # Shortwave component [J/m2/d]
        # Calculate clear sky radiation Rs0
        Rs0 = (0.75 + 2E-5 * Z) * Rext  # Clear sky radiation [J/m2/d]
        f = 1.35 * Rs / Rs0 - 0.35
        epsilom = 0.34 - 0.14 * scipy.sqrt(ea / 1000)
        Rnl = f * epsilom * sigma * (airtemp +
                                     273.15)**4  # Longwave component [J/m2/d]
        Rnet = Rns - Rnl  # Net radiation [J/m2/d]
        ET0pm = (DELTA/1000.*Rnet/Lambda+900./(airtemp+273.16)*u*(es-ea)/1000\
                 *gamma/1000)/(DELTA/1000.+gamma/1000*(1.+0.34*u))
    else:  # Dealing with an array
        # Initiate output arrays
        ET0pm = scipy.zeros(l)
        Rns = scipy.zeros(l)
        Rs0 = scipy.zeros(l)
        f = scipy.zeros(l)
        epsilom = scipy.zeros(l)
        Rnl = scipy.zeros(l)
        Rnet = scipy.zeros(l)
        for i in range(0, l):
            # calculate longwave radiation component Rln (J/m2/day)
            Rns[i] = (1.0 - albedo) * Rs[i]  # Shortwave component [J/m2/d]
            # Calculate clear sky radiation Rs0
            Rs0[i] = (0.75 + 2E-5 * Z) * Rext[i]
            f[i] = 1.35 * Rs[i] / Rs0[i] - 0.35
            epsilom[i] = 0.34 - 0.14 * scipy.sqrt(ea[i] / 1000)
            Rnl[i] = f[i] * epsilom[i] * sigma * (
                airtemp[i] + 273.15)**4  # Longwave component [J/m2/d]
            Rnet[i] = Rns[i] - Rnl[i]  # Net radiation [J/m2/d]
            ET0pm[i] = (DELTA[i]/1000.*Rnet[i]/Lambda[i]+900./(airtemp[i]+273.16)* \
                       u[i]*(es[i]-ea[i])/1000*gamma[i]/1000)/ \
                      (DELTA[i]/1000.+gamma[i]/1000*(1.+0.34*u[i]))
    return ET0pm  # FAO reference evaporation [mm/day]