ReadInputs: ReadInputs raw date and climate data

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/Reading.R

Description

Load raw date and climate data, perform pre-processing, check for missing and error entries and then compile data list of daily time step.

Usage

1
2
3
4
5
6
ReadInputs(varnames, climatedata, constants, stopmissing, timestep = "daily", 
                        interp_missing_days = FALSE, 
                        interp_missing_entries = FALSE, 
                        interp_abnormal = FALSE, 
                        missing_method = NULL, 
                        abnormal_method = NULL)

Arguments

varnames

A character vector with length equals to the number of climate variables to be processed. Can include any element from: Tmax, Tmin, Temp, Tdew, RHmax, RHmin, RH, Rs, n, Cd, Precip, uz, u2, Epan, va, vs.

Each variable is detailed as below:

Tmax - daily maximum temperature in degree Celcius,
Tmin - daily minimum temperature in degree Celcius,
Temp - subdaily temperature in degree Celcius
Tdew - dew point temperature in degree Celcius, either daily or subdaily accepted,
RHmax - daily maximum relative humidity in percentage,
RHmin - daily minimum relative humidity in percentage,
RH - subdaily relative humidity in degree Celcius,
Rs - incoming solar radiation in Megajoules per square metres per day, either daily or subdaily accepted,
n - daily sunshine hour in hours,
Cd - daily cloud cover in oktas,
Precip - precipitation in millimitres, either daily or subdaily accepted,
u2 - wind speed measured at 2 metres from the ground surface in metres per second, either daily or subdaily accepted,
uz - wind speed in metres per second, either daily or subdaily accepted,
Epan - daily Class-A pan evaporation in millimitres,
va - average vapour pressure in KPa, either daily or subdaily accepted,
vs - saturated vapour pressure in KPa, either daily or subdaily accepted.

climatedata

A data frame named "climatedata" containing the raw data of date and climate variables.
The data frame must have objects named as Year, Month and Day to indicate the date.
The climate variables to include should be consistent with varnames.
In order to determine which variables are needed for ET estimation, please see ET for the specific data requirements for different formulations.

timestep

Should be either daily or subdaily to specify the time step of raw climate data used.

constants

A list named "constants" consists of constants required for data pre-processing which may contain the following items:
a_0, b_0, c_0, d_0.
These four constants which are constants required to calculate daily sunshine hours from daily cloud cover (see Equation S3.10 in McMahon et al., 2012) - if the user requires such calculation these constants must be included in "constants".
The suggested values for various Australian locations are presented in Chiew and McMahon (1991), in which the four constants are named as a0, b0, c0, d0.

stopmissing

A numeric vector of length 3:
- the first value represents the maximum percentage of missing data that the user can tolerate;
- the second value represents the maximum percentage of the duration of missing data to the total data duaration that the user can toleratre;
- the third value represents the maximum percentage of missing days (within the date data, as a fraction of the total number of days) that the user can tolerate.
All values should be numbers between 1 and 99.
The percentages of the number and duration of missing data in the date data and each input variable are compared to the corresponding threshold; if any of the threshold is exceeded the program will be terminated due to unsatisfactory data quality.

interp_missing_days

T or F, indicating if missing days (within the date data) should be interpolated, with a default of F which assigns NA to data at the missing days.

interp_missing_entries

T or F, indicating if missing data entries within individual climate variables should be interpolated, with a default of F which assigns NA to the missing entries.

interp_abnormal

T or F, if abnormal values within individual climate variables should be interpolated, with a default of F which leaves the abnormal values unchanged.
Abnormal values are defined differently according to the input variable, as following:

- Tmax > 100 or < -50 degree Celcius
- Tmin > Tmax or < -50 degree Celcius
- Temp > 100 or < -50 degree Celcius
- Tdew > 100 or < -50 degree Celcius
- RHmax > 100 or < 0 per cent
- RHmin > RHmax or < 0 per cent
- RH > 100 per cent
- Rs < 0 MJ.m^2
- n < 0 hour
- Cd < 0 Okta
- Precip < 0 mm
- uz < 0 m/s
- u2 < 0 m/s
- Epan < 0 mm
- vs < 0 KPa
- va < 0 KPa

