Command Line Error - gpt c2rcc.landsat8

Hi,

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?

CODE:

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

ERROR MESSAGE:

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
Writing...
.Exception in thread "SunTileScheduler0Standard0" java.lang.NullPointerException
        at com.sun.media.jai.util.SunCachedTile.<init>(SunCachedTile.java:80)
        at com.sun.media.jai.util.SunTileCache.add(SunTileCache.java:257)
        at javax.media.jai.OpImage.addTileToCache(OpImage.java:1087)
        at javax.media.jai.OpImage.getTile(OpImage.java:1142)
        at org.esa.snap.core.gpf.internal.OperatorExecutor$OperatorTileComputationListenerStack.tileComputed(OperatorExecutor.java:310)
        at com.sun.media.jai.util.RequestJob.compute(SunTileScheduler.java:278)
        at com.sun.media.jai.util.WorkerThread.run(SunTileScheduler.java:468)

Parameter File

<parameters>
    <validPixelExpression>BB &gt; 0&amp;&amp;B8 &lt; 0.1</validPixelExpression>
    <salinity>1.0E-4</salinity>
    <temperature>15.0</temperature>
    <ozone>330.0</ozone>
    <press>1000.0</press>
    <elevation>105.0</elevation>
    <TSMfakBpart>1.72</TSMfakBpart>
    <TSMfakBwit>3.1</TSMfakBwit>
    <CHLexp>1.04</CHLexp>
    <CHLfak>21.0</CHLfak>
    <thresholdRtosaOOS>0.05</thresholdRtosaOOS>
    <thresholdAcReflecOos>0.1</thresholdAcReflecOos>
    <thresholdCloudTDown865>0.955</thresholdCloudTDown865>
    <netSet>C2RCC-Nets</netSet>
    <outputAsRrs>false</outputAsRrs>
    <deriveRwFromPathAndTransmittance>false</deriveRwFromPathAndTransmittance>
    <outputRtoa>false</outputRtoa>
    <outputRtosaGc>false</outputRtosaGc>
    <outputRtosaGcAann>false</outputRtosaGcAann>
    <outputRpath>false</outputRpath>
    <outputTdown>false</outputTdown>
    <outputTup>false</outputTup>
    <outputAcReflectance>false</outputAcReflectance>
    <outputRhown>true</outputRhown>
    <outputOos>false</outputOos>
    <outputKd>true</outputKd>
    <outputUncertainties>true</outputUncertainties>
</parameters>

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