code: def _counts2radiance(self, counts, coefs, channel):
          
          logger.debug('Converting counts to radiance')
  
          if self._is_vis(channel):
              # Since the scanline-detector assignment is unknown, use the average
              # coefficients for all scanlines.
              slope = np.array(coefs['slope']).mean()
              offset = np.array(coefs['offset']).mean()
              return self._viscounts2radiance(counts=counts, slope=slope,
                                              offset=offset)
  
          return self._ircounts2radiance(counts=counts, scale=coefs['scale'],
                                         offset=coefs['offset'])
docs: Convert raw detector counts to radiance