GPF.createProduct error in google colab

Hi,
I tried these to for orthorectifing images using python on googlecolab;

parameters = HashMap()
GPF.getDefaultInstance().getOperatorSpiRegistry().loadOperatorSpis()
parameters.put(‘orbitType’, ‘Sentinel Precise (Auto Download)’)
parameters.put(‘polyDegree’, ‘3’)
parameters.put(‘continueOnFail’, ‘false’)
apply_orbit_file = GPF.createProduct(“Apply-Orbit-File”, parameters, product)

But, I got this error;
RuntimeError: org.esa.snap.core.gpf.OperatorException: java.lang.NullPointerException

I cannot figure it out what the problem is. Thank you for your help.

This is unfortunately one issue of snappy the error reporting is not good.
By only seeing this message it is hard to tell what the error is.
Possible reasons:

  • Download of the orbit file does not work. Maybe not yet available or data can’t be stored on gogglecolab
  • Was the product correctly read?

If you have the option, you could try this locally on your machine with your data.

Thanks a lot for the reply. I tried GPF.createProduct with other values such as “Calibration”, and I got the same error.
I ran these codes;
product = ProductIO.readProduct(“S1A_IW_GRDH_1SDV_20210419T230833_20210419T230858_037526_046CC6_DCC5_Orb.dim”)
width = product.getSceneRasterWidth()
print(“Width: {} px”.format(width))
height = product.getSceneRasterHeight()
print(“Height: {} px”.format(height))
name = product.getName()
print(“Name: {}”.format(name))
band_names = product.getBandNames()
print(“Band names: {}”.format(", ".join(band_names)))

and I got these;
Width: 25868 px
Height: 16409 px
Name: S1A_IW_GRDH_1SDV_20210419T230833_20210419T230858_037526_046CC6_DCC5_Orb
Band names: Amplitude_VH, Intensity_VH, Amplitude_VV, Intensity_VV

Apparently, the product was read correctly, am I right?

Yes, the product looks good.

I figured out what the problem was. When I used a .zip product instead of a .dim product, I did not get that error.
Thank you again.

1 Like

Ah! Maybe some of the metadata is not accessible anymore when converted to DIMAP.

1 Like