downscaleNcdf function

Downscale NetCDF file

Downscale NetCDF file

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)

Returns

A downscaled hyfo list file.

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/

References

Other functions in hyfo

Related functions from the same R package

  • Maintainer: Yuanchao Xu
  • License: GPL-2
  • Last published: 2023-08-16