Cloud masking after preprocessing Landsat8 with ICor plug-in in SNAP

Hi there,

I am using the ICor plugin in SNAP for preprocessing some L8 scenes that were acquired between May 2013 and July 2018. My intention is to do the atmospheric correction and then mask the clouds in some scenes. I’ve tried to do it first with IdePix Masking algorithm in SNAP, but it returns an error stating that the sensor is not recognized. I figured this happens because the metadata is no longer preserved in the output product (similarly to what happens when using sen2cor for S2). Reading the manual for ICor I’ve noticed that there is an option for preserving the Cloud Mask as an intermediate output in the product (Keep intermediate= TRUE). However, after trying to reprocess, there is no difference between the product with this option set on FALSE and the one with the option set on TRUE, with no additional information added. Is this how it should look like? Is there any way to perform Cloud Masking on the L8 products after the ICor plugin in SNAP? I was also looking for workarounds for CM in QGIS/with GDAL/Python, did anyone use any successful method after preprocessing with ICor, so far?

Also, maybe it is worth mentioning that when trying to perform Batch Processing using a graph containing ICor, it doesn’t run. I’m using SNAP 6.0. Did you encounter this problem?

Thanks!

maybe you can try Fmask for landsat8

Regarding Idepix. You could use it on the original L8 data and then merge it with iCOR result. This could be done with a GPF graph.
I guess FMASk will also not work on the iCOR output because of the format changes by running iCOR.

@xiashenzhen, @marpet thank you both for your answers.
@xiashenzhen - we were taking this into account, but looking at the documentation of FMask, it seems that it requires the B9, which is not preserved in the ICor product.
@marpet - you are right, Fmask should not work because it also uses the Cirrus band, which is not there anymore.
About the GPF graph - https://senbox.atlassian.net/wiki/spaces/SNAP/pages/70503590/Creating+a+GPF+Graph is this the reference? There is a simple example about cloud masking for a MERIS example, in which you use the band maths operator and create the new band based on information that is already in the product. I lost all that with the ICor.

I was thinking that a simple way to do the cloud mask could be to classically threshold after having a look at the pixel values for clouds. Maybe not the most elegant solution, but it is quite close…

I do this by lasrc, it include the fmask. why do you not use lasrc.

Yes, this is the right reference.
There are also a few more examples here: https://forum.step.esa.int/c/gpf-graphs

If thresholding works for you why not? It is the easiest way. But if you want to do it on several scenes it will probably not give good results.

For windows users the ICOR intermediate files (such as the cloud mask) are stored in the following folder" c:\users[usenamer]\appData\Local\Temp\icor_[randomname]_proc " and not in the specified Temp folder . The appData folder might be a hidden folder (see iCOR manual section 5 Failures)

The ICOR intermediate cloud mask is used in the ICOR AOT retrieval step. No cloud masking is performed on the final reflectance data.

1 Like

I did not really check that and we’ve found a workaround that seems to work fine enough, using the quality band BQA in the Landsat 8 product. I will have a look and try a new processing using ICor and report back on the results. Thank you!