%*************************************************************
% MatLAB script for reading SAGE II cloud cleared measurement HDF file:
%
% Author: Steven Marsh AOPP
% Original Copy: 23 Dec 2003
%*************************************************************


disp(['Warning: If you have moved SAGE2_MOD_020.HDF from the']) 
disp(['         current directory MatLAB  will not be able to open the'])
disp(['         file unless you modify the ''sd_id = hdfsd(...'' line'])
disp(['         in this script to reflect the new path.'])



sd_id = hdfsd( 'start', 'SAGE2_MOD_020.HDF', 'rdonly' );
[numdata, numdescr] = hdfsd('fileinfo', sd_id);    
for icnt=0:numdata-1,
   sds_id = hdfsd( 'select', sd_id, icnt);
   [ds_name, ds_ndims, ds_dims, ds_type, ds_atts, stat] = hdfsd('getinfo',sds_id);
   ds_start = zeros(1,ds_ndims);
   ds_stride = [];
   ds_edges = ds_dims; 
   disp(['Loading: 'ds_name,]) 
   eval(['['ds_name,',status]=hdfsd(''readdata'',sds_id,ds_start,ds_stride,ds_edges);'])       
end
hdfsd('end',sd_id); 
