Read VIIRS SDR and make a ratio sharpened true color RGB with I- and M-bands

Created with:

Package Version
SatPy 0.9.0
PyResample 1.10.1
Trollimage 1.5.3
PyKdtree 1.3.1
In [9]:
from satpy.scene import Scene
from satpy import find_files_and_readers
from glob import glob
from datetime import datetime

Find all the SDR files for the scene

In [2]:
myfiles = glob("/home/a000680/data/polar_in/direct_readout/npp/lvl1/npp_20150421_1143_18033/*h5")

...or select only a part of the scene

In [3]:
DATA_DIR = "/home/a000680/data/polar_in/direct_readout/npp/lvl1/npp_20150421_1143_18033"
myfiles = find_files_and_readers(base_dir=DATA_DIR,
                                 start_time=datetime(2015, 4, 21, 11, 45),
                                 end_time=datetime(2015, 4, 21, 11, 52),
/home/a000680/.local/lib/python2.7/site-packages/h5py/ 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

Create the scene object

In [4]:
scene = Scene(filenames=myfiles, reader='viirs_sdr')

Load the data for the requested RGB

In [5]:

Make sure all data are on the same grid and resolution

In [6]:
natscn = scene.resample(resampler='native')

This is necessary since the True Color composite chosen use both I- and M-bands, with different resolutions.


In [7]:'true_color')
<trollimage.xrimage.XRImage at 0x7fec001b6350>

If you want to save the image to disk?

In [8]:
natscn.save_dataset('true_color', filename='./viirs_true_color.png')
/home/a000680/.local/lib/python2.7/site-packages/dask/ RuntimeWarning: invalid value encountered in less
  return func(*args2)
/home/a000680/.local/lib/python2.7/site-packages/dask/ RuntimeWarning: invalid value encountered in greater_equal
  return func(*args2)
/home/a000680/.local/lib/python2.7/site-packages/dask/ RuntimeWarning: invalid value encountered in log10
  return func(*args2)