missing_method

A character string for the name of the interpolated methods chosen for filling in missing days and missing data entries. Can be either:

monthly average - replacement with same-month average (adapted from Narapusetty et al., 2009);
seasonal average - replacement with same-season average (adapted from Narapusetty et al., 2009);
DoY average - replacement with same day-of-the-year average (Narapusetty et al., 2009);
neighbouring average - interpolation between the two bounding values, which is only suitable for time increments in which values are available at adjacent increments (McMahon et al., 2013). When there is more than one consecutive missing entry, this interpolation fails, with a warning given.

abnormal_method

A character string for the name of the interpolated methods chosen for replacing data entries with abnormal values. Can be either:

monthly average - replacement with same-month average (adapted from Narapusetty et al., 2009);
seasonal average - replacement with same-season average (adapted from Narapusetty et al., 2009);
DoY average - replacement with same day-of-the-year average (Narapusetty et al., 2009);
neighbouring average - interpolation between the two bounding values, which is only suitable for time increments in which non-abnormal values are available at adjacent increments (McMahon et al., 2013). When there is more than one consecutive abnormal entry, this interpolation fails, with a warning given.

Value

This function returns a list with all components of class zoo which have been processed from the raw data, including:

Date.daily

A zoo object containing the date in daily step in the format of yyyy-mm-dd.

Date.monthly

A zoo object containing the date in daily step in the format of mmm-yyyy.

J

A zoo object containing the Julian Day for every day during the period that the data spans.

i

A zoo object containing the month number for every day during the period that the data spans.

ndays

A zoo object containing the number of days for every month during the period that the data spans.

Tmax

A zoo object containing the daily maximum temperatures in degree Celcius.

Tmin

A zoo object containing the daily minimum temperatures in degree Celcius.

u2

A zoo object containing the daily wind speed at 2m from the ground in m/s.

uz

A zoo object containing the daily wind speed measured at the height of wind instrument in m/s.

Rs

A zoo object containing the daily solar radiation in MJ/m^2/day.

n

A zoo object containing the daily sunshine hours.

Cd

A zoo object containing the daily cloud cover in oktas.

Precip

A zoo object containing the daily precipitation in mm.

Epan

A zoo object containing the daily Class-A pan evaporation in mm.

RHmax

A zoo object containing the daily maximum relative humidity in percentage.

RHmin

A zoo object containing the daily minimum relative humidity in percentage.

Tdew

A zoo object containing the average daily dew temperatures in degree Celcius.

Note that the components might have value of NULL when the corresponding input variable cannot be found in the raw data (i.e. "climatedata").

Author(s)

Danlu Guo

References

McMahon, T., Peel, M., Lowe, L., Srikanthan, R. & McVicar, T. 2012. Estimating actual, potential, reference crop and pan evaporation using standard meteorological data: a pragmatic synthesis. Hydrology and Earth System Sciences Discussions, 9, 11829-11910.

Chiew, F. H. & McMahon, T. A. 1991. The applicability of Morton's and Penman's evapotranspiration estimates in rainfall-runoff modeling1. JAWRA Journal of the American Water Resources Association, 27, 611-620.

Narapusetty, B., DelSole, T.Tippett, M.K. 2009, Optimal Estimation of the Climatological Mean. Journal of Climate, vol. 22, no. 18, pp. 4845-4859.

See Also

ET,climatedata,data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# ReadInputs climate data
data("climatedata")
data("constants")
data <- ReadInputs(varnames = c("Temp","Tdew","n","RH","uz"),
                   climatedata, 
                   constants, 
                   stopmissing=c(10,10,3),
                   timestep = "subdaily",
                   interp_missing_days = FALSE, 
                   interp_missing_entries = FALSE, 
                   interp_abnormal = FALSE, 
                   missing_method = NULL, 
                   abnormal_method = NULL)

Evapotranspiration documentation built on July 19, 2017, 9:01 a.m.