Cannot identify Sentinel platform from product metadata

I have upgraded from SNAP version 6 to SNAP version 8 and am now encountering a new error when executing the Idepix.Olci algorithm using snappy:

source = ProductIO.readProduct(in_file)
parameters = HashMap()
parameters.put('cloudBufferWidth', '8')
parameters.put('computeCloudBuffer', 'true')
parameters.put('outputSchillerNNValue', 'false')
parameters.put('radianceBandsToCopy', '')
parameters.put('PreflBandsToCopy', '')
target = GPF.createProduct('Idepix.Olci', parameters, source)
ProductIO.writeProduct(target, outfile_idepix, 'GeoTIFF')

The code above raises the following error:
RuntimeError: org.esa.snap.core.gpf.OperatorException: Cannot identify Sentinel platform from product metadata

Previously I used Idepix.Sentinel3.Olci in SNAP version 6 but this no longer seems to be an option, so now I am using Idepix.Olci instead.

Note in_file is the output of a preceding SNAP “Subset” operator, not sure if that could be related.

Yes, the subset could be the issue.
It should contain the original metadata. Best would be to save it in BEAM-DIMAP format.
Idepix.OLCI uses the O2AHarmonisation which needs to know the if it is Sentinel-3A or 3B.

1 Like

Thanks marpet, I confirmed it works if I don’t subset first. Note the output of subset was in BEAM-DIMAP format, however still caused the error.

Oh, good to know. I consider this as a bug.
SIIITBX-380 - O2AHarmonisation cannot use OLCI subset products

We tried to reproduce the error but Idepix.Olci ran successfully with a subset.
Can you tell the name of the product you are using and also how you have created the subset, which settings?

Hi marpet,

The product from which I have encountered this error is:
S3A_OL_1_EFR____20200905T162021_20200905T162321_20200906T204739_0179_062_254_1980_LN1_O_NT_002.SEN3

I am able to recreate the error with the following python script:

from snappy import ProductIO, GPF, HashMap, WKTReader

in_file = 'S3A_OL_1_EFR____20200905T162021_20200905T162321_20200906T204739_0179_062_254_1980_LN1_O_NT_002.SEN3'
subset_file = 'subset_file.dim'
wkt = 'POLYGON((-79.6508789062 56.8174174759, -78.6758422852 56.8174174759, -78.6758422852 56.3880631441, -79.6508789062 56.3880631441, -79.6508789062 56.8174174759))'

source = ProductIO.readProduct(in_file)
parameters = HashMap()
geom = WKTReader().read(wkt)
parameters.put('copyMetadata', 'false')
parameters.put('fullSwath', 'false')
parameters.put('geoRegion', geom)
parameters.put('sourceBands', '')
parameters.put('subSamplingX', '1')
parameters.put('subSamplingY', '1')
target = GPF.createProduct('Subset', parameters, source)
ProductIO.writeProduct(target, subset_file, 'BEAM-DIMAP')

source = ProductIO.readProduct(subset_file)
parameters = HashMap()
parameters.put('cloudBufferWidth', '8')
parameters.put('computeCloudBuffer', 'true')
parameters.put('outputSchillerNNValue', 'false')
parameters.put('radianceBandsToCopy', '')
parameters.put('reflBandsToCopy', '')
target = GPF.createProduct('Idepix.Olci', parameters, source)

In case it is useful:
snap --nosplash --nogui --modules --list --refresh | grep ‘idepix’

org.esa.snap.idepix.probav                         8.0.0    Available
org.esa.snap.idepix.modis                          8.0.0    Available
org.esa.s3tbx.s3tbx.idepix                         6.0.7    Enabled
org.esa.s2tbx.s2tbx.s2msi.idepix                   6.0.4    Enabled
org.esa.snap.idepix.spotvgt                        8.0.0    Available
org.esa.snap.idepix.landsat8                       8.0.0    Available
org.esa.snap.idepix.viirs                          8.0.0    Available
org.esa.snap.idepix.olci                           8.0.0    Installed
org.esa.snap.idepix.seawifs                        8.0.0    Available
org.esa.snap.idepix.meris                          8.0.0    Available
org.esa.s3tbx.s3tbx.idepix.ui                      6.0.7    Available
org.esa.snap.idepix.s2msi                          8.0.2    Installed
org.esa.snap.idepix.core                           8.0.0    Installed
org.esa.s2tbx.s2tbx.s2msi.idepix.ui                6.0.4    Available

Above shows I now have both version 6 and 8 installed. If I modify the code to use ‘Idepix.Sentinel3.Olci’ (I believe version 6) instead of ‘Idepix.Olci’ (I believe version 8) then there is no error.

Please note the error was present even when I had only version 8 installed. However I have now both versions as a work-around so I can use version 6 for the time being.

That’s the problem:

If you set this to true it should work.

Ah! So simple :slight_smile: Sorry, I misunderstood when you first said “It should contain the original metadata”.

I confirmed it works after setting copyMetadata to true.

Thank you for all your help marpet.

1 Like

Can you tell the name of the product you are using