Functions to write point meteorological data to disk files in different formats.
writemeteorologypoint(data, file, format = "meteoland/txt")
writemeteorologypointfiles(object, dir=getwd(), format = "meteoland/txt",
metadataFile="MP.txt")
writemeteorologypoints(object, file, format = "netCDF",
add = FALSE, overwrite = FALSE, verbose = FALSE)
An data frame with meteorological data.
A string with the file name to be written.
Output format of meteorological data. Current accepted formats are "meteoland/txt"
, "meteoland/rds"
, "castanea/txt"
and "castanea/rds"
.
An object of class SpatialPointsMeteorology-class
with the meteorological data to be written.
Output directory for meteorology data.
The name of the file that will store the meta data describing all written files.
Boolean flag to indicate that NetCDF exists and data should be added/replaced (see details).
Boolean flag to force overwriting an existing NetCDF.
A logical flag to output process information in the console.
Miquel De Cáceres Ainsa, CREAF
Nicolas Martin, INRA-Avignon
Function writemeteorologypoint
writes data series of a single location (i.e. a data frame) to ascii or rds files. Function writemeteorologypointfiles
takes an object of SpatialPointsMeteorology-class
and writes one file for each data point in the same formats as writemeteorologypoint
. In addition, it writes a metadata file (see argument metadataFile
) with point coordinates, station names and file names. Both functions share the same accepted formats, which are "meteoland/txt"
, "meteoland/rds"
, "castanea/txt"
and "castanea/rds"
.
Function writemeteorologypoints
takes an object of SpatialPointsMeteorology-class
and writes all its content in a single file (i.e. a netCDF). The same function can be used to replace data from an existing file or to add new points to the netCDF. This is done by using add=TRUE
, and profits from the fact that some netCDF dimensions (in this case the number of points) can be defined as unlimited. If data is added to an existing netCDF, the coordinate reference system and the dates of object
must be the same as those in the netCDF.
readmeteorologypoint
, SpatialPointsMeteorology-class