The Rrs product generated by l2gen is, by default, masked based on quality flags, including cloud detection. This means that pixels identified as contaminated by clouds, land, cloud shadows, high solar glint, and others are flagged as invalid or missing in the final product. However, I would like to prevent this masking from following the default behavior. I have already unchecked maskcloud and other parameters (glint_opt=0, maskcloud=0, maskland=0, maskglint=0, masksunzen=0, maskhilt=0). I have also tried adjusting cloud_threshold, but without success. I know this is a result of the default flag application, but I’m unsure what else I can do to modify it.
Is it possible to generate Rrs even where there are clouds? Including negative or saturated values?
l2gen Rrs in cloud pixels
-
- Posts: 1
- Joined: Mon May 12, 2025 9:13 am America/New_York
-
- User Services
- Posts: 45
- Joined: Mon Dec 16, 2024 8:43 am America/New_York
- Been thanked: 4 times
Re: l2gen Rrs in cloud pixels
Very few processing flags are masked in l2gen process, but yes, clouds is one of them. If l2gen determines a pixel is cloudy, it is extremely unlikely that Rrs could be retrieved if the mask were disabled (which you can do by setting the parameter maskcloud=0). The instrument has to see the ocean to measure it's reflectance. If there is a cloud, the instrument didn't see the ocean.
That said, the cloud test is a simplistic test on Rayleigh-, glint- and gas-corrected reflectance in (typically) a near infrared band (e.g. 865nm). It is possible that conditions other than the presence of a cloud can result in elevated signal in that band, but the processing may still be unable to produce a valid Rrs. For example, with MODIS the 869nm band can saturate over certain waters (e.g. extremely turbid waters). There may not be a cloud, but the default aerosol correction process requires non-saturated 869nm data. If it is saturated, the aerosol correction fails and no ocean retrieval is possible. Changing the processing to use the 859nm "land" band (which doesn't saturate) may help, but the code may still not retrieve a valid aerosol correction, so any Rrs derived may be suspect as the aerosol determination assumes the ocean is "black" in the NIR or that any non-neglible NIR reflectance can be corrected. In extremely turbid waters (such that the 869nm band saturates) the black-pixel assumption is invalid and the non-negligible NIR reflectance may not be "correctable", leading to an erroeous aerosol retrieval and thus an erroneous Rrs retrieval.
That's a bit more than you asked for, but it is a complicated process to get Rrs from space
Long story short, if l2gen detects a cloud there really isn't much you can do to tease out an Rrs signal...thus the mask.
Regards,
Sean
That said, the cloud test is a simplistic test on Rayleigh-, glint- and gas-corrected reflectance in (typically) a near infrared band (e.g. 865nm). It is possible that conditions other than the presence of a cloud can result in elevated signal in that band, but the processing may still be unable to produce a valid Rrs. For example, with MODIS the 869nm band can saturate over certain waters (e.g. extremely turbid waters). There may not be a cloud, but the default aerosol correction process requires non-saturated 869nm data. If it is saturated, the aerosol correction fails and no ocean retrieval is possible. Changing the processing to use the 859nm "land" band (which doesn't saturate) may help, but the code may still not retrieve a valid aerosol correction, so any Rrs derived may be suspect as the aerosol determination assumes the ocean is "black" in the NIR or that any non-neglible NIR reflectance can be corrected. In extremely turbid waters (such that the 869nm band saturates) the black-pixel assumption is invalid and the non-negligible NIR reflectance may not be "correctable", leading to an erroeous aerosol retrieval and thus an erroneous Rrs retrieval.
That's a bit more than you asked for, but it is a complicated process to get Rrs from space

Long story short, if l2gen detects a cloud there really isn't much you can do to tease out an Rrs signal...thus the mask.
Regards,
Sean