downscaleNcdf: Downscale NetCDF file

View source: R/ncdf.R

downscaleNcdfR Documentation

Downscale NetCDF file

Description

Downscale NetCDF file

Usage

downscaleNcdf(gridData, year = NULL, month = NULL, lon = NULL, lat = NULL)

Arguments

gridData

A hyfo list file from loadNcdf

year

A vector of the target year. e.g. year = 2000, year = 1980:2000

month

A vector of the target month. e.g. month = 2, month = 3:12

lon

A vector of the range of the downscaled longitude, should contain a max value and a min value. e.g. lon = c(-1.5, 2,5)

lat

A vector of the range of the downscaled latitude, should contain a max value and a min value. e.g. lat = c(32,2, 36)

Value

A downscaled hyfo list file.

References

  • Santander MetGroup (2015). ecomsUDG.Raccess: R interface to the ECOMS User Data Gateway. R package version 2.2-6. http://meteo.unican.es/ecoms-udg

Examples

# First open the test NETcDF file.
filePath <- system.file("extdata", "tnc.nc", package = "hyfo")


# Then if you don't know the variable name, you can use \code{getNcdfVar} to get variable name
varname <- getNcdfVar(filePath)

nc <- loadNcdf(filePath, varname)

# Then write to your work directory

nc1 <- downscaleNcdf(nc, year = 2006, lon = c(-2, -0.5), lat = c(43.2, 43.7))
nc2 <- downscaleNcdf(nc, year = 2005, month = 3:8, lon = c(-2, -0.5), lat = c(43.2, 43.7))

# More examples can be found in the user manual on https://yuanchao-xu.github.io/hyfo/


hyfo documentation built on Aug. 16, 2023, 5:08 p.m.