generate_wget: Generate a script to download NetCDF files

View source: R/new_functions.R

generate_wgetR Documentation

Generate a script to download NetCDF files

Description

Generate a bash script that can be run to download data from the Climatology Lab. Currently only TerraClimate is supported.

Usage

generate_wget(
  bbox,
  layers,
  startyear,
  endyear,
  db = "TerraClimate",
  writefile = TRUE,
  directory = "./"
)

Arguments

bbox

an object of class extent indicating the bounding box, in latitude and longitude, to download (i.e. min and max lon and lat)

layers

a character vector indicating which climate/weather layers to download

startyear

an integer indicating the first year of data to download

endyear

an integer indicating the last year of data to download

db

a character vector indicating which database to use; currently only TerraClimate is supported

writefile

logical; if TRUE, the resulting bash script is written locally

directory

a path to a local directory where the bash script should be written if writefile=TRUE

Details

If downloading TerraClimate data, layers should correspond to the 17 TerraClimate variables:

aet

aet: Actual Evapotranspiration, monthly total (mm)

def

def: Climate Water Deficit, monthly total (mm)

pet

pet: Potential evapotranspiration, monthly total (mm)

ppt

ppt: Precipitation, monthly total (mm)

q

q: Runoff, monthly total (mm)

soil

soil: Soil Moisture, total column - at end of month (mm)

srad

srad: Downward surface shortwave radiation (W/m2)

swe

swe: Snow water equivalent - at end of month (mm)

tmax

tmax: Max Temperature, average for month (C)

tmin

tmin: Min Temperature, average for month (C)

vap

vap: Vapor pressure, average for month (kPa)

ws

ws: Wind speed, average for month (m/s)

vpd

vpd: Vapor Pressure Deficit, average for month (kpa)

PDSI

PDSI: Palmer Drought Severity Index, at end of month (unitless)

Value

if writefile=TRUE, a .sh file in the specified directory; if writefile=FALSE, a character vector


elizagrames/climetric documentation built on Nov. 1, 2022, 6:26 a.m.