function XI = gridfsi(X, timeLim1, timeLim2)
% GRIDFSI   - Grids FSI data onto an evenly spaced 3-D mesh

% Brian Schlining
% 25 Jul 2000

fprintf(1, 'Gridding data from %s...', X.filename);

incDeg = 0.0167; 
incZ   = 2;

% Calculate the 3-d grid points
minLat = min(X.lat);
maxLat = max(X.lat);
minLon = min(X.lon);
maxLon = max(X.lon);
minZ   = min(X.depth);
maxZ   = max(X.depth);
[lonI, latI, zi] = meshgrid([minLon:incDeg:maxLon], [minLat:incDeg:maxLat], [minZ:incZ:maxZ]);

                                       % About 1nautical mile horizontal icrement for the grid
for z = min(X.depth):inc:max(X.Depth)                   % Loop through all depths by 2m increments
   good = find((X.depth >= z) & (X.depth < (z + inc)));  % Find all points in this 2m bin 
   
   
end

