read.WSdata: Prepares weather station data

Description Usage Arguments Details Value Author(s) References Examples

Description

Prepares weather station data

Usage

1
2
3
4
5
read.WSdata(WSdata, ..., height = 2.2, lat, long, elev, columns = c("date",
  "time", "radiation", "wind", NA, "RH", "temp", "pp"),
  date.format = "%Y-%m-%d", time.format = "%H:%M:%S",
  datetime.format = "%Y-%m-%d %H:%M:%S", tz = "", cf = c(1, 1, 1),
  MTL)

Arguments

WSdata

csv file with weather station data or data.frame

...

additional parameter to pass to read.csv()

height

weather station sensors height in meters

lat

latitude of weather station in decimal degrees. Negative values for south latitude

long

longitude of weather station in decimal degrees. Negative values for west longitude

elev

elevation of weather station in meters

columns

columns order of needed data. Vector containing "date", "time", "radiation", "wind", "RH", "temp" and "rain". Other values are ignored. If you have a column with date and time in the same column, you can include "datetime" and "date" and "time" are no longer needed.

date.format

date format. See strptime format argument.

time.format

time format. See strptime format argument.

datetime.format

datetime format. See strptime format argument.

tz

timezone of the weather station dates. If not present assumes the same timezone as the computer running the code. See strptime for details.

cf

conversion factor to convert radiation, wind, and temperature to W/m2; m/s and Celsius. See Details.

MTL

Metadata file. If not provided will look for one on working directory. If provided or present will calculate weather conditions on satellite overpass.

Details

For cf, if your data is in W/m2, km/h and Celsius (radiation, wind, temperature), cf should be: cf = c(1,0.2777778,1)

Value

waterWeatherStation object, with data.frames with all data, hourly data and conditions at satellite flyby.

Author(s)

Guillermo Federico Olmedo

References

Landsat 7 Metadata example file available from the U.S. Geological Survey. Weather Station example file courtesy of CITRA, Universidad de Talca, Chile

Examples

1
2
3
4
5
6
7
8
csvfile <- system.file("extdata", "apples.csv", package="water")
MTLfile <- system.file("extdata", "L7.MTL.txt", package="water")
WS <- read.WSdata(WSdata = csvfile, date.format = "%d/%m/%Y", 
                  lat=-35.42222, long= -71.38639, elev=201, height= 2.2,
                  MTL = MTLfile)
print(WS)
plot(WS, alldata=FALSE)
plot(WS, alldata=TRUE)


Search within the water package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.