/**
   * Computes water vapour transmission for any band. Called by {@link #gas_correction}.
   *
   * <p>Reference: Level 2 DPM, step 2.6.12.3<br>
   * Uses:<br>
   * {@link L2AuxData#spectral_shift_H2Owavelength}, <br>
   * {@link L2AuxData#H2OcoefSpecShift}, <br>
   * {@link L2AuxData#H2Ocoef}, <br>
   * {@link #H2OT_POLY_K} <br>
   *
   * @param ib band index
   * @param R_h2o ratio rho(b15)/rho(b14)
   * @param detector detector index
   * @return h2o transmission in band ib
   */
  private double trans_h2o(int ib, double R_h2o, int detector) {
    double th2o, th2o_blw, th2o_abv;

    int k;

    if (ib == bb705)
    /* if (FALSE)  */ {

      /* DPM #2.1.3-1,2,3,4-b900 */
      Interp.interpCoord(
          auxData.central_wavelength[bb705][detector],
          auxData.spectral_shift_H2Owavelength,
          lh.spectralShift705);

      if (lh.spectralShift705.index == (PPOL_NUM_SHIFT - 1)) {
        lh.spectralShift705.index = PPOL_NUM_SHIFT - 2;
        lh.spectralShift705.fraction = 1.;
      }

      th2o_blw = 0.;
      th2o_abv = 0.;

      for (k = H2OT_POLY_K - 1; k >= 0; k--) {
        th2o_blw =
            R_h2o * th2o_blw
                + auxData.H2OcoefSpecShift[lh.spectralShift705.index][k]; /* DPM #2.6.12.3-2 */
        th2o_abv =
            R_h2o * th2o_abv
                + auxData.H2OcoefSpecShift[lh.spectralShift705.index + 1][k]; /* DPM #2.6.12.3-2 */
      }

      th2o =
          (1. - lh.spectralShift705.fraction) * th2o_blw
              + (lh.spectralShift705.fraction) * th2o_abv;
    } else {
      th2o = 0.;
      for (k = H2OT_POLY_K - 1; k >= 0; k--) {
        th2o = R_h2o * th2o + auxData.H2Ocoef[ib][k]; /* DPM #2.6.12.3-2 */
      }
    }

    return th2o;
  }
  /**
   * Computes o2 transmission for band {@link #bb12}. Called by {@link #gas_correction}.
   *
   * <p>Reference: Level 2 DPM, step 2.6.12.2<br>
   * Uses: {@link L2AuxData#central_wavelength} <br>
   * {@link L2AuxData#spectral_shift_wavelength} <br>
   * {@link L2AuxData#O2coef}<br>
   * {@link #PPOL_NUM_SHIFT}<br>
   * {@link #O2T_POLY_K}<br>
   *
   * @param ib band index (in case any other band is affected in the future)
   * @param R_o2 ratio rho(b11)/rho(b10)
   * @param detector detector index
   * @return o2 transmission in band ib
   */
  private double trans_o2(int ib, double R_o2, int detector) {

    double to2;

    if (ib == bb775) {

      /* DPM #2.6.12.2-3,  DPM #2.6.12.2-4, DPM #2.6.12.2-5, DPM #2.6.12.2-6 */
      Interp.interpCoord(
          auxData.central_wavelength[bb760][detector],
          auxData.spectral_shift_wavelength,
          lh.spectralShift760);

      if (lh.spectralShift760.index == (PPOL_NUM_SHIFT - 1)) {
        lh.spectralShift760.index = PPOL_NUM_SHIFT - 2;
        lh.spectralShift760.fraction = 1.;
      }

      double to2_blw = 0.;
      double to2_abv = 0.;

      for (int k = O2T_POLY_K - 1; k >= 0; k--) {
        /* DPM #2.6.12.3-2 */
        to2_blw = R_o2 * to2_blw + auxData.O2coef[lh.spectralShift760.index][k];
        /* DPM #2.6.12.3-2 */
        to2_abv = R_o2 * to2_abv + auxData.O2coef[lh.spectralShift760.index + 1][k];
      }

      to2 =
          (1. - lh.spectralShift760.fraction) * to2_blw + (lh.spectralShift760.fraction) * to2_abv;

    } else {
      to2 = 1.0; /* DPM #2.6.12.2-3 */
    }

    return to2;
  }