stack_awap_cl: Parallelized code to build a raster stack from AWAP grids for...

Description Usage Arguments Value Note Examples

View source: R/stack_awap_cl.R

Description

Parallelized code to build a raster stack from AWAP grids for use in further analyses.

Usage

1
2
3
4
5
6
7
8
stack_awap_cl(
  bbox = NULL,
  stack_proj = c("+init=epsg:4283"),
  start_date = "20000131",
  variable = "FWDis",
  sequence = "monthly",
  stat = "raw"
)

Arguments

bbox

A list of coordinates defining a subregion for the raster stack

stack_proj

A projection definition for the final projected raster stack

start_date

The first month in the AWAP series to inlcude in the stack. If only interested in recent years, this will greatly improve the efficiciency.

variable

The AWAP variable to extract data for.

sequence

Monthly or Annual series

stat

Build a stack of the raw data or the percentile sequence (by monthly only).

no_cores

The number of parallel cores to use.

Value

A raster stack of CSIRO AWAP files, stacked by date.

Note

The function assumes the awap data files are in the directory raw_awap_data, which is a subdirectory of the working directory from which the function is being run (see download_awap for more details).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(parallel)
no_cores=detectCores()-1

#Define a bounding box for the city of Melbourne, Australia and surrounds
melb <- list(x = c(144.0000, 146.5000), y = c(-39.0000, -37.0000))
stack_awap_cl(bbox=melb, start_date='20130131', seq="monthly")
#South-east Queensland
seqld <- list(x = c(149, 154.000), y = c(-21.0000, -29.0000))
seq_awap <- stack_awap_cl(bbox=seqld, start_date='20130131')
writeRaster(seq_awap, filename='seq_awap.grd', bandorder='BIL', overwrite=TRUE)
vic <- list(x = c(141.0, 150.2), y = c(-34.0, -39.2))
vic_awap <- stack_awap(bbox=vic, start_date='19900131')
writeRaster(vic_awap, filename='vic_awap_1990_2014.grd', bandorder='BIL', overwrite=TRUE)

nickbond/catchstats documentation built on Nov. 22, 2019, 3:41 a.m.