Snappy: Apply Orbit File Operator Alias

Hi,

Looking to create python scripts to process Sentinel-1 data (Apply Orbit File, Calibration, Speckle Filtering, Terrain Correction).

I’ve followed these instructions, and the 1st contact worked perfectly. I’m also able to view all of the Operators using the ‘gpt -h’ command.

However I’ve come across an issue with my attempt to apply the orbit files using the following code (created with the use of these topics [1,2,3]):

from snappy import ProductIO, GPF, HashMap

data = ProductIO.readProduct('E:/Snappy/S1A_IW_GRDH_1SDV_20151222T062229_20151222T062254_009151_00D2AF_7270.zip')

params = HashMap()
orbit = GPF.createProduct("Apply-Orbit-File", params, data)

outfile = 'E:/Snappy/S1_Orbit'

ProductIO.writeProduct(orbit, outfile, 'BEAM-DIMAP')

It returns the error “RuntimeError: org.esa.snap.core.gpf.OperatorException: Unknown operator ‘Apply-Orbit-File’. Note that operator aliases are case sensitive.”

Not sure if this is an installation issue or something wrong in my code, but the operator alias in the script is the same shown in the ‘gpt -h’ list, and can’t seem to find anything else amiss. Any advice people have on how to sort this (and my code in general) will be greatly appreciated. Also sorry if this has been covered elsewhere and I haven’t spotted it!

Thanks

Miles

Good afternoon Miles,

most probably the problem is this missing code part:

# HashMap
#           Key-Value pairs.
#           https://docs.oracle.com/javase/7/docs/api/java/util/HashMap.html
self.HashMap = jpy.get_type('java.util.HashMap')
        
# Get snappy Operators
GPF.getDefaultInstance().getOperatorSpiRegistry().loadOperatorSpis() 

Cheers,
Andreas

1 Like