I'm using ArcMap 10.3.1
When I use the gp tool to extract by mask, I get the correct result with any area outside the mask set as NoData.
Note the values within the mask are correct, the stretching is different because the black cells outside the mask have a value of -32768 (the minimum value in a 16 bit signed raster).
It looks like something to do with tiling?
Note when using the gp tool, I get the message "WARNING 000632: Datum conflict between map and output." I don't know if this is relevant?
Below is my script.
import arcpy from arcpy import sa as sa ws = 'c:/temp/test/' arcpy.env.workspace = ws outMask = sa.ExtractByMask('band2.tif', 'Clip109071.shp') outMask.save('band2clipped.tif')