function [data] = read_mod1b(filename, band)

% Read a single band from a MODIS Level 1B HDF product file at 1000, 500, or 250 m resolution.
%
% Input
%   filename -- Name of MODIS Level 1B HDF File; string
%   band -- (integer) Band number to be read (1-36 for 1000 m, 1-7 for 500 m, 1-2 for 250m)
%
% Output: the same as function 'modis_level1b_read'
%

plotImage = 0;

varStr = getVar(band);

data = [];
for n = 1:length(filename)
  s=['imagedata = modis_level1b_read(filename{n},band,{' varStr '});'];
  eval(s);
  tmp = imagedata.mimage;
  data = [data, tmp];
end

if plotImage
  figure
  imagesc(data)
  colorbar
  title(['Band ' num2str(band)])
end
