Example #1
0
            /// <summary>
            /// Convert the Pd0 Velocity data type to the RTI Earth Velocity data set.
            /// </summary>
            /// <param name="vel">PD0 Velocity.</param>
            public void DecodePd0Ensemble(Pd0Velocity vel)
            {
                NumElements        = vel.NumDepthCells;
                ElementsMultiplier = vel.NumBeams;

                if (vel.Velocities != null)
                {
                    EarthVelocityData = new float[vel.Velocities.GetLength(0), vel.Velocities.GetLength(1)];

                    for (int bin = 0; bin < vel.Velocities.GetLength(0); bin++)
                    {
                        for (int beam = 0; beam < vel.Velocities.GetLength(1); beam++)
                        {
                            // beam order 3,2,0,1; XYZ order 1,0,-2,3, ENU order 0,1,2,3

                            // Check for bad velocity
                            if (vel.Velocities[bin, beam] != PD0.BAD_VELOCITY)
                            {
                                EarthVelocityData[bin, beam] = vel.Velocities[bin, beam] / 1000.0f;   // m/s to mm/s
                            }
                            else
                            {
                                // Bad velocity
                                EarthVelocityData[bin, beam] = DataSet.Ensemble.BAD_VELOCITY;
                            }
                        }
                    }
                }
            }
Example #2
0
            /// <summary>
            /// Convert the Pd0 Velocity data type to the RTI Ship Velocity data set.
            /// </summary>
            /// <param name="vel">PD0 Velocity.</param>
            public void DecodePd0Ensemble(Pd0Velocity vel)
            {
                if (vel.Velocities != null)
                {
                    ShipVelocityData = new float[vel.Velocities.GetLength(0), vel.Velocities.GetLength(1)];

                    for (int bin = 0; bin < vel.Velocities.GetLength(0); bin++)
                    {
                        for (int beam = 0; beam < vel.Velocities.GetLength(1); beam++)
                        {
                            // beam order 3,2,0,1; XYZ order 1,0,-2,3, ENU order 0,1,2,3

                            // Check for bad velocity
                            if (vel.Velocities[bin, beam] != PD0.BAD_VELOCITY)
                            {
                                ShipVelocityData[bin, beam] = vel.Velocities[bin, beam] / 1000.0f;   // m/s to mm/s
                            }
                            else
                            {
                                // Bad velocity
                                ShipVelocityData[bin, beam] = DataSet.Ensemble.BAD_VELOCITY;
                            }
                        }
                    }
                }
            }
Example #3
0
            /// <summary>
            /// Convert the Pd0 Velocity data type to the RTI Beam Velocity data set.
            /// </summary>
            /// <param name="vel">PD0 Velocity.</param>
            public void DecodePd0Ensemble(Pd0Velocity vel)
            {
                NumElements        = vel.NumDepthCells;
                ElementsMultiplier = vel.NumBeams;

                if (vel.Velocities != null)
                {
                    BeamVelocityData = new float[vel.Velocities.GetLength(0), vel.Velocities.GetLength(1)];

                    for (int bin = 0; bin < vel.Velocities.GetLength(0); bin++)
                    {
                        for (int beam = 0; beam < vel.Velocities.GetLength(1); beam++)
                        {
                            // Remap only for 4 beam systems
                            int newBeam = 0;
                            if (vel.Velocities.GetLength(1) >= 4)
                            {
                                // PD0 beam order 3,2,0,1; PD0 XYZ order 1,0,-2,3, PD0 ENU order 0,1,2,3
                                switch (beam)
                                {
                                case 3:
                                    newBeam = 0;
                                    break;

                                case 2:
                                    newBeam = 1;
                                    break;

                                case 0:
                                    newBeam = 2;
                                    break;

                                case 1:
                                    newBeam = 3;
                                    break;

                                default:
                                    break;
                                }
                            }
                            else
                            {
                                newBeam = beam;
                            }

                            // Check for bad velocity
                            if (vel.Velocities[bin, newBeam] != PD0.BAD_VELOCITY)
                            {
                                BeamVelocityData[bin, beam] = vel.Velocities[bin, newBeam] / 1000.0f;   // m/s to mm/s
                            }
                            else
                            {
                                // Bad velocity
                                BeamVelocityData[bin, beam] = DataSet.Ensemble.BAD_VELOCITY;
                            }
                        }
                    }
                }
            }
