save_nc

Save one or more variables to a NetCDF archive file.


save_nc(fname,varargin)   %Matlab & Octave
save_nc(file, X, ...)   #R

This function loads a tag dataset from a netCDF file (this is an archival file format supported by the tagtools package and suitable for submission to online data archives). Warning: this will overwrite any previous NetCDF file with the same name. The file is assumed to be in the current working directory unless file includes file path information.

Input var Description
fname/file The name of the data and metadata file to be written. If file does not include a .nc suffix, this will be added automatically.
X An animaltag object, or a list of tag sensor and/or metadata lists. Alternatively, sensor and metadata lists may be input as multiple separate unnamed inputs. 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 save or various functions to write data to text files.
…/varargin Additional sensor or metadata lists, if user has not bundled them all into a list already but is providing individual structures.

Matlab & Octave

save_nc('dog17_124a',A,M,P,info)
%generates a file dog17_124a.nc and adds variables A, M and P, and a metadata structure.

R

savenc('dog17_124a',A,M,P,info)
     or equivalently:
savenc('dog17_124a',X=list(A,M,P,info))
#generates a file dog17_124a.nc and adds variables A, M and P, and a metadata structure.

bugs@animaltags.org Last modified: 28 July 2017

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