function stationGrid(dataFilt, column, depth)

% Brian Schlining
% 13 Apr 2000

switch nargin
case 0
   fprintf(1, 'No input arguments were specified\n Use as stationGrid(filename, Column)\n')
   return
case 1
   column = 2;
   depth = 0;
case 2
   depth = 0;
end

%*********************
% Load the data files
%*********************
filenames = getfname(dataFilt);
if isempty(dataFilt)
   warning([' No data files were found.'])
   return
end

[r c] = size(filenames);

n = 0;
x = [];
count = 0;
while (n < r)
   
   n        = n + 1;
   [p f e]  = fileparts(deblank(filenames(n,:)));
   filename = [f e];
   fprintf(1, '  Loading %s ...', filename);
   warning off
   lat = stringtokenizer(filename, 2, '_');
   lon = stringtokenizer(filename, 3, '_');
   warning on
   
   if isempty(lat) | isempty(lon)
      fprintf(1, ' station location not found ...') 
      fprintf(1, ' loading aborted\n');
   else
      
      data = load(deblank(filenames(n,:)));
      
      [rf cf] = size(data);
      if cf < column
         fprintf(1, ' only contains %i columns ...', cf)
         fprintf(1, ' loading aborted\n');
      else
         count      = count + 1;
         x(count,1) = sscanf(lon, '%f');
         y(count,1) = sscanf(lat, '%f');
         
         ZZ         = data(:,1);
         row        = near(ZZ, depth);
         z(count,1) = data(row, column);
         
         fprintf(1, ' completed\n');
         
      end
      
   end
   
end
z(find(z == -100)) = mean(z(1:4));

%***************
% Create a plot
%***************
if ~isempty(x)
   %tri = delaunay(x(:,1), x(:,2));
   %trisurf(tri,x(:,1),x(:,2),x(:,3));
   XI = [min(x):(max(x) - min(x))./100:max(x)];
   YI = [min(y):(max(y) - min(y))./100:max(y)]';
   ZI = griddata(x,y,z,XI,YI, 'cubic');
   surf(XI,YI,ZI)
   shading interp
   view(2)
   hold on
   ZLim = get(gca, 'ZLim');
   plot3(x, y, ones(size(z))*(max(ZLim)+1), 'k.')
   load CST
   plot3(CST(:,1), CST(:,2), ones(size(CST(:,1)))*100, 'k')
   hold off
   colorbar2
   axis equal
end


