View source: R/cdtCreateDataset_NCmultiDim.R
cdtDataset_readData_multiDim | R Documentation |
Create CDT dataset from a multidimensional netCDF data.
cdtDataset_readData_multiDim(
cdtdata_info,
netcdf_data,
ncvar_info,
extra_ncdim = NULL,
conversion_fun = NULL,
bbox = NULL,
chunk = list(size = 100, fac = 5)
)
cdtdata_info |
named list, providing the information about the CDT dataset.
|
netcdf_data |
named list, providing the input netCDF data to be converted to a CDT dataset format.
|
ncvar_info |
named list, providing the name of the variable and longitude, latitude, time of the netCDF data.
|
extra_ncdim |
named list, providing the values of the dimensions other than the longitude,
latitude and time to be extracted if the netCDF data contains more than 3 dimensions. For example,
if the data has a pressure level (dimension name |
conversion_fun |
a function to transform the data or to convert the units. |
bbox |
named list, providing the region to be extracted in the form |
chunk |
named list containing the size of the chunk |
A directory named after the element name
of cdtdata_info
, containing the CDT dataset.
## Not run:
cdtdata_info <- list(dir = "~/CDTDATASET/MERRA2", name = "PRECIP")
netcdf_data <- list(timestep = 'daily', dir = "~/DATA/MERRA2/daily_precip", format = 'merra-2_precip_%S.nc')
ncvar_info <- list(varid = 'precip', lon_dim = 'lon', lat_dim = 'lat', time_dim = 'time')
convert_units <- function(x){
# kg m-2 s-1 to mm day-1
x * 86400
}
CDT::cdtDataset_readData_multiDim(cdtdata_info, netcdf_data, ncvar_info, conversion_fun = convert_units)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.