function [data] = read_mod35(filename)

% Read MODIS Level 03 HDF product file 
%
% Input
%   filename -- Data file names
%
% Output: data -- cloudmask
%                 -1 = Not Useful (from QA) 
%		   0 = 99% Probability of clear
%		   1 = 95% Probability of clear
%		   2 = 66% Probability of clear
%                  3 = Cloud
%

data = [];
for n = 1:length(filename)
  tmp = readModisCloudMask(filename{n}, [1 1]);
  data = [data tmp.byte1.mask];
end

ind = find(isnan(data) == 1);
data(ind) = -1;
ind = find(data==-1);
data = 3 - data;
data(ind) = -1;
