Created with:
Package | Version |
---|---|
SatPy | 0.9.0 |
PyResample | 1.10.1 |
Trollimage | 1.5.3 |
PyKdtree | 1.3.1 |
from satpy.scene import Scene
from satpy import find_files_and_readers
from glob import glob
from datetime import datetime
myfiles = glob("/home/a000680/data/polar_in/direct_readout/npp/lvl1/npp_20150421_1143_18033/*h5")
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),
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
scene = Scene(filenames=myfiles, reader='viirs_sdr')
scene.load(['true_color'])
natscn = scene.resample(resampler='native')
This is necessary since the True Color composite chosen use both I- and M-bands, with different resolutions.
natscn.show('true_color')
<trollimage.xrimage.XRImage at 0x7fec001b6350>
If you want to save the image to disk?
natscn.save_dataset('true_color', filename='./viirs_true_color.png')
/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 greater_equal return func(*args2) /home/a000680/.local/lib/python2.7/site-packages/dask/local.py:271: RuntimeWarning: invalid value encountered in log10 return func(*args2)