generate_monthly_statistics.zip

  • xiaoziran
    了解作者
  • matlab
    开发工具
  • 387KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 10 积分
    下载积分
  • 12
    下载次数
  • 2018-12-06 19:21
    上传日期
calipso二级气溶胶AOD月平均廓线
generate_monthly_statistics.zip
  • CAL_LID_L2_05kmALay-Prov-V3-01.2010-08-02T12-23-59ZD.hdf_sub.hdf
    367.1KB
  • CAL_LID_L2_05kmALay-Prov-V3-01.2010-08-02T01-44-08ZN.hdf_sub.hdf
    366.6KB
  • readHDF.m
    5.7KB
  • get_feature_type_and_subtype.m
    2KB
  • CAL_LID_L2_05kmALay-Prov-V3-01.2010-08-01T13-19-41ZD.hdf_sub.hdf
    367.1KB
  • CAL_LID_L2_05kmALay-Prov-V3-01.2010-08-01T01-01-00ZN.hdf_sub.hdf
    366.6KB
  • CAL_LID_L2_05kmALay-Prov-V3-01.2010-08-02T00-05-18ZN.hdf_sub.hdf
    366.6KB
  • generate_monthly_statistics.m
    5.7KB
  • CAL_LID_L2_05kmALay-Prov-V3-01.2010-08-01T11-40-46ZD.hdf_sub.hdf
    367.1KB
  • CAL_LID_L2_05kmALay-Prov-V3-01.2010-08-01T02-39-50ZN.hdf_sub.hdf
    47.3KB
