weach: Simulates the hourly conditions from daily

Description Usage Arguments Details Value Examples

Description

Manipulates weather data in the format obtained from WARM (see link below) and returns the format and units needed for most functions in this package. This function should be used for one year at a time. It returns hourly (or sub-daily) weather information.

Usage

1
2
3
4
5
6
7
weach(X,lat=40,ts=1, solar.units=c("MJ/m2"),
     temp.units=c("Fahrenheit","Celsius"),
     rh.units=c("percent","fraction"),
     ws.units=c("mph","mps"),
     pp.units=c("in","mm"),seed=1234,...)

is.leap(year)

Arguments

X

a matrix (or data frame) containing weather information. The input format is strict but it is meant to be used with the data usually obtained from weather stations in Illinois. The data frame should have 11 columns (see details).

lat

latitude at the specific location

ts

timestep for the simulation of sub-daily data from daily. For example a value of 3 would return data every 3 hours. Only divisors of 24 work (i.e. 1,2,3,4, etc.).

solar.units

Assumed units for solar radiation input.

temp.units

Option to specify the units in which the temperature is entered. Default is Farenheit.

rh.units

Option to specify the units in which the relative humidity is entered. Default is percent.

ws.units

Option to specify the units in which the wind speed is entered. Default is miles per hour.

pp.units

Option to specify the units in which the precipitation is entered. Default is inches.

...

additional arguments to be passed to lightME

year

input for the is.leap function. It checks if a year is leap or not.

seed

seed used for the random generation of the distribution for downscaling rainfall from daily to hourly.

Details

This function was originally used to transform daily data to hourly data. Some flexibility has been added so that other units can be used. The input data used originally looked as follows.

  1. col 1 year

  2. col 2 day of the year (1–365). Does not consider leap years.

  3. col 3 total daily solar radiation (MJ/m^2).

  4. col 4 maximum temperature (Fahrenheit).

  5. col 5 minimum temperature (Fahrenheit).

  6. col 6 average temperature (Fahrenheit).

  7. col 7 maximum relative humidity (%).

  8. col 8 minimum relative humidity (%).

  9. col 9 average relative humidity (%).

  10. col 10 average wind speed (miles per hour).

  11. col 11 precipitation (inches).

All the units above are the defaults but they can be changed as part of the arguments.

Value

a data.frame returning hourly (or sub-daily) weather data. Dimensions 8760 (if hourly) by 8. If it is a leap year it will be 8784 rows.

year

Year.

doy

Day of the year.

hour

Hour of the day (0–23, depending on the timestep).

SolarR

Direct solar radiation (micro mol per meter squared per second).

Temp

Air temperature (Celsius).

RH

Relative humidity (0–1).

WS

Average wind speed (meter per second).

precip

Precipitation (mm)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
## The data typically used can be obtained from
## http://www.isws.illinois.edu/warm/weather/
## I have downloaded and cleaned up the data
## For Champaign and it is available here
url <- "http://www.agron.iastate.edu/miguezlab/research/biocro/data/cmi-weather.csv"
cmi <- read.csv(url)

cmi05 <- weach(subset(cmi, year == 2005), lat=40)

## End(Not run)

BioCro documentation built on May 2, 2019, 6:15 p.m.