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')
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 [ ]: