add_nc

Add a variable to a NetCDF archive file.


add_nc(fname,X)   %Matlab & Octave
add_nc(file,X,vname=substitute(X))   #R

If the archive file does not exist, it is created. The file is assumed to be in the current working directory unless a pathname is added to the beginning of fname.Add one tag sensor or metadata variable to a NetCDF archive file.If the archive file does not exist, it is created. The file is assumed to be in the current working directory unless a pathname is added to the beginning of fname.

Input var Description Default
fname is the name of the metadata file. If the name does not include a .nc suffix, this will be added automatically.N/A
X is a sensor or metadata structure. Only these kind of variables can be saved in a NetCDF file because the supporting information in these structures is needed to describe the contents of the file. For non-archive and non-portable storage of variables, consider using the usual 'save' function in Matlab and Octave.N/A
vname (#R) The name of the sensor data stream to be saved. Defaults to the name of the sensor or metadata list provided by the user (but an option to specify a name is provided to faciliate calling this function from save_nc.substitute(X)

Matlab & Octave

add_nc('dog17_124a',A)
%generates a file dog17_124a.nc and adds a variable A.

R

add_nc('dog17_124a',A)
#generates a file dog17_124a.nc (if it does not already exist) and adds a variable A.

bugs@animaltags.org Last modified: 28 July 2017

  • tagwiki/tools/io/add_nc.txt
  • Last modified: 2017/07/31 13:06
  • by funkyfinwhale