Investigate incorrect bounding box for CDIP data

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

metaDeployLatitude is a single value that looks okay:


In [4]:
lat0 = ncv['metaDeployLatitude'][:]
print(lat0)


33.8545722961

gpsLatitude is a time series that contains 0 values that are clearly missing values:


In [5]:
lat1 = ncv['gpsLatitude'][:]

In [6]:
print(lat1)


[ 33.85707474  33.85688019  33.85669708 ...,  33.85397339  33.85394287
  33.85384369]

In [7]:
print(lat1.min())


0.0

In [8]:
plt.plot(lat1)


Out[8]:
[<matplotlib.lines.Line2D at 0x7f417dce30d0>]

The missing value is set to -999.99, not 0.0:


In [9]:
print(ncv['gpsLatitude']._FillValue)


-999.99

In [9]: