% editnav

ibad = find( (LON == 0.0 & LAT == 0.0) | abs(LON) > 180.0 | abs(LAT) > 90.0);
LON(ibad) = NaN * ibad;
LAT(ibad) = NaN * ibad;

% check for dateline crossings
dlon = abs(diff(LON));
ibig = find(dlon > 180);
if ~isempty(ibig)
  ineg = find(LON < 0);
  LON(ineg) = LON(ineg) + 360;
end


