I am processing a S2 1C product with C2RCC to derive water quality parameters. I am running the process via GPT. Before running the c2rcc operator, I have resampled and masked to my AOI the product of interest.
I have tried and succeeded with a product from May, first subsetting and later resampling, via GUI:
subset_0_of_S2A_MSIL1C_20220512T095031_N0400_R079_T33TYN_20220512T115002_resample
It seems ok so far. I will check now with gpt.
@abruescas thanks for the feedback. To discard issues, could you please try with the same productID: S2B_MSIL1C_20220818T095549_N0400_R122_T33UXS_20220818T104434
And the same subset area: POLYGON ((17.49745865334892 50.8539698216942, 17.49745865334892 51.247057044051104, 16.76719639371271 51.247057044051104, 16.76719639371271 50.8539698216942, 17.49745865334892 50.8539698216942))
The preprocessing I did with a graph via GPT where I resampled to 10m and then subset. The output of that was then the input of C2RCC in two tests. Running via GPT and GUI. Both with empty results. Below the parameters I used:
Indeed the focus of the AOI is a river not a big water body. I have run your graph and I am facing this issue:
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL not found on system. Internal GDAL 3.0.0 from distribution will be used. (f1)
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
Executing processing graph
INFO: org.esa.s2tbx.dataio.s2.ortho.S2OrthoProductReaderPlugIn: Building product reader - EPSG:32633
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
INFO: org.hsqldb.persist.Logger: dataFileCache open start
WARNING: org.esa.s2tbx.dataio.s2.ortho.S2OrthoUtils: Warning: impossible to read properly mypath\S2B_MSIL1C_20220818T095549_N0400_R122_T33UXS_20220818T104434.SAFE\GRANULE\L1C_T33UXS_A028462_20220818T095747\QI_DATA\MSK_DETFOO_B01.jp2.gml
WARNING: org.esa.s2tbx.dataio.s2.ortho.S2OrthoUtils: Warning: impossible to read properly mypath\S2B_MSIL1C_20220818T095549_N0400_R122_T33UXS_20220818T104434.SAFE\GRANULE\L1C_T33UXS_A028462_20220818T095747\QI_DATA\MSK_DETFOO_B02.jp2.gml
WARNING: org.esa.s2tbx.dataio.s2.ortho.S2OrthoUtils: Warning: impossible to read properly mypath\S2B_MSIL1C_20220818T095549_N0400_R122_T33UXS_20220818T104434.SAFE\GRANULE\L1C_T33UXS_A028462_20220818T095747\QI_DATA\MSK_DETFOO_B03.jp2.gml
WARNING: org.esa.s2tbx.dataio.s2.ortho.S2OrthoUtils: Warning: impossible to read properly mypath\S2B_MSIL1C_20220818T095549_N0400_R122_T33UXS_20220818T104434.SAFE\GRANULE\L1C_T33UXS_A028462_20220818T095747\QI_DATA\MSK_DETFOO_B04.jp2.gml
WARNING: org.esa.s2tbx.dataio.s2.ortho.S2OrthoUtils: Warning: impossible to read properly mypath\S2B_MSIL1C_20220818T095549_N0400_R122_T33UXS_20220818T104434.SAFE\GRANULE\L1C_T33UXS_A028462_20220818T095747\QI_DATA\MSK_DETFOO_B05.jp2.gml
WARNING: org.esa.s2tbx.dataio.s2.ortho.S2OrthoUtils: Warning: impossible to read properly mypath\S2B_MSIL1C_20220818T095549_N0400_R122_T33UXS_20220818T104434.SAFE\GRANULE\L1C_T33UXS_A028462_20220818T095747\QI_DATA\MSK_DETFOO_B06.jp2.gml
WARNING: org.esa.s2tbx.dataio.s2.ortho.S2OrthoUtils: Warning: impossible to read properly mypath\S2B_MSIL1C_20220818T095549_N0400_R122_T33UXS_20220818T104434.SAFE\GRANULE\L1C_T33UXS_A028462_20220818T095747\QI_DATA\MSK_DETFOO_B07.jp2.gml
WARNING: org.esa.s2tbx.dataio.s2.ortho.S2OrthoUtils: Warning: impossible to read properly mypath\S2B_MSIL1C_20220818T095549_N0400_R122_T33UXS_20220818T104434.SAFE\GRANULE\L1C_T33UXS_A028462_20220818T095747\QI_DATA\MSK_DETFOO_B08.jp2.gml
WARNING: org.esa.s2tbx.dataio.s2.ortho.S2OrthoUtils: Warning: impossible to read properly mypath\S2B_MSIL1C_20220818T095549_N0400_R122_T33UXS_20220818T104434.SAFE\GRANULE\L1C_T33UXS_A028462_20220818T095747\QI_DATA\MSK_DETFOO_B8A.jp2.gml
WARNING: org.esa.s2tbx.dataio.s2.ortho.S2OrthoUtils: Warning: impossible to read properly mypath\S2B_MSIL1C_20220818T095549_N0400_R122_T33UXS_20220818T104434.SAFE\GRANULE\L1C_T33UXS_A028462_20220818T095747\QI_DATA\MSK_DETFOO_B09.jp2.gml
WARNING: org.esa.s2tbx.dataio.s2.ortho.S2OrthoUtils: Warning: impossible to read properly mypath\S2B_MSIL1C_20220818T095549_N0400_R122_T33UXS_20220818T104434.SAFE\GRANULE\L1C_T33UXS_A028462_20220818T095747\QI_DATA\MSK_DETFOO_B10.jp2.gml
WARNING: org.esa.s2tbx.dataio.s2.ortho.S2OrthoUtils: Warning: impossible to read properly mypath\S2B_MSIL1C_20220818T095549_N0400_R122_T33UXS_20220818T104434.SAFE\GRANULE\L1C_T33UXS_A028462_20220818T095747\QI_DATA\MSK_DETFOO_B11.jp2.gml
WARNING: org.esa.s2tbx.dataio.s2.ortho.S2OrthoUtils: Warning: impossible to read properly mypath\S2B_MSIL1C_20220818T095549_N0400_R122_T33UXS_20220818T104434.SAFE\GRANULE\L1C_T33UXS_A028462_20220818T095747\QI_DATA\MSK_DETFOO_B12.jp2.gml
S2Resampling will work better in some occasions.
For instance, look here:
It is up to you, in any case. If you use Resample, the subset could be done in the previous step and you will need less memory to run the graph, I guess.
@abruescas about the valid pixel expression in the C2RCC processor, I am getting a strange result. I am working on SNAP 9.0.2 with an image from June 2022, so with the new baseline N0400.
I am running the operator on the scene with the default valid expresion B8>0 && B8<0.1
The chla and tsm outputs are empty. However, using the same valid pixel expression on an image with the previous baseline (N0209) works fine.
What is the cause of this? I can remove the valid expression and derive the outputs over the complete scene, but this would include results over the clouds. I am interested in masking out the clouds. Maybe there is an alternative for this?
Yes, I noticed that the valid pixel expression was not working in the gpt .xml I uploaded here. It is something with the expression, not the bands. Maybe @marpet can help here?
Which area do you use for processing?
Do you use the latest SNAP and S3TBX version or are you still on SNAP 8?
In some cases, the valid pixel expression is not working. For example, if the water is very turbid or is affected by glint. Then it needs to be adapted. To find a good expression you can use the mask manager and create a new mask. Change the expression till it fits your needs.
For example, this scene:
The red area is masked water by the default C2RCC expression, the blue area is water after changing the expression to B8 > 0 && B8 < 0.2
This slight change makes a big difference. Now there is too much marked, but this acceptable. Probably the OOS flags will flag these areas.
Another option to limit the processing to the area you need is to either load or create a geometry of the water body. This geometry can be used in the valid-pixel expression.
I’m sorry to hear that you run right into the next issue.
This error was reported before:
and
It seems to occur on some products, but as far as I know the actual reason has not been figured out.
I believe to remember the using the S2Resampling operator instead of the generic resampler can overcome this problem. It is anyway a good Idea to use S2 specific resampler for S2 data.
Maybe @FlorianD has some new insights regarding this issue.
In some it is said that it is due to corrupt data in other to limited compatibility of the S2Resampling operator with the Graph Builder. If tried the S2Resampling in the Graph Builder with the data from my previous example and got the same error. So, it seems it is an issue with the Graph Builder.
If you want to set up a graph you can still do and save the XML file. Then you can use it with gpt from the command line.
If you just want to execute it in SNAP Desktop you can use the standalone operators from the main menu. Execute each on the selected source product without saving to disk (except you want to keep some intermediate result). Save only the last step to disk. This is my preferred workflow as long I don’t use gpt.
@FlorianD Can you add this as an issue to our bug tracker.