内容介绍
function [info var]=readHDF(filename,parameter,start,edges,stride) % Function readHDF % Uses the low-level hdf (hdfsd) routines to read data from a hdf data file. % Inputs: % filename (string) - The name of the file to read. The entire path should be supplied % unless the file is in the current working directory. % parameter(string ) - This is the name of the SDS that you want to read in. % % Optional inputs: % % start (vector) - This contains the staring index to begin reading for each % dimension (e.g. [0 0] for the beginning of the file). % edges (vector) - The number of elements to read in for each dimension. If any of the % values for edges is -9 it will read in all the values for that % dimension. % stride (vector) - The number of elements to skip for each dimension. % % Example: % To read in the first 100x583 elements from an sds do the following, % >[info data] = readHDF('/Users/JoeUser/Data/MY_HDF_FILENAME.hdf,'MY_SDS_NAME_HERE',[0 0],[100 583]); info.stat = 0; var = ''; if nargin ~= 2 & nargin ~=4 & nargin ~=5, error('Either 2 or 4 inputs are required'); end if (~exist(filename,'file')) error('The file %s does not exist!',filename); return; end try sd_id = hdfsd('start',filename,'DFACC_RDONLY'); [ndatasets, nglobal_atts, stat] = hdfsd('fileinfo',sd_id); if (stat ~=0), info.stat = stat; var = ''; fprintf('Error: An error was encountered while trying to open the file for reading:\n%s\n',filename); hdfml('closeall'); return; elseif ndatasets == 0, info.stat = -2; var = ''; fprintf('Error: No data sets were found in the file:\n%s\n',filename); hdfml('closeall'); return; end catch hdfml('closeall'); error('The file %s could not be opened.',filename); end try % Find the sds in the file iSDS = -1; iSDS = hdfsd('nametoindex',sd_id,parameter); if iSDS == -1, info.stat = -3; var = ''; fprintf('The dataset(%s) in file could not be found:\n%s\n',parameter,filename); stat = hdfsd('end',sd_id); return; end sds_id = hdfsd('select',sd_id,iSDS); [ds_name, ds_ndims, ds_dims, ds_type, ds_atts, stat] = hdfsd('getinfo',sds_id); if (stat ~=0) info.stat = stat; var = ''; fprintf('Error: An error was encountered while trying to getinfo from`the sds (%d)\n in the file %s.\n',sds_id,filename); hdfml('closeall'); return; end % for i=1:ndatasets, % sds_id = hdfsd('select',sd_id,i); % [ds_name, ds_ndims, ds_dims, ds_type, ds_atts, stat] = hdfsd('getinfo',sds_id); % if (stat ~=0) % info.stat = stat; % var = ''; % fprintf('Error: An error was encountered while trying to getinfo from`the sds (%d)\n in the file %s.\n',sds_id,filename); % hdfml('closeall'); % return; % end % if strcmp(ds_name, parameter), % iSDS = i; % break; % end; % stat = hdfsd('endaccess',sds_id); % end % if iSDS == -1, % info.stat = -3; % var = ''; % fprintf('The dataset(%s) in file could not be found:\n%s\n',parameter,filename); % hdfml('closeall'); % return; % end catch hdfml('closeall'); error('An error was encountered while trying to read and select a dataset\nfrom file %s',filename); end % Determine the size of the SDS info.nElements = max(ds_dims); if nargin ==2, ds_start = zeros(1,ds_ndims); % Creates the vector [0 0] ds_stride = []; ds_edges = ds_dims; elseif nargin >= 4, if ~exist('stride') ds_stride = []; stride = ones(size(start)); end if length(start) ~= ds_ndims, start ds_ndims error('The number of start indices are incorrect'); end if length(edges) ~= ds_ndims, edges ds_ndims error('The number of end indices are incorrect'); end for i=1:ds_ndims, if start(i) > ds_dims(i) fprintf('start(%d)=%d > %d\n',i,start(i),ds_dims(i)) error('The start index exceeds the number of elements in the dimension. '); end % This is a special case that will read to the end of the file if (edges(i) == -9) edges(i) = floor((ds_dims(i) - start(i))/stride(i)); end %[start(i) edges(i) stride(i)] foo2 = (start(i)+edges(i))/stride(i); if foo2 > ds_dims(i) fprintf('(start(%d) + edges(%d) )=%d > %d\n',i,i,start(i)+edges(i),ds_dims(i)) error('The number of elements to read exceeds the number of elements in the dimension.'); end end ds_start = start; ds_stride = stride; ds_edges = edges; else error('Wrong number of arguments'); % Should never happen end % Save the sds information info.ds_name = ds_name; info.ds_ndims = ds_ndims; info.ds_dims = ds_dims; info.ds_type = ds_type; info.ds_attr = ds_atts; info.ds_start = ds_start; info.ds_edges = ds_edges; info.ds_stride = ds_stride; % Read the data [var, stat] = hdfsd('readdata',sds_id,ds_start,ds_stride,ds_edges); if (stat ~=0) info.stat = stat; var = ''; fprintf('Error: An error was encountered while trying to read from`the sds (%d)\n in the file %s.\n',sds_id,filename); hdfml('closeall'); return; end % Reverse the data rows->columns, this now how hdfread would present it. % This is only for backward compatibility witht the previous version of readHDF if info.ds_ndims == 2, var = var'; end % Close access to the file stat = hdfsd('endaccess',sds_id); stat = hdfsd('end',sd_id);
评论
    相关推荐
    • matlabcnhelp.rar
      matlab中文帮助很难找的,快速下载
    • MobilePolice.rar
      移动警察,车牌识别,车牌定位系统源代码,已经运用在移动车载稽查系统中。
    • SVM(matlab).rar
      支持向量机(SVM)实现的分类算法源码[matlab]
    • svm.zip
      用MATLAB编写的svm源程序,可以实现支持向量机,用于特征分类或提取
    • Classification-MatLab-Toolbox.rar
      模式识别matlab工具箱,包括SVM,ICA,PCA,NN等等模式识别算法,很有参考价值
    • VC++人脸定位实例.rar
      一个经典的人脸识别算法实例,提供人脸五官定位具体算法及两种实现流程.
    • QPSK_Simulink.rar
      QPSK的Matlab/Simulink的调制解调仿真系统,给出接收信号眼图及系统仿真误码率,包含载波恢复,匹配滤波,定时恢复等重要模块,帮助理解QPSK的系统
    • LPRBPDemo2009KV.rar
      车牌识别,神经网络算法,识别率高达95%,识别时间低于80ms。
    • MODULATION.RAR
      这个源程序代码包提供了通信系统中BPSK,QPSK,OQPSK,MSK,MSK2,GMSK,QAM,QAM16等调制解调方式 用matlab的实现,以及它们在AWGN和Rayleigh信道下的通信系统实现及误码率性能
    • algorithms.rar
      十大算法论文,包括遗传算法,模拟退火,蒙特卡罗法等等,对于初学者很有帮助!!