src/AircraftTrajectories/Models/TemporalGrid/GridConverter.cs
/// <summary>
/// Converts a single grid to the required unit
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Converts a single grid to the required unit
Converts a single grid to the required unit
protected Grid transformGrid(Grid input)
        {
            double[][] newData = new double[input.Data.Length][];
            for (int r=0; r<input.Data.Length; r++)
            {
                newData[r] = new double[input.Data[0].Length];
                for (int c=0; c<input.Data[0].Length; c++)
                {
                    double calcVal;
                    double l1 = input.Data[0].Length;
                    double l2 = calculationGrid.Data[0].Length;
                    double val = calculationGrid.Data[r][c];
                    double val2 = input.Data[r][c];
                    newData[r][c] = calculate(calculationGrid.Data[r][c], input.Data[r][c], out calcVal);
                    calculationGrid.Data[r][c] = calcVal;
                }
            }
            Grid newGrid = new Grid(newData, input.LowerLeftCorner, input.CellSize);
            newGrid.ReferencePoint = input.ReferencePoint;
            return newGrid;
        }
protected Grid transformGrid ( Grid input ) { double [ ] [ ] newData = new double [ input . Data . Length ] [ ] ; for ( int r = 0 ; r < input . Data . Length ; r ++ ) { newData [ r ] = new double [ input . Data [ 0 ] . Length ] ; for ( int c = 0 ; c < input . Data [ 0 ] . Length ; c ++ ) { double calcVal ; double l1 = input . Data [ 0 ] . Length ; double l2 = calculationGrid . Data [ 0 ] . Length ; double val = calculationGrid . Data [ r ] [ c ] ; double val2 = input . Data [ r ] [ c ] ; newData [ r ] [ c ] = calculate ( calculationGrid . Data [ r ] [ c ] , input . Data [ r ] [ c ] , out calcVal ) ; calculationGrid . Data [ r ] [ c ] = calcVal ; } } Grid newGrid = new Grid ( newData , input . LowerLeftCorner , input . CellSize ) ; newGrid . ReferencePoint = input . ReferencePoint ; return newGrid ; }
Converts a single grid to the required unit
Converts a single grid to the required unit
None
input
Grid
None