In [1]:
from nansat import Nansat, Domain
# open file with MODIS image
n1 = Nansat('MYD02HKM.A2016148.1050.006.2016149162607.hdf')
# open file with Sentinel-1A image
n2 = Nansat('S1A_EW_GRDM_1SDH_20160527T163927_20160527T164031_011447_0116DE_3ED0.SAFE')
# define region of interest (south of Lofoten islands)
d = Domain('+proj=stere +lon_0=12 +lat_0=67 +no_defs', '-te -50000 -50000 50000 50000 -tr 100 100')
# collocate of the images
n1.reproject(d)
n2.reproject(d)
# write RGB graphic file from MODIS data
f=n1.write_figure('test_rgb_MODIS.png',
                 ['L_858', 'L_555', 'L_469'],
                 clim='hist', ratio=0.95)
# write RGBgrayscale file from Sentinel-1A data
f=n2.write_figure('test_SENTINEL1.png',
                 'sigma0_HH',
                 clim='hist', ratio=0.95, cmapName='gray')


/home/antonk/miniconda/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
/home/antonk/py/nansat/nansat/mappers/mapper_sentinel1a_l1.py:125: UserWarning: Sentinel-1 level-1 mapper is not yet adapted to complex data. In addition, the band names should be updated for multi-swath data - and there might be other issues.
  warnings.warn('Sentinel-1 level-1 mapper is not yet adapted to '

In [2]:
from IPython.core.display import Image
Image(filename='test_rgb_MODIS.png')


Out[2]:

In [3]:
from IPython.core.display import Image
Image(filename='test_SENTINEL1.png')


Out[3]:

In [20]:
from IPython.core.display import Image
d.write_map('test_domain_map.png', resolution='h', dpi=300,
            meridians=4, parallels=4,
            latBorder=1, lonBorder=1,
            merLabels=[False, False, True, False],
            parLabels=[True, False, False, False],
               )
Image(filename='test_domain_map.png')


Out[20]:

In [ ]: