Home > atmlab > datasets > +satreaders > netcdf_dataset.m

netcdf_dataset

PURPOSE ^

read homegrown netcdf-stored dataset such as dardarsub, CMIWP, ...

SYNOPSIS ^

function S = netcdf_dataset(ds, file, varargin)

DESCRIPTION ^

 read homegrown netcdf-stored dataset such as dardarsub, CMIWP, ...

 format as other satreaders.-functions.

 For info on the common format, see <a href="matlab:help SatDataset/reader">SatDataset/reader</a>.

 $Id: satreaders.dardarsub.m 7600 2012-05-14 13:21:10Z seliasson $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

netcdf_dataset.m

SOURCE CODE ^

0001 function S = netcdf_dataset(ds, file, varargin)
0002     % read homegrown netcdf-stored dataset such as dardarsub, CMIWP, ...
0003     %
0004     % format as other satreaders.-functions.
0005     %
0006     % For info on the common format, see <a href="matlab:help SatDataset/reader">SatDataset/reader</a>.
0007     %
0008     % $Id: satreaders.dardarsub.m 7600 2012-05-14 13:21:10Z seliasson $
0009 
0010     core_fields   = {'time','lat','lon'};
0011     extra_fields  = optargs(varargin, {{}});
0012     all_fields    = [core_fields(:); extra_fields(:)];
0013 
0014     [S, attr] = loadncvar(file, all_fields);
0015     %C(1:2*length(attr)) = deal([attr{:}]);
0016     %strattr = struct(C{:});
0017     strattr = attr;
0018     
0019     % get additional stuff
0020     info = ds.find_info_from_granule(file);
0021     
0022     if isfield(info, 'doy')
0023         date = dayofyear_inverse(str2double(info.year), str2double(info.doy));
0024         date = [date.year date.month date.day];
0025     else
0026         date = [str2double(info.year) str2double(info.month) str2double(info.day)];
0027     end
0028     S.epoch = round(date2unixsecs(date(1), date(2), date(3)));
0029     
0030     S.path = file;
0031     S.version = strattr.version;
0032 
0033     S = MaskInvalidGeoTimedataWithNaN(S);
0034 end

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