function [data] = read_mod03_geo(filename)

% Read geolocation fields from a MODIS Level 03 HDF product file 
% at 1000m resolution.
%
% Input
%   filename -- Data file name
%
% Output: data.Latitude, data.Longitude
%

n = 1;
tmp = readProductsFromMod03(filename{n},{'latitude','longitude'});

names = fieldnames(tmp);
for m = 1:length(names)
  s = [names{m} ' = tmp.' names{m} ';'];
  eval(s);
end

for n = 2:length(filename)
  tmp = readProductsFromMod03(filename{n},{'latitude','longitude'});
  for m = 1:length(names)
    s = [names{m} ' = [' names{m} ',  tmp.' names{m} '];'];
    eval(s);
  end
end

for m = 1:length(names)
  s = ['data.' names{m} ' = ' names{m} ';'];
  eval(s);
  s = ['clear ' names{m} ';'];
  eval(s);
end
