Get POWER values for a single point or region and create an ICASA format text file suitable for use in DSSAT for crop modelling; saving it to local disk.
create_icasa(lonlat, dates, dsn, file_out)
lonlat | A numeric vector of geographic coordinates for a cell or region entered as x, y coordinates. See argument details for more. |
---|---|
dates | A character vector of start and end dates in that order, |
dsn | A file path where the resulting text file should be stored. |
file_out | A file name for the resulting text file, e.g. "Kingsthorpe.txt". A ".txt" extension will be appended if not or otherwise specified by user. |
A text file in ICASA format saved to local disk for use in DSSAT crop modelling.
This function is essentially a wrapper for get_power
that queries the POWER API and writes a DSSAT
ICASA weather file to disk. All necessary pars
are
automatically included in the query.
Further details for each of the arguments are provided in their respective sections following below.
lonlat
To get a specific cell, 1/2 x 1/2 degree, supply
a length-2 numeric vector giving the decimal degree longitude and latitude
in that order for data to download,
e.g., lonlat = c(151.81, -27.48)
.
To get a region, supply a length-4 numeric
vector as lower left (lon, lat) and upper right (lon, lat) coordinates,
e.g., lonlat = c(xmin, ymin, xmax, ymax)
in that order for a given
region, e.g., a bounding box for the southwestern corner of Australia:
lonlat = c(112.5, -55.5, 115.5, -50.5)
. Max bounding box is 10 x 10
degrees of 1/2 x 1/2 degree data, i.e., 100 points maximum in total.
dates
If dates
is unspecified, defaults to
a start date of 1983-01-01 (the earliest available data) and an end date of
current date according to the system. If one date only is provided, it will
be treated as both the start date and the end date and only a single day's
values will be returned.
create_met
Create an APSIM met File from
NASA POWER Data
# Create an ICASA file for Kingsthorpe, Qld from 1985-01-01 to 1985-06-30 # and save it in the current R session tempdir as "ICASA_example.txt".create_icasa(lonlat = c(151.81, -27.48), dates = c("1985-01-01", "1985-12-31"), dsn = tempdir(), file = "ICASA_example.txt" )