Skip to content
Subhadip Datta edited this page Nov 14, 2020 · 1 revision

icrop, imask, layerStack, NDI

satiopst.utils.icrop(imgpath,shppath)

Crop satellite image using ESRI shapefile

Parameters

imgpath : Path to satellite image.
shppath : Path to ESRI shapefile.

Returns

mask1 : Satellite image as numpy ndarray Same extent of raw image.
meta : Metadata of image. Needed at the time of save image.


satiopst.utils.imask(imgpath,shppath,nodata=0)

Mask image according ESRI shapefile area.

Parameters

imgpath : Path to satellite image.
shppath : Path to ESRI shapefile.
nodata : no data value, optional, Value used for fill the outer shapefile area. The default is 0.

Returns

mask1 : Satellite image as numpy ndarray Same extent of raw image.
meta : Metadata of image. Needed at the time of save image.


satiopst.utils.layerStack(imglist)

Stack bands of satellite image.

Parameters

imglist : list of image files. image file paths with directory and name.

Returns

ilist : Satellite image as mumpy ndarray Stacked in same order of input list.
immeta : Updated metadata of the image with same file format. Needed at the time of save image.


satiopst.utils.ndi(band_1,band_2,nodata=0,replace=True)

Normalized Difference Index. e.g. NDVI.

Parameters

band_1 : First band of the index e.g. NIR band for NDVI.
band_2 : Second band of the index e.g. RED band for NDVI.
nodata : nodata value if any present in the input image, optional The default is 0.
replace : Change the nodata value to nan, optional, If True change the nodata value to np.nan. The default is True.

Returns

Normalized Difference Index.

Clone this wiki locally