OceanColor.utils.decode_L2_flagmask

OceanColor.utils.decode_L2_flagmask(flag_mask: int)[source]

Decode Ocean Color flag mask

Some Ocean Color products use bitwise quality flags. This function converts those bits parsed as an integer into a list of flag labels. For instance, the binary 0010 values 2 in decimal and means that the second flag (LAND) is active.

Parameters

flag_mask (int) – The bitwise flag parsed as uint

Returns

List of flags activated byt the given flag_mask

Return type

list of str

References

Flags reference: https://oceancolor.gsfc.nasa.gov/atbd/ocl2flags/

Examples

>>> decode_L2_flagmask(1073741828)
['PRODWARN', 'PRODFAIL']

Notes

Some key flags used for L3 products:
  • ATMFAIL: Atmospheric correction failure

  • LAND: Pixel is over land

  • HIGLINT: Sunglint: reflectance exceeds threshold

  • HILT: Observed radiance very high or saturated

  • HISATZEN: Sensor view zenith angle exceeds threshold

  • STRAYLIGHT: Probable stray light contamination

  • CLDICE: Probable cloud or ice contamination

  • COCCOLITH: Coccolithophores detected

  • HISOLZEN: Solar zenith exceeds threshold

  • LOWLW: Very low water-leaving radiance

  • CHLFAIL: Chlorophyll algorithm failure

  • NAVWARN: Navigation quality is suspect

  • MAXAERITER: Maximum iterations reached for NIR iteration

  • CHLWARN: Chlorophyll out-of-bounds

  • ATMWARN: Atmospheric correction is suspect

  • NAVFAIL: Navigation failure

  • HIPOL: High degree of polarization determined