Error processing resampled S2 L1C product with C2RCC

Hello,

I am encountering an error when trying to process resampled S2 L1C data with C2RCC using gpt.
I am using SNAP version 8.0

Here are the commands that I am using:

Resampling
/path/to/gpt Resample -SsourceProduct=/path/to/S2L1C/product.SAFE -PtargetResolution=100 -Pdownsampling=Mean -t /path/to/resampled/file.dim

C2RCC
/path/to/gpt c2rcc.msi -SsourceProduct=/path/to/resampled/file.dim -PoutputAsRrs=true -PoutputKd=false -PoutputRtoa=false -PoutputRhown=false -PoutputUncertainties=false -Pozone=300 -Ppress=1010 -PvalidPixelExpression=B11<0.1 -t /path/to/output/file.dim

The resampling step raises the following warnings:

WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [metadata_level] does not exist
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [granuleidentifier] does not exist
WARNING: org.esa.snap.core.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist

C2RCC raises the following error:

Exception in thread "SunTileScheduler0Standard1" .Exception in thread "SunTileScheduler0Standard0" java.lang.NoSuchFieldError: DEGREE_RES_BY_NUM_PIXELS_PER_TILE
	at org.esa.snap.dataio.getasse30.GETASSE30ElevationModel.getIndexY(GETASSE30ElevationModel.java:44)
	at org.esa.snap.core.dataop.dem.BaseElevationModel.getElevation(BaseElevationModel.java:98)
	at org.esa.s3tbx.c2rcc.msi.C2rccMsiOperator.computePixel(C2rccMsiOperator.java:493)
	at org.esa.snap.core.gpf.pointop.PixelOperator.computeTileStack(PixelOperator.java:81)
	at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeRect(OperatorImageTileStack.java:122)
	at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeTile(OperatorImageTileStack.java:86)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at com.sun.media.jai.util.RequestJob.compute(Unknown Source)
	at com.sun.media.jai.util.WorkerThread.run(Unknown Source)
java.lang.NoSuchFieldError: DEGREE_RES_BY_NUM_PIXELS_PER_TILE
	at org.esa.snap.dataio.getasse30.GETASSE30ElevationModel.getIndexY(GETASSE30ElevationModel.java:44)
	at org.esa.snap.core.dataop.dem.BaseElevationModel.getElevation(BaseElevationModel.java:98)
	at org.esa.s3tbx.c2rcc.msi.C2rccMsiOperator.computePixel(C2rccMsiOperator.java:493)
	at org.esa.snap.core.gpf.pointop.PixelOperator.computeTileStack(PixelOperator.java:81)
	at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeRect(OperatorImageTileStack.java:122)
	at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeTile(OperatorImageTileStack.java:86)
	at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
	at javax.media.jai.OpImage.getTile(Unknown Source)
	at com.sun.media.jai.util.RequestJob.compute(Unknown Source)
	at com.sun.media.jai.util.WorkerThread.run(Unknown Source)

I am running these commands successfully in a docker container hosted on this machine, with the same SNAP version installed (regardless of the warnings in the resampling step). So I am guessing that this error is related to my installation or configuration of SNAP.

Many thanks in advance for your help !

Best,
Thibaut

The error indicates that some update of the modules didn’t work properly.
The field DEGREE_RES_BY_NUM_PIXELS_PER_TILE does not exist since SNAP 8.0.4 anymore.
And the GETASSE30ElevationModel which is accessing was updated accordingly at the same time.
So, it seems that the two modules snap-core and snap-getasse30-dem are out of sync.
You can reinstall snap and install the updates too. this should fix the problem.

Alternatively, you can delete the folders
modules, update and update_tracking in /home/user/.snap/system
This removes all updates, and you start from clean v8.0.0. Then you can download and install the latest updates.

Thank you for your quick reply.
I followed your second suggestion (deleting modules, update and update_tracking in /home/user/.snap/system to revert back to a clean v8.0.0 and then download and install the latest updates), which fixed my problem.