The problem I am facing is part of more complex workflow, but I believe that it could be simplified to this simple case. I have a tif image file and I am reading it from disk to Product like this:
java.io.File file = new java.io.File(outFilePath);
Product inProduct = CommonReaders.readProduct(file);
The inProduct variable seems fine, it has band, dimensions and so. Now I just try to save it to other location on disk like this:
I just did the same and the resulting file is okay.
I just used ProductIO instead of CommonReaders, but this should not make a difference.
Which version of SNAP do you use?
Thank you. I have snap 8.0. But I have already came to conclusion, that the code is OK.
The problem is with that tif file. I have created it with gdal module in Python. In ArcMap it has correct values, but in Snap it is all zeros. I guess I am missing something in that raster creation process, but have no clue what. Don’t you have some tip what may be the problem?
I found it. I have created output raster for writing tif in python like this: out_ds = driver.Create(out_file, cols, rows, 1, gdal.CGDT_Float32)
The issue was that it was complex number not floating point. This way it worked: out_ds = driver.Create(out_file, cols, rows, 1, gdal.GDT_Float32)
Thank you.