Home > atmlab > arts > netcdf > arts_nc_write_vector.m

arts_nc_write_vector

PURPOSE ^

ARTS_NC_WRITE_VECTOR Write Vector to ARTS NetCDF file.

SYNOPSIS ^

function arts_nc_write_vector (filename, v, varargin)

DESCRIPTION ^

 ARTS_NC_WRITE_VECTOR   Write Vector to ARTS NetCDF file.

    Writes a Vector to a NetCDF file for use with Arts.

 FORMAT   arts_nc_write_vector(filename, v, varargin)
        
 IN    filename  Name of NetCDF file.
 IN    v         Vector variable.
 OPT   varargin  Cell array of name/value pair cells for global attributes

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

arts_nc_write_vector.m

SOURCE CODE ^

0001 % ARTS_NC_WRITE_VECTOR   Write Vector to ARTS NetCDF file.
0002 %
0003 %    Writes a Vector to a NetCDF file for use with Arts.
0004 %
0005 % FORMAT   arts_nc_write_vector(filename, v, varargin)
0006 %
0007 % IN    filename  Name of NetCDF file.
0008 % IN    v         Vector variable.
0009 % OPT   varargin  Cell array of name/value pair cells for global attributes
0010 
0011 % 2010-02-03   Created by Oliver Lemke.
0012 
0013 function arts_nc_write_vector (filename, v, varargin)
0014 
0015 ncid = netcdf.create (filename, 'NC_CLOBBER');
0016 
0017 attributes = optargs( varargin, { [] } );
0018 
0019 if (~isempty(attributes))
0020       addncattributes (ncid, attributes);
0021 end
0022 
0023 ndim = netcdf.defDim (ncid, 'nelem', length(v));
0024 
0025 varid = netcdf.defVar (ncid, 'Vector', 'double', ndim);
0026 
0027 netcdf.endDef (ncid);
0028 
0029 netcdf.putVar (ncid, varid, v);
0030 
0031 netcdf.close (ncid);

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005