Example #4
0
            /// <summary>
            /// Convert the Pd0 Velocity data type to the RTI Instrument Velocity data set.
            /// </summary>
            /// <param name="vel">PD0 Velocity.</param>
            public void DecodePd0Ensemble(Pd0Velocity vel)
            {
                if (vel.Velocities != null)
                {
                    InstrumentVelocityData = new float[vel.Velocities.GetLength(0), vel.Velocities.GetLength(1)];

                    for (int bin = 0; bin < vel.Velocities.GetLength(0); bin++)
                    {
                        for (int beam = 0; beam < vel.Velocities.GetLength(1); beam++)
                        {
                            // beam order 3,2,0,1; XYZ order 1,0,-2,3, ENU order 0,1,2,3
                            int sign = 1;
                            int newBeam = 0;
                            switch (beam)
                            {
                                case 1:
                                    newBeam = 0;
                                    sign = 1;
                                    break;
                                case 0:
                                    newBeam = 1;
                                    sign = 1;
                                    break;
                                case 2:
                                    newBeam = 2;
                                    sign = -1;
                                    break;
                                case 3:
                                    newBeam = 3;
                                    sign = 1;
                                    break;
                                default:
                                    break;
                            }

                            // Check for bad velocity
                            if (vel.Velocities[bin, newBeam] != PD0.BAD_VELOCITY)
                            {
                                InstrumentVelocityData[bin, beam] = (vel.Velocities[bin, newBeam] / 1000.0f) * sign;   // m/s to mm/s
                            }
                            else
                            {
                                // Bad velocity
                                InstrumentVelocityData[bin, beam] = DataSet.Ensemble.BAD_VELOCITY;
                            }
                        }
                    }
                }
            }
Example #5
0
            /// <summary>
            /// Convert the Pd0 Velocity data type to the RTI Earth Velocity data set.
            /// </summary>
            /// <param name="vel">PD0 Velocity.</param>
            public void DecodePd0Ensemble(Pd0Velocity vel)
            {
                if (vel.Velocities != null)
                {
                    EarthVelocityData = new float[vel.Velocities.GetLength(0), vel.Velocities.GetLength(1)];

                    for (int bin = 0; bin < vel.Velocities.GetLength(0); bin++)
                    {
                        for (int beam = 0; beam < vel.Velocities.GetLength(1); beam++)
                        {
                            // beam order 3,2,0,1; XYZ order 1,0,-2,3, ENU order 0,1,2,3

                            // Check for bad velocity
                            if (vel.Velocities[bin, beam] != PD0.BAD_VELOCITY)
                            {
                                EarthVelocityData[bin, beam] = vel.Velocities[bin, beam] / 1000.0f;   // m/s to mm/s
                            }
                            else
                            {
                                // Bad velocity
                                EarthVelocityData[bin, beam] = DataSet.Ensemble.BAD_VELOCITY;
                            }
                        }
                    }
                }
            }
Example #6
0
            /// <summary>
            /// Convert the Pd0 Velocity data type to the RTI Ship Velocity data set.
            /// </summary>
            /// <param name="vel">PD0 Velocity.</param>
            public void DecodePd0Ensemble(Pd0Velocity vel)
            {
                if (vel.Velocities != null)
                {
                    ShipVelocityData = new float[vel.Velocities.GetLength(0), vel.Velocities.GetLength(1)];

                    for (int bin = 0; bin < vel.Velocities.GetLength(0); bin++)
                    {
                        for (int beam = 0; beam < vel.Velocities.GetLength(1); beam++)
                        {
                            // Remap only for 4 beam systems
                            int newBeam = 0;
                            int sign    = 1;
                            if (vel.Velocities.GetLength(1) >= 4)
                            {
                                // beam order 3,2,0,1; XYZ and Ship order 1,0,-2,3, ENU order 0,1,2,3
                                switch (beam)
                                {
                                case 1:
                                    newBeam = 0;
                                    sign    = 1;
                                    break;

                                case 0:
                                    newBeam = 1;
                                    sign    = 1;
                                    break;

                                case 2:
                                    newBeam = 2;
                                    sign    = -1;
                                    break;

                                case 3:
                                    newBeam = 3;
                                    sign    = 1;
                                    break;

                                default:
                                    break;
                                }
                            }
                            else
                            {
                                sign    = 1;
                                newBeam = beam;
                            }

                            // Check for bad velocity
                            if (vel.Velocities[bin, newBeam] != PD0.BAD_VELOCITY)
                            {
                                ShipVelocityData[bin, beam] = (vel.Velocities[bin, newBeam] / 1000.0f) * sign;   // m/s to mm/s
                            }
                            else
                            {
                                // Bad velocity
                                ShipVelocityData[bin, beam] = DataSet.Ensemble.BAD_VELOCITY;
                            }
                        }
                    }
                }
            }