How can I find that operation was successful?

Hey guys. I started to play with snappy and everything is fine. I am using the GPT - h for finding functions and it’s feasible. However, I am not quite sure how to find that some operation was successful.

Sentinel-1 processing workflow:

product = ProductIO.readProduct(f"{s1_directory_path}/{s1_list[0]}")

# Apply orbit file
parameters = HashMap()
parameters.put('Apply-Orbit-File', True)
output = GPF.createProduct('Apply-Orbit-File', parameters, product)

This seems that is okay from the changed name (Orb)



# Thermal noise removal
parameters = HashMap()
parameters.put('borderLimit', 600)
parameters.put('trimThreshold', 0.5)
parameters.put('selectedPolarisations', 'I am Barbar Conan band')
output = GPF.createProduct('Remove-GRD-Border-Noise', parameters, source)

It will give you the same name of file and of course I am Barbar Conan band is not a valid band (Python will not raise the error). That would be something from list [‘Amplitude_VH’, ‘Intensity_VH’, ‘Amplitude_VV’, ‘Intensity_VV’]. However, with chosen parameter from the list, the result is the same. So what is the best approach to finding out that something is not working in the right way?

Thank you!

1 Like

Hi Teracotta,

GPT and its operators have a lifecycle. First, they are initialized and afterwards the computation takes place. During the initialisation phase the source product and the provided parameters are validated.
In your code, only this phase has been completed.

The actual computation is only performed if data is requested. For example, when the result is written to disk or by output.getBand("name").readRasterData(...).

The illegal selectedPolarisations parameter is not correctly validated. It should raise an exception.
Even if you execute the operation by writing the output, you will only get an empty product (I only had a quick look at the code).

Let’s put it this way: The operator is tolerant of misconfigurations. :wink:

Other operators will raise an exception if the configuration is not correct.

I’ve created an issue for this: [SNAP-3438] Enhanced configuration validation for Remove-GRD-Border-Noise operator - JIRA (

1 Like