I need to create and then apply a raster mask. Here my code:
File = Filepath(inputfile, Root_Dir = root_path)
raster = e.OpenRaster(File)
cloudmask = (raster.GetData(BAND=0) ge 0.2 and raster.GetData(BAND=1) le 285)
output = Filepath(output_file, Root_Dir = output_path)
maskRaster = ENVIRaster(cloudmask, URI=output)
maskRaster.Save
rasterWithMask = ENVIMaskRaster(raster, MaskRaster, /INVERSE)
rasterWithMask.Export, masked_raster, "TIFF"
The maskRaster is created correctly and is displayed by ENVI as expected.
Istead, the masked raster is displayed as if the mask had not been applied.
I forgot something?
|