I am trying to get an array of intensities of changes generated by Snap from 2 Sentinel1 images (called mosaic.dim). If I see an mosaic.dim image in Snap, I can see various values of intensities from -1 to 1, but if I try to read it in Python to an array of intensities, the only array I am receiving is an array full of 0.0 what is not correct. I have gone through this website and I have tried to read it similarly as I have seen it here but it does not work. Could you please tell me, how to read an array intensities from mosaic.dim image in Python correctly? I need to work with it afterwards.
Here is my code:
filename = "mosaic.dim" # load picture and its proportions product = ProductIO.readProduct(filename) width = product.getSceneRasterWidth() height = product.getSceneRasterHeight() #print(list(product.getBandNames())) #get band and get array on intensity from band intensity = product.getBand('ratio_VH') rasterData = intensity.createCompatibleRasterData() #returns array of 0.0 instead of intensties array = rasterData.getElems() intensity_pixels = np.zeros(width * height, np.float32) intensity_pixels.shape = height, width
#TODO:result = changeValuesinArray(array)
#TODO:save result to a new dim file
Furthermore, I would like to change some values in array of intensities and save it as a new .dim image, that I could work with it in Snap. Do you know, how to do that in Python as well?