Program: 11471
Project: 11471
Buggy source:
/** 
 * Apply calibrations to the given point. The following calibrations are included: calibration constant, antenna pattern compensation, range spreading loss correction and incidence angle correction.
 * @param v                   The pixel value.
 * @param slantRange          The slant range (in m).
 * @param satelliteHeight     The distance from satellite to earth centre (in m).
 * @param sceneToEarthCentre  The distance from the backscattering element position to earth centre (in m).
 * @param localIncidenceAngle The local incidence angle (in degrees).
 * @param bandPolar           The source band polarization index.
 * @param bandUnit            The source band unit.
 * @param subSwathIndex       The sub swath index for current pixel for wide swath product case.
 * @return The calibrated pixel value.
 */
public double applyCalibration(final double v,final double rangeIndex,final double azimuthIndex,final double slantRange,final double satelliteHeight,final double sceneToEarthCentre,final double localIncidenceAngle,final String bandPolar,final Unit.UnitType bandUnit,int[] subSwathIndex){
  double Ks=1.0;
  if (applyConstantCorrection) {
    Ks=calibrationFactor.get(bandPolar.toUpperCase());
  }
  double sigma=0.0;
  if (bandUnit == Unit.UnitType.AMPLITUDE) {
    sigma=v * v;
  }
 else   if (bandUnit == Unit.UnitType.INTENSITY || bandUnit == Unit.UnitType.REAL || bandUnit == Unit.UnitType.IMAGINARY) {
    sigma=v;
  }
 else   if (bandUnit == Unit.UnitType.INTENSITY_DB) {
    sigma=FastMath.pow(10,v / 10.0);
  }
 else {
    throw new OperatorException("String_Node_Str");
  }
  if (applyRangeSpreadingLossCorrection)   sigma*=FastMath.pow(referenceSlantRange,2 * referenceSlantRangeExp);
  if (applyIncidenceAngleCorrection)   sigma*=FastMath.sin(referenceIncidenceAngle);
  sigma/=(rescalingFactor * rescalingFactor * Ks);
  if (outputImageScaleInDb) {
    if (sigma < underFlowFloat) {
      sigma=-underFlowFloat;
    }
 else {
      sigma=10.0 * Math.log10(sigma);
    }
  }
  return sigma;
}

Fixed version (ground truth):
/** 
 * Apply calibrations to the given point. The following calibrations are included: calibration constant, antenna pattern compensation, range spreading loss correction and incidence angle correction.
 * @param v                   The pixel value.
 * @param slantRange          The slant range (in m).
 * @param satelliteHeight     The distance from satellite to earth centre (in m).
 * @param sceneToEarthCentre  The distance from the backscattering element position to earth centre (in m).
 * @param localIncidenceAngle The local incidence angle (in degrees).
 * @param bandPolar           The source band polarization index.
 * @param bandUnit            The source band unit.
 * @param subSwathIndex       The sub swath index for current pixel for wide swath product case.
 * @return The calibrated pixel value.
 */
public double applyCalibration(final double v,final double rangeIndex,final double azimuthIndex,final double slantRange,final double satelliteHeight,final double sceneToEarthCentre,final double localIncidenceAngle,final String bandName,final String bandPolar,final Unit.UnitType bandUnit,int[] subSwathIndex){
  double Ks=1.0;
  if (applyConstantCorrection) {
    Ks=calibrationFactor.get(bandPolar.toUpperCase());
  }
  double sigma=0.0;
  if (bandUnit == Unit.UnitType.AMPLITUDE) {
    sigma=v * v;
  }
 else   if (bandUnit == Unit.UnitType.INTENSITY || bandUnit == Unit.UnitType.REAL || bandUnit == Unit.UnitType.IMAGINARY) {
    sigma=v;
  }
 else   if (bandUnit == Unit.UnitType.INTENSITY_DB) {
    sigma=FastMath.pow(10,v / 10.0);
  }
 else {
    throw new OperatorException("String_Node_Str");
  }
  if (applyRangeSpreadingLossCorrection)   sigma*=FastMath.pow(referenceSlantRange,2 * referenceSlantRangeExp);
  if (applyIncidenceAngleCorrection)   sigma*=FastMath.sin(referenceIncidenceAngle);
  sigma/=(rescalingFactor * rescalingFactor * Ks);
  if (outputImageScaleInDb) {
    if (sigma < underFlowFloat) {
      sigma=-underFlowFloat;
    }
 else {
      sigma=10.0 * Math.log10(sigma);
    }
  }
  return sigma;
}