class_docstr: Test the bitflag reading.
class_docstr_tok: ["Test","the","bitflag","reading","."]
docstr: Test the BitFlags class.
docstr_tok: ["Test","the","BitFlags","class","."]
code: def test_bitflags(self):
      """Test the BitFlags class."""
      from functools import reduce
  
      import numpy as np
  
      from satpy.readers.olci_nc import BitFlags
  
      flag_list = [
          "SEA_ICE",
          "MEGLINT",
          "HIGHGLINT",
          "CASE2_S",
          "CASE2_ANOM",
          "HAZE_OVER_WATER",
          "WHITECAPS",
          "AC_FAIL",
          "BPAC_ON",
          "WHITE_SCATT",
          "LOWRW",
          "HIGHRW",
          "OUT_OF_RANGE_AAC",
          "OUT_OF_SCOPE_AAC",
          "OUT_OF_RANGE_OC_NN",
          "OUT_OF_SCOPE_OC_NN",
          "OUT_OF_RANGE_CHL_OC4ME_INPUT",
          "OUT_OF_RANGE_CHL_OC4ME",
      ]
  
      bits = np.array([1 << x for x in range(len(flag_list))])
  
      bflags = BitFlags(bits, flag_list=flag_list)
  
      items = [
          "SEA_ICE",
          "MEGLINT",
          "HIGHGLINT",
          "HAZE_OVER_WATER",
          "WHITECAPS",
          "AC_FAIL",
          "WHITE_SCATT",
          "LOWRW",
          "HIGHRW",
          "OUT_OF_RANGE_AAC",
          "OUT_OF_SCOPE_AAC",
          "OUT_OF_RANGE_OC_NN",
          "OUT_OF_SCOPE_OC_NN",
          "OUT_OF_RANGE_CHL_OC4ME_INPUT",
          "OUT_OF_RANGE_CHL_OC4ME",
      ]
  
      mask = reduce(np.logical_or, [bflags[item] for item in items])
      expected = np.array(
          [
              True,
              True,
              True,
              False,
              False,
              True,
              True,
              True,
              False,
              True,
              True,
              True,
              True,
              True,
              True,
              True,
              True,
              True,
          ]
      )
      assert all(mask == expected)
  
file_path: satpy/satpy/tests/reader_tests/test_meris_nc.py
imports: import unittest
  import unittest.mock
label_desc: Use image node_id 1 for calling the TestBitFlags obj's underlying member method code with example usage: obj.test_bitflags() without return types