src/AircraftTrajectories/Models/TemporalGrid/GridConverter.cs
/// <summary>
/// Calculates the noise for the chosen output level based on the previous and current value
/// </summary>
/// <param name="previousVal"></param>
/// <param name="newVal"></param>
/// <returns></returns>
Calculates the noise for the chosen output level based on the previous and current value
Calculates the noise for the chosen output level based on the previous and current value
protected double calculate(double calculationValue, double newVal, out double newCalculationValue)
        {
            switch (_transformation)
            {
                case GridTransformation.MAX:
                    newCalculationValue = Math.Max(calculationValue, newVal);
                    return newCalculationValue;
                case GridTransformation.SEL:
                    newCalculationValue = calculationValue + Math.Pow(10.0, newVal / 10.0);
                    return 10.0 * Math.Log10(newCalculationValue);
                case GridTransformation.LDEN:
                    newCalculationValue = calculationValue + Math.Pow(10.0, newVal / 10.0);
                    return 10.0*Math.Log10(newCalculationValue);
                default:
                    newCalculationValue = calculationValue;
                    return 0;
            }
        }
protected double calculate ( double calculationValue , double newVal , out double newCalculationValue ) { switch ( _transformation ) { case GridTransformation . MAX : newCalculationValue = Math . Max ( calculationValue , newVal ) ; return newCalculationValue ; case GridTransformation . SEL : newCalculationValue = calculationValue + Math . Pow ( 10.0 , newVal / 10.0 ) ; return 10.0 * Math . Log10 ( newCalculationValue ) ; case GridTransformation . LDEN : newCalculationValue = calculationValue + Math . Pow ( 10.0 , newVal / 10.0 ) ; return 10.0 * Math . Log10 ( newCalculationValue ) ; default : newCalculationValue = calculationValue ; return 0 ; } }
Calculates the noise for the chosen output level based on the previous and current value
Calculates the noise for the chosen output level based on the previous and current value
None
calculationValue
double
newVal
double
None
double
out
previousVal
None