Read VIIRS SDR data, resample, and make a true color RGB image

Created with:

Package Version
SatPy 0.9.0
PyResample 1.10.1
Trollimage 1.5.3
PyKdtree 1.3.1
In [1]:
from satpy.scene import Scene
from glob import glob
In [2]:
scn = Scene(
        filenames=glob("/home/a000680/data/polar_in/direct_readout/npp/lvl1/npp_20150420_1202_18019/*"),
        reader='viirs_sdr')
/home/a000680/.local/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
In [3]:
from satpy.resample import get_area_def
In [4]:
areaid = 'eurol'
In [5]:
areadef = get_area_def(areaid)
In [6]:
composite = 'true_color_lowres'
In [7]:
scn.load([composite])
In [8]:
newscn = scn.resample(areadef)
In [9]:
newscn.show(composite)
Out[9]:
<trollimage.xrimage.XRImage at 0x7f9ba408e250>

In [10]:
prfx = newscn.start_time.strftime('%Y%m%d%H%M')
In [11]:
newscn.save_dataset(
        composite, './true_color_rayleigh_only_{0}_{1}.png'.format(prfx, areaid))
/home/a000680/.local/lib/python2.7/site-packages/dask/local.py:271: RuntimeWarning: invalid value encountered in less
  return func(*args2)
/home/a000680/.local/lib/python2.7/site-packages/dask/local.py:271: RuntimeWarning: invalid value encountered in log10
  return func(*args2)