Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- added GOES, HIMAWARI, VIIRS SNPP & NOAA-20, and Lunar AERONET aerosol observations to the KX-lists

### Changed

### Fixed
Expand Down
22 changes: 22 additions & 0 deletions GMAO_ods/kx_list.rc
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,28 @@ kx_list::
324 AVHRR PATMOSX Aerosol Retrievals
325 OMSO2 (OMI SULFER DIOXIDE)
326 GOCI Aerosol Retrievals (Yonsei University)
327 GOES-16 Aerosol (Dark Target Ocean Algorithm)
328 GOES-16 Aerosol (Dark Target Land Algorithm)
329 GOES-17 Aerosol (Dark Target Ocean Algorithm)
330 GOES-17 Aerosol (Dark Target Land Algorithm)
331 Himawari Aerosol (Dark Target Ocean Algorithm)
332 Himawari Aerosol (Dark Target Land Algorithm)
333 VIIRS SNPP Aerosol (Deep Blue Land Algorithm)
334 VIIRS SNPP Aerosol (Deep Blue Ocean Algorithm)
335 VIIRS SNPP Aerosol (Dark Blue Deep Algorithm)
336 VIIRS SNPP Aerosol (Dark Target Land Algorithm)
337 VIIRS SNPP Aerosol (Dark Target Ocean Algorithm)
338 VIIRS NOAA-20 Aerosol (Deep Blue Land Algorithm)
339 VIIRS NOAA-20 Aerosol (Deep Blue Ocean Algorithm)
340 VIIRS NOAA-20 Aerosol (Deep Blue Deep Algorithm)
341 VIIRS NOAA-20 Aerosol (Dark Target Land Algorithm)
342 VIIRS NOAA-20 Aerosol (Dark Target Ocean Algorithm)
343 Lunar AERONET Aerosol Retrievals
344 VIIRS NOAA-21 Aerosol (Deep Blue Land Algorithm)
345 VIIRS NOAA-21 Aerosol (Deep Blue Ocean Algorithm)
346 VIIRS NOAA-21 Aerosol (Deep Blue Deep Algorithm)
347 VIIRS NOAA-21 Aerosol (Dark Target Land Algorithm)
348 VIIRS NOAA-21 Aerosol (Dark Target Ocean Algorithm)
::

# Notes:
Expand Down
70 changes: 70 additions & 0 deletions GMAO_ods/pyods/odsreader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
"""

Very minimalistic ODS reader.

"""

VARS = ['lon', 'lat', 'lev', 'time', 'obs', 'qcexcl']
EXTRA = ['kt', 'kx', 'ks', 'qchist', 'xm', 'xvec', 'omf', 'oma']


from netCDF4 import Dataset

from numpy import array
from datetime import timedelta
from dateutil.parser import parse as isoparser

class ODSreader(object):

def __init__ (self, filename, Extra=None):
"""
Read select attributes from an ODS file.
"""

nc = Dataset(filename)

Vars = VARS
if Extra is not None:
Vars += Extra

self._getVars(nc,Vars)

self.nobs = len(self.lon)

# Create python time
# ------------------
tunits = nc.variables['time'].units
onemin = timedelta(minutes=1)
toff = isoparser(tunits.split(' since ')[1].replace(' ','T'))
t = array([toff + self.time[i] * onemin for i in range(self.nobs)])

self.time = t # array of python datetime objects

def _getVars(self,nc,Vars):
"""
Read and flatten variables on file.
Assuems 1 synoptic time per file.
"""
for name in Vars:
v = nc.variables[name]
q = v[:,:]
try:
q = q * v.scale_factor
except:
pass
try:
q = q + v.add_offset
except:
pass

I = q.mask==False # not fill values
self.__dict__[name] = q[I].data

#-------------

if __name__ == "__main__":

m = ODSreader('nnr_002.MOD04_L2a.land.20140119_0300z.ods')

for i in range(m.nobs):
print("%6.2f %6.2f %s %7.4f"%(m.lon[i],m.lat[i],m.time[i].isoformat(),m.obs[i]))
22 changes: 22 additions & 0 deletions GMAO_ods/pyods_.F90
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,28 @@ subroutine pyods_putAll(filename, ftype, nymd,nhms, nsyn, nobs, &
ods%meta%kx_names(324) = 'AVHRR PATMOSX Aerosol Retrievals'
ods%meta%kx_names(325) = 'OMSO2 (OMI Sulfer Dioxide)'
ods%meta%kx_names(326) = 'GOCI Aerosol Retrievals (Yonsei University)'
ods%meta%kx_names(327) = 'GOES-16 Aerosol (Dark Target Ocean Algorithm)'
ods%meta%kx_names(328) = 'GOES-16 Aerosol (Dark Target Land Algorithm)'
ods%meta%kx_names(329) = 'GOES-17 Aerosol (Dark Target Ocean Algorithm)'
ods%meta%kx_names(330) = 'GOES-17 Aerosol (Dark Target Land Algorithm)'
ods%meta%kx_names(331) = 'Himawari Aerosol (Dark Target Ocean Algorithm)'
ods%meta%kx_names(332) = 'Himawari Aerosol (Dark Target Land Algorithm)'
ods%meta%kx_names(333) = 'VIIRS SNPP Aerosol (Deep Blue Land Algorithm)'
ods%meta%kx_names(334) = 'VIIRS SNPP Aerosol (Deep Blue Ocean Algorithm)'
ods%meta%kx_names(335) = 'VIIRS SNPP Aerosol (Deep Blue Deep Algorithm)'
ods%meta%kx_names(336) = 'VIIRS SNPP Aerosol (Dark Target Land Algorithm)'
ods%meta%kx_names(337) = 'VIIRS SNPP Aerosol (Dark Target Ocean Algorithm)'
ods%meta%kx_names(338) = 'VIIRS NOAA-20 Aerosol (Deep Blue Land Algorithm)'
ods%meta%kx_names(339) = 'VIIRS NOAA-20 Aerosol (Deep Blue Ocean Algorithm)'
ods%meta%kx_names(340) = 'VIIRS NOAA-20 Aerosol (Deep Blue Deep Algorithm)'
ods%meta%kx_names(341) = 'VIIRS NOAA-20 Aerosol (Dark Target Land Algorithm)'
ods%meta%kx_names(342) = 'VIIRS NOAA-20 Aerosol (Dark Target Ocean Algorithm)'
ods%meta%kx_names(343) = 'Lunar AERONET Aerosol Retrievals'
ods%meta%kx_names(344) = 'VIIRS NOAA-21 Aerosol (Deep Blue Land Algorithm)'
ods%meta%kx_names(345) = 'VIIRS NOAA-21 Aerosol (Deep Blue Ocean Algorithm)'
ods%meta%kx_names(346) = 'VIIRS NOAA-21 Aerosol (Deep Blue Deep Algorithm)'
ods%meta%kx_names(347) = 'VIIRS NOAA-21 Aerosol (Dark Target Land Algorithm)'
ods%meta%kx_names(348) = 'VIIRS NOAA-21 Aerosol (Dark Target Ocean Algorithm)'

call ods_put (filename, ftype, nymd, nhms, ods, rc)
if ( rc .ne. 0 ) return
Expand Down