class_docstr: MERSI-2/MERSI-LL L1B file reader.
docstr: Load data variable and metadata and calibrate if needed.
docstr_tok: ["Load","data","variable","and","metadata","and","calibrate","if","needed","."]
code: def get_dataset(self, dataset_id, ds_info):
      """Load data variable and metadata and calibrate if needed."""
      file_key = ds_info.get("file_key", dataset_id["name"])
      band_index = ds_info.get("band_index")
      data = self[file_key]
      if band_index is not None:
          data = data[band_index]
      if data.ndim >= 2:
          data = data.rename({data.dims[-2]: "y", data.dims[-1]: "x"})
      attrs = (
          data.attrs.copy()
      )  # avoid contaminating other band loading
      attrs.update(ds_info)
      if "rows_per_scan" in self.filetype_info:
          attrs.setdefault(
              "rows_per_scan", self.filetype_info["rows_per_scan"]
          )
  
      data = self._mask_data(data, dataset_id, attrs)
  
      slope = attrs.pop("Slope", None)
      intercept = attrs.pop("Intercept", None)
      if (
          slope is not None
          and dataset_id.get("calibration") != "counts"
      ):
          if band_index is not None:
              slope = slope[band_index]
              intercept = intercept[band_index]
          data = data * slope + intercept
  
      if dataset_id.get("calibration") == "reflectance":
          coeffs = self._get_coefficients(
              ds_info["calibration_key"], ds_info["calibration_index"]
          )
          data = coeffs[0] + coeffs[1] * data + coeffs[2] * data**2
      elif dataset_id.get("calibration") == "brightness_temperature":
          calibration_index = ds_info["calibration_index"]
          # Converts um^-1 (wavenumbers) and (mW/m^2)/(str/cm^-1) (radiance data)
          # to SI units m^-1, mW*m^-3*str^-1.
          wave_number = 1.0 / (dataset_id["wavelength"][1] / 1e6)
  
          data = self._get_bt_dataset(
              data, calibration_index, wave_number
          )
  
      data.attrs = attrs
      # convert bytes to str
      for key, val in attrs.items():
          # python 3 only
          if bytes is not str and isinstance(val, bytes):
              data.attrs[key] = val.decode("utf8")
  
      data.attrs.update(
          {
              "platform_name": self["/attr/Satellite Name"],
              "sensor": self.sensor_name,
          }
      )
  
      return data
  
file_path: satpy/satpy/readers/mersi_l1b.py
imports: from datetime import datetime
  import dask.array
  import numpy
  from pyspectral.blackbody import blackbody_wn_rad2temp
  from satpy.readers.hdf5_utils import HDF5FileHandler
label_desc: Use image node_id 7 for calling the MERSIL1B obj's underlying member method code with example usage: obj.get_dataset(dataset_id, ds_info) and returns: data