code: def _calibrate(data, chn, calib_type, mask=True):
      """Calibrate channel data.
  
      *calib_type* in brightness_temperature.
  
      """
      if calib_type not in ["brightness_temperature"]:
          raise ValueError("Calibration " + calib_type + " unknown!")
  
      channel = da.from_array(
          data["btemps"][:, :, chn] / 100.0, chunks=(LINE_CHUNK, 90)
      )
      mask &= channel != 0
  
      if calib_type == "counts":
          return channel
  
      channel = channel.astype(np.float64)
  
      return da.where(mask, channel, np.nan)
  
file_path: satpy/satpy/readers/aapp_mhs_amsub_l1c.py
imports: import logging
  import dask.array
  import numpy
  from satpy.readers.aapp_l1b import AAPPL1BaseFileHandler, create_xarray
  from satpy.utils import get_legacy_chunk_size
label_desc: Use image node_id 1 for calling a global function with example usage: _calibrate(data, chn, calib_type, mask) and returns: da, channel