-
Notifications
You must be signed in to change notification settings - Fork 6
/
writeNcdf.Rd
64 lines (49 loc) · 1.95 KB
/
writeNcdf.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ncdf.R
\name{writeNcdf}
\alias{writeNcdf}
\title{Write to NetCDF file using hyfo list file}
\usage{
writeNcdf(gridData, filePath, missingValue = 1e+20, tz = "GMT",
units = NULL, version = 3)
}
\arguments{
\item{gridData}{A hyfo list file from \code{\link{loadNcdf}}}
\item{filePath}{A path of the new NetCDF file, should end with ".nc"}
\item{missingValue}{A number representing the missing value in the NetCDF file, default
is 1e20
#' @param tz A string representing the time zone, default is GMT, if you know what time zone is
you can assign it in the argument. If \code{tz = ''}, current time zone will be taken.}
\item{tz}{time zone, default is "GMT"}
\item{units}{A string showing in which unit you are putting in the NetCDF file, it can be
seconds or days and so on. If not specified, the function will pick up the possible largest
time units from \code{c('weeks', 'days', 'hours', 'mins', 'secs')}}
\item{version}{ncdf file versions, default is 3, if 4 is chosen, output file will be foreced to version 4.}
}
\value{
An NetCDF version 3 file.
}
\description{
Write to NetCDF file using 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
\dontrun{
writeNcdf(nc, 'test.nc')
}
# More examples can be found in the user manual on https://yuanchao-xu.github.io/hyfo/
}
\references{
\itemize{
\item David Pierce (2015). ncdf4: Interface to Unidata netCDF (Version 4 or
Earlier) Format Data Files. R package version 1.14.1.
https://CRAN.R-project.org/package=ncdf4
\item Santander MetGroup (2015). ecomsUDG.Raccess: R interface to the ECOMS User Data Gateway. R package
version 2.2-6. https://meteo.unican.es/ecoms-udg
}
}