src/AircraftTrajectories/Models/Optimisation/NoisePowerDistance.cs
/// <summary>
/// Read and process the NPD database
/// </summary>
Read and process the NPD database
Read and process the NPD database
protected void readINMData()
        {
            string[][] rawData = ReadRawData();
            _INMData = new Dictionary<string, List<double[]>>();
            var currentOperatingMode = "";
            var currentKey = "";
            var engineData = new List<double[]>();
            foreach (string[] row in rawData)
            {
                if (row[2] != currentOperatingMode)
                {
                    if (currentOperatingMode != "")
                    {
                        _INMData.Add(currentKey, engineData);
                    }
                    engineData = new List<double[]>();
                    currentOperatingMode = row[2];
                    currentKey = row[0] + row[1] + row[2];
                }
                double[] engineThrustNoiseData = new double[11];
                for (int c = 3; c < row.Length-1; c++)
                {
                    engineThrustNoiseData[c-3] = double.Parse(row[c]);
                }
                engineData.Add(engineThrustNoiseData);
            }
        }
protected void readINMData ( ) { string [ ] [ ] rawData = ReadRawData ( ) ; _INMData = new Dictionary < string , List < double [ ] > > ( ) ; var currentOperatingMode = " " ; var currentKey = " " ; var engineData = new List < double [ ] > ( ) ; foreach ( string [ ] row in rawData ) { if ( row [ 2 ] != currentOperatingMode ) { if ( currentOperatingMode != " " ) { _INMData . Add ( currentKey , engineData ) ; } engineData = new List < double [ ] > ( ) ; currentOperatingMode = row [ 2 ] ; currentKey = row [ 0 ] + row [ 1 ] + row [ 2 ] ; } double [ ] engineThrustNoiseData = new double [ 11 ] ; for ( int c = 3 ; c < row . Length - 1 ; c ++ ) { engineThrustNoiseData [ c - 3 ] = double . Parse ( row [ c ] ) ; } engineData . Add ( engineThrustNoiseData ) ; } }
Read and process the NPD database
Read and process the NPD database
// Check whether we switch from operating mode // Confirm that this is not the first iteration (i.e. engineData is filled) // Reset engineData and currentOperatingMode for the next iterations // Construct a double array containing for a number of distances the uncorrected noise value // Add noise noise values for the curent thrust setting to engineData