terraref / extractors-hyperspectral

Scripts and code relevant to the SWIR and VNIR cameras.
BSD 3-Clause "New" or "Revised" License
6 stars 6 forks source link

Add _FillValue and Latitude, Longitude values #15

Closed FlyingWithJerome closed 7 years ago

FlyingWithJerome commented 7 years ago
  1. If failed to get the georeference data, pre-fill all of them (x, y, lat, lon, etc.) with _FillValue = 1e36. The fixed data (reference point, history, etc.) will still be normally recorded. In this case, we will not have x and y dimensions (because we cannot collect them).

  2. Add the latitude and longitude values of all the pixels.

FlyingWithJerome commented 7 years ago

@czender Had already renamed the latitude and longitude with the CF naming convention. The units for both of them had been changed to "degree_north" and "degree_east" based on the convention ver. 41

FlyingWithJerome commented 7 years ago

@czender Now _FillValue is a global variable under NCATTRS. Right now the value is 1e36, but can be changed to any value else anytime

max-zilla commented 7 years ago

@dlebauer at a glance this looks good to me. The encoding for key geo info comes in the form of 4 attributes like this one:

setattr(netCDFHandler.variables["x"], "units", "meters")
setattr(netCDFHandler.variables['x'], 'reference_point', 'Southeast corner of field')
setattr(netCDFHandler.variables['x'], "long_name", "North-south offset from southeast corner of field")

x, y, latitude, longitude attributes.

x & y are in meters as shown here latitude and longitude are in degrees

We can use the same 4 definitions in the other geocodings (and probably already are but I'll check) for consistency across the NC files and geostreams.

FlyingWithJerome commented 7 years ago

@czender

FlyingWithJerome commented 7 years ago

@czender Done. Probably my misunderstanding, they used to be degrees_north and degrees_east