The ISO metadata records generated by ncISO are incorrect for many CDIP time series, because ncISO is computing the bounds from the first variables it finds with standard_name of longitude and latitude. Below we show that the gpsLatitude and gpsLongitude variables contain zeroes which should clearly be missing values, but the _FillValue attribute is set to -999.99.
The easiest fix would be to set _FillValue=0.0 instead of _FillValue=-999.99. Although 0.0 is a value latitude, no actual valid GPS reading will be exactly 0.0, so that should be fine. This could be done in NcML.
Alternatively, the missing values in the gpsLatitude and gpsLongitude variables could be rewritten to specify -999.99 instead of 0.0. This would require rewriting the netCDF files.
In [1]:
import matplotlib.pyplot as plt
%matplotlib inline
In [2]:
import netCDF4
In [3]:
url = 'http://thredds.cdip.ucsd.edu/thredds/dodsC/cdip/archive/028p1/028p1_d16.nc'
nc = netCDF4.Dataset(url)
ncv = nc.variables
In [4]:
lat0 = ncv['metaDeployLatitude'][:]
print(lat0)
In [5]:
lat1 = ncv['gpsLatitude'][:]
In [6]:
print(lat1)
In [7]:
print(lat1.min())
In [8]:
plt.plot(lat1)
Out[8]:
The missing value is set to -999.99, not 0.0:
In [9]:
print(ncv['gpsLatitude']._FillValue)
In [9]: