FLAGS

Post Reply
adogliotti
Posts: 11
Joined: Tue Apr 12, 2016 4:04 pm

FLAGS

Post by adogliotti »

Hi Quinten,

I've been processing S2 A and B as well as L8 in batch mode and I've realized there is a band with flags. Can you indicate what each flag indicates?

I'm also wondering... could it be possible that if all pixels are flagged the png of the products are not generated? Sometimes I get only L2 and RGB nc files but only one png from a product (e.g. GONS chl) with only a few pixels with data.
Thanks again

Ana
quinten
Posts: 1022
Joined: Tue Mar 03, 2015 8:13 am

Re: FLAGS

Post by quinten »

Hi Ana

Not a whole lot is currently tracked in the flags dataset, basically if the value is equal to 0 the output is not masked. A short list of different flags:
bit 1 (1) = this part of your ROI is out of the scene
bit 2 (2) = these pixels are "non-water" according to the masking band and threshold used (default SWIR 1.6 and 2.15%)
bit 3 (4) = used in alternative processing (AOT out of range)
bit 4 (8) = these pixels have a negative rho_w value in any of the bands (if this is set, 2 will be automatically set)

Note that you need to perform logical tests on the values to find out if a bit is set. E.g. a flag value of 10 would be bit 2 (2) and bit 4 (8).

The mapping should be independent of the number of masked pixels. If you send me an example where not all products are mapped I can have a look at the issue.

Quinten
adogliotti
Posts: 11
Joined: Tue Apr 12, 2016 4:04 pm

Re: FLAGS

Post by adogliotti »

Hi Quinten,

I keep wondering about the flags... in this (attached) S2 image over a lake there are many pixels flagged with 1, but they do not seem to be pixels out the scene...
Any idea?
Thanks

Ana
Attachments
S2A_OPER_MSI_L1C_TL_SGS__20170501T201532_A009702_T21HVA_N02_FLAGS.png
S2A_OPER_MSI_L1C_TL_SGS__20170501T201532_A009702_T21HVA_N02_FLAGS.png (7.52 KiB) Viewed 79485 times
quinten
Posts: 1022
Joined: Tue Mar 03, 2015 8:13 am

Re: FLAGS

Post by quinten »

Hi Ana

These could be "bad" SWIR pixels, where the TOA reflectance is equal to zero. The "out of scene" check is rather simple and checks just for TOA zeroes I believe. Note that these zeroes would also give problems in the estimation of the aerosol reflectance. (Undefined epsilon or a zero aerosol reflectance.)

Quinten
Post Reply