What is Bitmask 2112

VPS
Posts: 11
Joined: Fri Jul 12, 2019 1:22 am
company / institution: University of Victoria
Location: Victoria

What is Bitmask 2112

Post by VPS »

Hi Francois,

I have processed my OLCI A Level 1 imageries with the POLYMER-v.4.13 and doing a matchup. Could you please tell me what is bitmask 2112 indicates. I couldn't find any explanation for this particular bitmask in the document. Can we use any pixel with this bitmask?

Also, could you please tell me If the BRDF correction for the POLYMER is applicable only for Case 1 waters?

Best

Vishnu
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: What is Bitmask 2112

Post by fsteinmetz »

Dear Vishnu,

Bitmask is coded in binary, where each bit represents a flag, as coded in bitmask's attributes, from LAND=1=2^0 to INCONSISTENCY=2048=2^11.
Thus 2112 = 64+2048 = THICK_AEROSOL+INCONSISTENCY
It is recommended to remove pixels where any of the first eleven bits is raised, thus where "bitmask & 1023 != 0" ("&" is the bitwise "and" operator), which is the case for this pixel.

The BRDF correction is applicable to both case 1 and case 2 waters.

Cheers,
François
VPS
Posts: 11
Joined: Fri Jul 12, 2019 1:22 am
company / institution: University of Victoria
Location: Victoria

Re: What is Bitmask 2112

Post by VPS »

Hi Francois,

For the quality control of OLCI A remote sensing reflectance (Rrs), I understood is that the recommended flags to be rejected are all flags with values strictly less than 1024 (the first 10 bits), which does not include CASE2 right? Is that so?

A few of my pixels are raised with Thick Aerosol and Inconsistency flags. Can I keep the inconsistency flags and delete the Aerosol pixel?

Also, I compared the Rrs from POLYMER.410 vs POLYMER4.13 and version 13 shows some instability and whenever the inconsistency flags raised the blue band goes negative and sometimes very weird pattern, like stripes. If you are interested I can send you a ppt where you can see the difference in the spectra.

Best

Vishnu
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: What is Bitmask 2112

Post by fsteinmetz »

Hi Vishnu,
Indeed, the recommended flags to be rejected are the first 10, which does not include CASE2.
I would advice that you can keep pixels flagged with "INCONSISTENCY" (value 2048) and remove those flagged with "THICK_AEROSOLS" (value 64), but your feedback is welcome if you identified instabilities.
Thanks,
Cheers,
François
VPS
Posts: 11
Joined: Fri Jul 12, 2019 1:22 am
company / institution: University of Victoria
Location: Victoria

Re: What is Bitmask 2112

Post by VPS »

Hi Francois,

We are doing some test using different versions of POLYMER and we are wondering If there is a way to avoid (not activate) the use of some flags. Is it possible to do this in POLYMER by changing some lines in the script? If yes, which is the python file name to look for and what should be done to not activate that particular flag?

Best

Vishnu
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: What is Bitmask 2112

Post by fsteinmetz »

Dear Vishnu,

There are two kind of flags:
1) Those for which the products are empty (set to NaN) - these are defined by the variable BITMASK_INVALID in params.py
2) The other flags (see common.py), for which the products are still calculated. These flags must be removed by the user, so avoiding them is not part of Polymer per se.
Which flag do you want to avoid exactly ?
Cheers,
François
VPS
Posts: 11
Joined: Fri Jul 12, 2019 1:22 am
company / institution: University of Victoria
Location: Victoria

Re: What is Bitmask 2112

Post by VPS »

Hi Francois,

We would like to test the product without raising Inconsistency, Thick Aerosol and Case-2 flags. So to do that which line should be modified in this file "common.py".

Best

Vishnu
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: What is Bitmask 2112

Post by fsteinmetz »

Hello Vishnu,
These flags are in the second category, so products are still provided by default even when these flags are raised. There is no need to modify anything in common.py.
Even "case2" (1024) and "inconsistency" (2048) are not included in the recommended bitmask value 1023. To avoid filtering "thick aerosol", you just have to avoid including the corresponding value (64). So the expression for filtering becomes : remove pixels such that "bitmask & 959 != 0" (1023-64=959)
Cheers,
François
VPS
Posts: 11
Joined: Fri Jul 12, 2019 1:22 am
company / institution: University of Victoria
Location: Victoria

Re: What is Bitmask 2112

Post by VPS »

Hello Francois/

I was wondering, how can I get the OLCI 674 nm band? Polymer is usually not giving this band right? So could you please tell me know how can I get this band.

Do I need to add any lines in params.py or any other python file? I hope adding this new band will not affect the atmospheric correction.

Best, Vishnu
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: What is Bitmask 2112

Post by fsteinmetz »

Hi Vishnu,

Yes you can pass the following option to run_atm_corr :

bands_rw=[400,412,443,490,510,560,620,665,674,681,709,754,779,865,1020],

which is equivalent to setting it in params.py:defaults_olci

Indeed, this band should be probably included by default !

Kind regards,

François
Post Reply