class_docstr: File handler for the ASCAT Soil Moisture BUFR product.
class_docstr_tok: ["File","handler","for","the","ASCAT","Soil","Moisture","BUFR","product","."]
docstr: Get BUFR data by key.
docstr_tok: ["Get","BUFR","data","by","key","."]
code: def get_bufr_data(self, key):
      """Get BUFR data by key."""
      attr = np.array([])
      with open(self.filename, "rb") as fh:
          while True:
              # get handle for message
              bufr = ec.codes_bufr_new_from_file(fh)
              if bufr is None:
                  break
              ec.codes_set(bufr, "unpack", 1)
              tmp = ec.codes_get_array(bufr, key, float)
              if len(tmp) == 1:
                  size = ec.codes_get(bufr, "numberOfSubsets")
                  tmp = np.resize(tmp, size)
              attr = np.append(attr, tmp)
              ec.codes_release(bufr)
      return attr
  
file_path: satpy/satpy/readers/ascat_l2_soilmoisture_bufr.py
imports: import logging
  from datetime import datetime
  import dask.array
  import numpy
  import xarray
  from satpy.readers.file_handlers import BaseFileHandler
  from satpy.utils import get_legacy_chunk_size
label_desc: Use image node_id 7 for calling the AscatSoilMoistureBufr obj's underlying member method code with example usage: obj.get_bufr_data(key) and returns: attr