get_gsod_apsim_met: Get GSOD data for an APSIM met file

View source: R/get_gsod_apsim_met.R

get_gsod_apsim_metR Documentation

Get GSOD data for an APSIM met file

Description

Uses get_GSOD from the GSODR package to download data to create an APSIM met file.

Usage

get_gsod_apsim_met(
  lonlat,
  dates,
  wrt.dir = ".",
  filename = NULL,
  distance = 100,
  fillin.radn = FALSE
)

Arguments

lonlat

Longitude and latitude vector

dates

date ranges

wrt.dir

write directory

filename

file name for writing out to disk

distance

distance in kilometers for the nearest station

fillin.radn

whether to fill in radiation data using the nasapower pacakge. Default is FALSE.

Details

This function requires the GSODR package.

If the filename is not provided it will not write the file to disk, but it will return an object of class ‘met’. This is useful in case manipulation is required before writing to disk.

Value

returns an object of class ‘met’ and writes a file to disk when filename is supplied.

Note

This source of data does not provide solar radiation. If ‘fillin.radn’ is TRUE it fill in radiation data using the nasapower package.

Examples

## Not run: 
require(GSODR)
## This will not write a file to disk
gsd <- get_gsod_apsim_met(lonlat = c(-93,42), dates = c("2012-01-01","2012-12-31"),
                          fillin.radn = TRUE)
summary(gsd)
## Check for reasonable ranges
check_apsim_met(gsd)

## End(Not run)


femiguez/apsimx documentation built on April 13, 2024, 12:04 a.m.