nasapower (version 1.1.3)

create_met: Create an APSIM met file from POWER data

Description

Get POWER values for a single point or region and create an APSIM met file suitable for use in APSIM for crop modelling; saving it to local disk.

Usage

create_met(lonlat, dates, dsn, file_out)

Value

A text file in met format saved to local disk for use in APSIM crop modelling.

Argument details for <code>lonlat</code>

For a single point

To get a specific cell, 1/2 x 1/2 degree, supply a length-two numeric vector giving the decimal degree longitude and latitude in that order for data to download, e.g., lonlat = c(151.81, -27.48).

For regional coverage

To get a region, supply a length-four 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.

Argument details for <code>dates</code>

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.

Details

This function is essentially a wrapper for get_power prepareMet and writeMetFile that simplifies the querying of the POWER API and writes the met to local disk.

The weather values from POWER for temperature are 2 metre max and min temperatures, “T2M_MAX” and “T2M_MIN”; radiation, “ALLSKY_SFC_SW_DWN”; and rain, “PRECTOT” from the POWER AG community on a daily time-step.

Further details for each of the arguments are provided in their respective sections following below.

See Also

create_icasa Create a DSSAT ICASA File from NASA POWER Data

Examples

Run this code
# NOT RUN {
# Create a met file for Kingsthorpe, Qld
# from 1985-01-01 to 1985-06-30 and
# save it in the current R session
# tempdir() as `APSIM_example.met`

# }
# NOT RUN {
create_met(lonlat = c(151.81, -27.48),
           dates = c("1985-01-01", "1985-12-31"),
           dsn = tempdir(),
           file_out = "APSIM_example.met"
           )
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace