function X = readseadas(FileName)
% READSEADAS

%==============
% Get FileName
%==============
if ~nargin
   d = dir;
   d = {d.name};
   [i OK] = listdlg('PromptString','Select a file:',...
      'ListString',d);
   if OK == 0 
      return
   end
   FileName = char(d(i))
else
   FileName = getfname(FileName);
end

% Loop through and read the files
[r c] = size(FileName);
for i = 1:r
   FileName(i,:)
   fid = fopen(deblank(FileName(i,:)),'rt');
  
   % Read header
   s = fgetl(fid);   % Empty
   s = fgetl(fid);   % Empty
   s = fgetl(fid);   % Source Image filename
   StartYear = sscanf(s(18:21),'%f');
   EndYear   = sscanf(s(25:28),'%f');
   StartDay  = sscanf(s(22:24),'%f');
   EndDay    = sscanf(s(29:31),'%f');
   Start     = jul2date(StartDay,StartYear);
   Finish    = jul2date(EndDay,EndYear);
   s = fgetl(fid);   % Empty
   s = fgetl(fid);   % Empty
   s = fgetl(fid);   % Empty
   s = fgetl(fid);   % Empty
   s = fgetl(fid);   % Empty
   s = fgetl(fid);   % Empty
   
   if i == 1
      n = 0;
   end
   
   while ~feof(fid)
      
      s = fgetl(fid);
      if length(s) > 56
         n = n + 1;
         X(n,1) = Start;
         X(n,2) = Finish;
         X(n,3) = sscanf(s(28:35),'%f');
         X(n,4) = sscanf(s(38:45),'%f');
         X(n,5) = sscanf(s(62:69),'%f');
      end
      
   end
   fclose(fid)
   
end

