cpc_read_rawdata: Read downloaded raw rainfall data from CPC

Description Usage Arguments Details Value Author(s) Examples

View source: R/cpc_read_rawdata.R

Description

Read downloaded raw rainfall data from CPC

Usage

1
2
3
4
5
6
7
8
cpc_read_rawdata(
  yr,
  mo,
  day,
  raw_data_path = "",
  usa = FALSE,
  write_output = FALSE
)

Arguments

yr

Year associated with the downloaded file, 1979/1948 - present

mo

Month associated with the downloaded file, 1 - 12

day

Day associated with the downloaded file, 1 - 28/29/30/31

raw_data_path

location of downloaded cpc files

usa

logical flag to indicate whether global or usa data is desired

write_output

logical flag to indicate whether binary output file should be written or not

Details

For the global data - the output matrix has 360 rows (latitudes) and 720 columns (longitudes) of rainfall/precipitation in units of mm/day; the first data point has the lat, lon values of -89.75 and 0.25 degrees, respectively; spatial resolution of the data is 0.5 degrees. For the USA data - the output matrix has 120 rows (latitudes) and 300 columns (longitudes) of rainfall/precipitation in units of mm/day; the first data point has the lat, lon values of 20.125 and 230.125 degrees, respectively; spatial resolution of the data is 0.25 degrees.

Value

RasterLayer

Author(s)

Gopi Goteti

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# CPC global data for July 4 2014
rain1 <- cpc_read_rawdata(2014, 7, 4)
print(rain1)
# CPC USA data for July 4 2014
rain2 <- cpc_read_rawdata(2014, 7, 4, usa = TRUE)
print(rain2)

## End(Not run)

raincpc documentation built on Jan. 31, 2020, 9:06 a.m.