class_docstr: MERSI-2/MERSI-LL L1B file reader.
docstr: Get the dataset as brightness temperature.
  
  Apparently we don't use these calibration factors for Rad -> BT::
  
      coeffs = self._get_coefficients(ds_info['calibration_key'], calibration_index)
      # coefficients are per-scan, we need to repeat the values for a
      # clean alignment
      coeffs = np.repeat(coeffs, data.shape[0] // coeffs.shape[1], axis=1)
      coeffs = coeffs.rename({
          coeffs.dims[0]: 'coefficients', coeffs.dims[1]: 'y'
      })  # match data dims
      data = coeffs[0] + coeffs[1] * data + coeffs[2] * data**2 + coeffs[3] * data**3
docstr_tok: ["Get","the","dataset","as","brightness","temperature",".","Apparently","we","do","n't","use","these","calibration","factors","for","Rad","-",">","BT",":",":","coeffs","=","self._get_coefficients","(","ds_info","[","'calibration_key","'","]",",","calibration_index",")","#","coefficients","are","per-scan",",","we","need","to","repeat","the","values","for","a","#","clean","alignment","coeffs","=","np.repeat","(","coeffs",",","data.shape","[","0","]","\/\/","coeffs.shape","[","1","]",",","axis=1",")","coeffs","=","coeffs.rename","(","{","coeffs.dims","[","0","]",":","'coefficients","'",",","coeffs.dims","[","1","]",":","'","y'","}",")","#","match","data","dims","data","=","coeffs","[","0","]","+","coeffs","[","1","]","*","data","+","coeffs","[","2","]","*","data","*","*","2","+","coeffs","[","3","]","*","data","*","*","3"]
code: def _get_bt_dataset(self, data, calibration_index, wave_number):
      """Get the dataset as brightness temperature.
  
      Apparently we don't use these calibration factors for Rad -> BT::
  
          coeffs = self._get_coefficients(ds_info['calibration_key'], calibration_index)
          # coefficients are per-scan, we need to repeat the values for a
          # clean alignment
          coeffs = np.repeat(coeffs, data.shape[0] // coeffs.shape[1], axis=1)
          coeffs = coeffs.rename({
              coeffs.dims[0]: 'coefficients', coeffs.dims[1]: 'y'
          })  # match data dims
          data = coeffs[0] + coeffs[1] * data + coeffs[2] * data**2 + coeffs[3] * data**3
  
      """
      # pass the dask array
      bt_data = rad2temp(
          wave_number, data.data * 1e-5
      )  # brightness temperature
      if isinstance(bt_data, np.ndarray):
          # old versions of pyspectral produce numpy arrays
          data.data = da.from_array(bt_data, chunks=data.data.chunks)
      else:
          # new versions of pyspectral can do dask arrays
          data.data = bt_data
  
      # Some BT bands seem to have 0 in the first 10 columns
      # and it is an invalid measurement, so let's mask
      data = data.where(data != 0)
  
      # additional corrections from the file
      if self.sensor_name == "mersi-2":
          corr_coeff_a = float(
              self["/attr/TBB_Trans_Coefficient_A"][calibration_index]
          )
          corr_coeff_b = float(
              self["/attr/TBB_Trans_Coefficient_B"][calibration_index]
          )
      elif self.sensor_name == "mersi-ll":
          # MERSI-LL stores these coefficients differently
          try:
              coeffs = self["/attr/TBB_Trans_Coefficient"]
              corr_coeff_a = coeffs[calibration_index]
              corr_coeff_b = coeffs[
                  calibration_index + N_TOT_IR_CHANS_LL
              ]
          except KeyError:
              return data
  
      if corr_coeff_a != 0:
          data = (data - corr_coeff_b) / corr_coeff_a
      # some bands have 0 counts for the first N columns and
      # seem to be invalid data points
      data = data.where(data != 0)
      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 9 for calling the MERSIL1B obj's underlying member method code with example usage: obj._get_bt_dataset(data, calibration_index, wave_number) and returns: data, data