Command Line Error - gpt c2rcc.landsat8


I am trying to process multiple Landsat 8 files using C2RCC. Unfortunately, I can’t access this option in the graph builder utility so I tried going to the command line (Windows 10).

When I try to run the following code i command prompt, I am met with a NullPointerException error message. I have copied the parameter file below as well. What should I do?


gpt c2rcc.landsat8 -SsourceProduct=Subset_resample_test.dim -p c2rcc_param.xml -Pozone=330 -Ppress=1000 -Ptemperature=15 -t Landsat_Test_Resampled_C2RCC_attemptF.dim


INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
INFO: org.hsqldb.persist.Logger: dataFileCache open start
INFO: org.esa.s3tbx.c2rcc.ancillary.AtmosphericAuxdataBuilder: Atmospheric auxdata product can't be used. At least one is not specified. Using constant values for ozone (330.0) and surface pressure (1000.0).
INFO: org.esa.snap.core.gpf.common.WriteOp: Start writing product c2rcc.landsat8$173EE75AC9C to Landsat_Test_Resampled_C2RCC_attemptwithFionn.dim
.Exception in thread "SunTileScheduler0Standard0" java.lang.NullPointerException
        at org.esa.snap.core.gpf.internal.OperatorExecutor$OperatorTileComputationListenerStack.tileComputed(

Parameter File

    <validPixelExpression>BB &gt; 0&amp;&amp;B8 &lt; 0.1</validPixelExpression>

This seems to be caused by not enough memory.
How much RAM does your PC have?
To which resolution have you resampled the Landsat data? Can you go lower?

1 Like

Hello! Thanks for your help! I have 16 GB of RAM, and I resampled using the approach in the RUS Webinar - Freshwater Quality Monitoring with Sentinel-2 (I am using Landsat data, however). The resampled images appear to be 33 KB each.

What matters is the size of the img files inside the .data folder. The dim file only stores metadata

1 Like

If you could live without the uncertainties, you could try to do the processing without its computation. This way it would be faster and consumes less memory.

You could also do a subsetting to your region of interest before processing C2RCC.

If you have used the panchromatic band as reference for resampling use one of the others

If you need the high resolution of the panchromatic band, then you actually need to do a pansharpening too. But this is currently not possible with SNAP for Landsat, as far as I know.

1 Like

Unfortunately, running it without the uncertainties resulted in the same error, even after resampling and subsetting. I resampled using the red band as a reference, and the subset area is the size of a medium-sized lake. I am able to use the GUI to run the process without problem in only a few seconds (Optical > Thematic Water Processing > C2RCC Processors > Landsat-8). I want to run this process on a number of files so I was hoping to automate it. Is there a way to access the operator through graph builder? None of the C2RCC operators appear in the Graph Builder.

Thanks again!

I just tried processing with c2rcc for Landsat8 and it worked. I’ve also resampled to 30 meter and the scene size is roughly 1400x1100.
Can you show the complete exception output? Maybe paste it into a file and attach it here.

Also I have seen your validExpression "BB > 0 && B8 < 0.1".
Have you created the bands BB and B8 before?

1 Like

Changing the validExpression from "<validPixelExpression>BB > 0&&B8 < 0.1</validPixelExpression>"to just “<validPixelExpression/>” fixed the error! Thank you so much for your help!!!

1 Like