docs: def read_modis_response(filename, scale=1.0):
      """Read the Terra/Aqua MODIS relative spectral responses. Be aware that
      MODIS has several detectors (more than one) compared to e.g. AVHRR which
      has always only one.
      """
      with open(filename, "r") as fid:
          lines = fid.readlines()
  
      nodata = -99.0
      # The IR channels seem to be in microns, whereas the short wave channels are
      # in nanometers! For VIS/NIR scale should be 0.001
      detectors = {}
      for line in lines:
          if line.find("#") == 0:
              continue
          dummy, det_num, s_1, s_2 = line.split()
          detector_name = 'det-{0:d}'.format(int(det_num))
          if detector_name not in detectors:
              detectors[detector_name] = {'wavelength': [], 'response': []}
  
          detectors[detector_name]['wavelength'].append(float(s_1) * scale)
          detectors[detector_name]['response'].append(float(s_2))
  
      for key in detectors:
          mask = np.array(detectors[key]['response']) == nodata
          detectors[key]['response'] = np.ma.masked_array(
              detectors[key]['response'], mask=mask).compressed()
          detectors[key]['wavelength'] = np.ma.masked_array(
              detectors[key]['wavelength'], mask=mask).compressed()
  
      return detectors