I am trying to topographically correct my already atmospherically and radiometrically corrected images. To do so I need to calculate illumination conditions at the time of image acquisition. Terms in this equation are slope and aspect. The two files are stored in a raster ENVI file format, generated from a ASTER-II DEM in ArcGIS. There are other lines beforehand where i define
wdir and other variables, but assume that everything works super smooth until this point. Code is:
rgb = np.stack([refl_surf[5,:,:],refl_surf[3,:,:],refl_surf[2,:,:]], axis=2) imshow(rgb) show() def enviread(datafile, hdrfile): info = envi.open(wdir+hdrfile, wdir+datafile) data = info.load() return data, info [slope,info1]=enviread('Slope_DEM_UT11.dat','Slope_DEM_UT11.hdr') [aspect,info1]=enviread('Aspect_DEM_U11.dat','Aspect_DEM_U11.hdr') fig = plt.figure() plt.subplot(121) imshow(np.squeeze(slope)) colorbar() plt.subplot(122) imshow(np.squeeze(aspect)) colorbar() plt.show()
When showing the images, instead of some topography I see just the following yellow image:
It must be something I've done while generating the slope and aspect but what can it be?
Slope and aspect display without any problems in ArcGIS.
DEM Coordinate system was converted from its original geographic one to the UTM zone where my study area is before extracting any of the derivatives.
It turns out I was looking not at the exported ENVI files, but at my original images. Apparently exporting to an ENVI file format messes the images up, they show just a black monotone image even in ArcGIS.
Is this some kind of inherent flaw of exporting to ENVI?