Hello everyone,
I am working with Snappy Python. I am trying to preprocess a Sentinel 1 GRD, IW product. Following are the steps I am taking for Preprocessing:
a. Subset
b. Radiometric Calibration
c. Speckle Filtering
d. Terrain Correction
e. BandMaths RVI(Radar Vegetation Index) Calculations
f. LinearToFromdB.
Now finally when I try to read the pixels, from the final processed Image for histogram and other uses I get the following error:
Code:
band = linear_to_db.getBand(“Sigma0_VH_db”)
w = band.getRasterWidth()
h = band.getRasterHeight()
print(f"Width: {w}, Height: {h}")
band_data = np.zeros(w*h, np.float32)
band.readPixels(0, 0, w, h, band_data)
Error message:
RuntimeError: org.esa.snap.core.gpf.OperatorException: java.lang.NullPointerException
The same problem does not occur if I do not convert the LinearToFromdB. That is if I ignore the last step. Also if I do BandMaths (for RVI) calculation after LinearToFromdB I do not get this error.
Would appreciate any help. I did not get any error in the preprocessing steps.
- But as per my very little understanding of Sentinel 1, conversion to dB is a good idea but what about RVI?
- Should the BandMaths (for RVI) calculation be done before or after LinearToFromdB in Snappy?
- Is there something wrong with my process?