public void RunningAverageCorrelationTest()
        {
            AverageManager avgMgr = new AverageManager(new AverageManagerOptions());
            avgMgr.IsCorrelationAveraging = true;
            avgMgr.NumSamples = 3;
            avgMgr.IsAvgRunning = false;
            avgMgr.IsAvgByTimer = false;
            avgMgr.IsAvgByNumSamples = true;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(RunningAvgTest_AveragedEnsemble1);

            // Create an ensemble
            DataSet.Ensemble ens1 = EnsembleHelper.GenerateEnsemble(30);
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 2.1f;
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 3.1f;
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 4.1f;
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 5.1f;

            DataSet.Ensemble ens2 = EnsembleHelper.GenerateEnsemble(30);
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 3.2f;
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 4.2f;
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 5.2f;
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 6.2f;

            DataSet.Ensemble ens3 = EnsembleHelper.GenerateEnsemble(30);
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6;
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7;
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8;
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9;

            DataSet.Ensemble ens4 = EnsembleHelper.GenerateEnsemble(30);
            ens4.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6.1f;
            ens4.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7.1f;
            ens4.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8.1f;
            ens4.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9.1f;

            DataSet.Ensemble ens5 = EnsembleHelper.GenerateEnsemble(30);
            ens5.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6.2f;
            ens5.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7.23f;
            ens5.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8.2f;
            ens5.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9.2f;

            avgMgr.AddEnsemble(ens1);
            avgMgr.AddEnsemble(ens2);
            avgMgr.AddEnsemble(ens3);

            avgMgr.AveragedEnsemble -= RunningAvgTest_AveragedEnsemble1;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(RunningAvgTest_AveragedEnsemble2);
            avgMgr.AddEnsemble(ens4);

            avgMgr.AveragedEnsemble -= RunningAvgTest_AveragedEnsemble2;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(RunningAvgTest_AveragedEnsemble3);
            avgMgr.AddEnsemble(ens5);
        }
        public void RunningAverageReferencelayerTest()
        {
            AverageManager avgMgr = new AverageManager(new AverageManagerOptions());
            avgMgr.IsAvgRunning = true;
            avgMgr.NumSamples = 3;
            avgMgr.IsReferenceLayerAveraging = true;
            avgMgr.MinRefLayer = 1;
            avgMgr.MaxRefLayer = 3;
            avgMgr.IsAvgRunning = false;
            avgMgr.IsAvgByTimer = false;
            avgMgr.IsAvgByNumSamples = true;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(RunningAvgRefLayerTest_AveragedEnsemble1);

            // Create an ensemble
            // All zeros for Earth Velocity
            DataSet.Ensemble ens1 = EnsembleHelper.GenerateEnsemble(30);
            DataSet.Ensemble ens2 = EnsembleHelper.GenerateEnsemble(30);
            DataSet.Ensemble ens3 = EnsembleHelper.GenerateEnsemble(30);
            DataSet.Ensemble ens4 = EnsembleHelper.GenerateEnsemble(30);
            DataSet.Ensemble ens5 = EnsembleHelper.GenerateEnsemble(30);

            #region Ensemble 1

            ens1.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.3f;
            ens1.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.6f;
            ens1.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.2f;

            ens1.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.6f;
            ens1.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.3f;
            ens1.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.15f;

            ens1.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.4f;
            ens1.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.4f;
            ens1.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.11f;

            #endregion

            #region Ensemble 2

            ens2.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.4f;
            ens2.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.5f;
            ens2.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.3f;

            ens2.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.5f;
            ens2.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.42f;
            ens2.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.15f;

            ens2.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.6f;
            ens2.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.8f;
            ens2.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.2f;

            #endregion

            #region Ensemble 3

            ens3.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.4f;
            ens3.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.6f;
            ens3.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.2f;

            ens3.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.6f;
            ens3.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.23f;
            ens3.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.5f;

            ens3.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.12f;
            ens3.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.4f;
            ens3.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.123f;

            #endregion

            #region Ensemble 4

            ens4.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.3f;
            ens4.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.25f;
            ens4.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.3f;

            ens4.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.5f;
            ens4.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.54f;
            ens4.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.25f;

            ens4.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.4f;
            ens4.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.45f;
            ens4.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.4f;

            #endregion

            #region Ensemble 5

            ens5.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.3f;
            ens5.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.45f;
            ens5.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.3f;

            ens5.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.6f;
            ens5.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.25f;
            ens5.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.25f;

            ens5.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.45f;
            ens5.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.36f;
            ens5.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.14f;

            #endregion

            // Add the ensembles
            avgMgr.AddEnsemble(ens1);
            avgMgr.AddEnsemble(ens2);
            avgMgr.AddEnsemble(ens3);

            avgMgr.AveragedEnsemble -= RunningAvgRefLayerTest_AveragedEnsemble1;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(RunningAvgRefLayerTest_AveragedEnsemble2);
            avgMgr.AddEnsemble(ens4);

            avgMgr.AveragedEnsemble -= RunningAvgRefLayerTest_AveragedEnsemble2;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(RunningAvgRefLayerTest_AveragedEnsemble3);
            avgMgr.AddEnsemble(ens5);
        }
        public void FirstLastPingRunningTest()
        {
            AverageManager avgMgr = new AverageManager(new AverageManagerOptions());
            avgMgr.IsCorrelationAveraging = true;
            avgMgr.NumSamples = 5;
            avgMgr.IsAvgRunning = false;
            avgMgr.IsAvgByTimer = false;
            avgMgr.IsAvgByNumSamples = true;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(FirstLastPingRunningTest_AveragedEnsemble);

            // Create an ensemble
            DataSet.Ensemble ens1 = EnsembleHelper.GenerateEnsemble(30);
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 2;
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 3;
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 4;
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 5;
            ens1.AncillaryData.FirstPingTime = 1.1f;
            ens1.AncillaryData.LastPingTime = 1.1f;

            DataSet.Ensemble ens2 = EnsembleHelper.GenerateEnsemble(30);
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 3;
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 4;
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 5;
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 6;
            ens2.AncillaryData.FirstPingTime = 2.2f;
            ens2.AncillaryData.LastPingTime = 2.2f;

            DataSet.Ensemble ens3 = EnsembleHelper.GenerateEnsemble(30);
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6;
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7;
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8;
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9;
            ens3.AncillaryData.FirstPingTime = 3.3f;
            ens3.AncillaryData.LastPingTime = 3.3f;

            DataSet.Ensemble ens4 = EnsembleHelper.GenerateEnsemble(30);
            ens4.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6;
            ens4.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7;
            ens4.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8;
            ens4.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9;
            ens4.AncillaryData.FirstPingTime = 4.4f;
            ens4.AncillaryData.LastPingTime = 4.4f;

            avgMgr.AddEnsemble(ens1);
            avgMgr.AddEnsemble(ens2);

            avgMgr.AveragedEnsemble -= FirstLastPingRunningTest_AveragedEnsemble;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(FirstLastPingRunningTest_AveragedEnsemble1);

            avgMgr.AddEnsemble(ens3);
            avgMgr.AveragedEnsemble -= FirstLastPingRunningTest_AveragedEnsemble1;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(FirstLastPingRunningTest_AveragedEnsemble2);

            avgMgr.AddEnsemble(ens4);
        }
        public void AverageAll()
        {
            AverageManager avgMgr = new AverageManager(new AverageManagerOptions());
            avgMgr.IsAmplitudeAveraging = true;
            avgMgr.IsReferenceLayerAveraging = true;
            avgMgr.IsCorrelationAveraging = true;
            avgMgr.NumSamples = 5;
            avgMgr.IsAvgRunning = false;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(AverageAll_AveragedEnsemble);

            // Create an ensemble
            // All zeros for Earth Velocity
            DataSet.Ensemble ens1 = EnsembleHelper.GenerateEnsemble(30);
            DataSet.Ensemble ens2 = EnsembleHelper.GenerateEnsemble(30);
            DataSet.Ensemble ens3 = EnsembleHelper.GenerateEnsemble(30);
            DataSet.Ensemble ens4 = EnsembleHelper.GenerateEnsemble(30);
            DataSet.Ensemble ens5 = EnsembleHelper.GenerateEnsemble(30);

            #region Ensemble 1

            ens1.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.3f;
            ens1.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.6f;
            ens1.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.2f;

            ens1.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.6f;
            ens1.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.3f;
            ens1.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.15f;

            ens1.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.4f;
            ens1.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.4f;
            ens1.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.11f;

            ens1.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_0_INDEX] = 2.3f;
            ens1.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_1_INDEX] = 3.3f;
            ens1.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_2_INDEX] = 4.3f;
            ens1.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_3_INDEX] = 5.3f;

            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 2.1f;
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 3.1f;
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 4.1f;
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 5.1f;

            #endregion

            #region Ensemble 2

            ens2.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.4f;
            ens2.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.5f;
            ens2.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.3f;

            ens2.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.5f;
            ens2.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.42f;
            ens2.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.15f;

            ens2.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.6f;
            ens2.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.8f;
            ens2.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.2f;

            ens2.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_0_INDEX] = 3.5f;
            ens2.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_1_INDEX] = 4.5f;
            ens2.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_2_INDEX] = 5.5f;
            ens2.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_3_INDEX] = 6.5f;

            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 3.2f;
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 4.2f;
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 5.2f;
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 6.2f;

            #endregion

            #region Ensemble 3

            ens3.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.4f;
            ens3.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.6f;
            ens3.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.2f;

            ens3.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.6f;
            ens3.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.23f;
            ens3.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.5f;

            ens3.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.12f;
            ens3.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.4f;
            ens3.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.123f;

            ens3.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6;
            ens3.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7;
            ens3.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8;
            ens3.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9;

            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6;
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7;
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8;
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9;

            #endregion

            #region Ensemble 4

            ens4.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.3f;
            ens4.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.25f;
            ens4.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.3f;

            ens4.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.5f;
            ens4.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.54f;
            ens4.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.25f;

            ens4.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.4f;
            ens4.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.45f;
            ens4.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.4f;

            ens4.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6.1f;
            ens4.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7.1f;
            ens4.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8.1f;
            ens4.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9.1f;

            ens4.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6.1f;
            ens4.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7.1f;
            ens4.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8.1f;
            ens4.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9.1f;

            #endregion

            #region Ensemble 5

            ens5.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.3f;
            ens5.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.45f;
            ens5.EarthVelocityData.EarthVelocityData[1, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.3f;

            ens5.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.6f;
            ens5.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.25f;
            ens5.EarthVelocityData.EarthVelocityData[2, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.25f;

            ens5.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_EAST_INDEX] = 2.45f;
            ens5.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_NORTH_INDEX] = 1.36f;
            ens5.EarthVelocityData.EarthVelocityData[3, DataSet.Ensemble.BEAM_VERTICAL_INDEX] = 0.14f;

            ens5.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6.2f;
            ens5.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7.2f;
            ens5.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8.2f;
            ens5.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9.2f;

            ens5.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6.2f;
            ens5.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7.23f;
            ens5.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8.2f;
            ens5.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9.2f;

            #endregion

            // Add the ensembles
            avgMgr.AddEnsemble(ens1);
            avgMgr.AddEnsemble(ens2);
            avgMgr.AddEnsemble(ens3);
            avgMgr.AddEnsemble(ens4);
            avgMgr.AddEnsemble(ens5);
        }
        public void AverageParametersTest()
        {
            AverageManager avgMgr = new AverageManager(new AverageManagerOptions());
            avgMgr.IsAmplitudeAveraging = true;
            avgMgr.NumSamples = 3;
            avgMgr.IsAvgRunning = false;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(AverageParametersTest_AveragedEnsemble);

            // Create an ensemble
            DataSet.Ensemble ens1 = EnsembleHelper.GenerateEnsemble(30);
            ens1.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_0_INDEX] = 2;
            ens1.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_1_INDEX] = 3;
            ens1.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_2_INDEX] = 4;
            ens1.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_3_INDEX] = 5;
            ens1.EnsembleData.ActualPingCount = 1;
            ens1.EnsembleData.DesiredPingCount = 1;
            ens1.AncillaryData.FirstPingTime = 1.123f;
            ens1.AncillaryData.LastPingTime = 1.123f;

            DataSet.Ensemble ens2 = EnsembleHelper.GenerateEnsemble(30);
            ens2.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_0_INDEX] = 3;
            ens2.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_1_INDEX] = 4;
            ens2.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_2_INDEX] = 5;
            ens2.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_3_INDEX] = 6;
            ens2.EnsembleData.ActualPingCount = 1;
            ens2.EnsembleData.DesiredPingCount = 1;
            ens2.AncillaryData.FirstPingTime = 2.123f;
            ens2.AncillaryData.LastPingTime = 2.123f;

            DataSet.Ensemble ens3 = EnsembleHelper.GenerateEnsemble(30);
            ens3.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6;
            ens3.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7;
            ens3.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8;
            ens3.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9;
            ens3.EnsembleData.ActualPingCount = 1;
            ens3.EnsembleData.DesiredPingCount = 1;
            ens3.AncillaryData.FirstPingTime = 3.123f;
            ens3.AncillaryData.LastPingTime = 3.123f;

            avgMgr.AddEnsemble(ens1);
            avgMgr.AddEnsemble(ens2);
            avgMgr.AddEnsemble(ens3);
        }
        public void AverageCorrelationTest()
        {
            AverageManager avgMgr = new AverageManager(new AverageManagerOptions());
            avgMgr.IsCorrelationAveraging = true;
            avgMgr.NumSamples = 3;
            avgMgr.IsAvgRunning = false;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(AverageCorrelationTest_AveragedEnsemble);

            // Create an ensemble
            DataSet.Ensemble ens1 = EnsembleHelper.GenerateEnsemble(30);
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 2;
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 3;
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 4;
            ens1.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 5;

            DataSet.Ensemble ens2 = EnsembleHelper.GenerateEnsemble(30);
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 3;
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 4;
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 5;
            ens2.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 6;

            DataSet.Ensemble ens3 = EnsembleHelper.GenerateEnsemble(30);
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6;
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7;
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8;
            ens3.CorrelationData.CorrelationData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9;

            avgMgr.AddEnsemble(ens1);
            avgMgr.AddEnsemble(ens2);
            avgMgr.AddEnsemble(ens3);
        }
Exemple #7
0
        public void RunningAverageAmplitudeTest()
        {
            AverageManager avgMgr = new AverageManager(new AverageManagerOptions());
            avgMgr.IsAmplitudeAveraging = true;
            avgMgr.NumSamples = 3;
            avgMgr.IsRunningAverage = true;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(RunningAvgAmpTest_AveragedEnsemble1);

            // Create an ensemble
            DataSet.Ensemble ens1 = EnsembleHelper.GenerateEnsemble(30);
            ens1.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_0_INDEX] = 2.1f;
            ens1.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_1_INDEX] = 3.1f;
            ens1.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_2_INDEX] = 4.1f;
            ens1.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_3_INDEX] = 5.1f;

            DataSet.Ensemble ens2 = EnsembleHelper.GenerateEnsemble(30);
            ens2.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_0_INDEX] = 3.2f;
            ens2.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_1_INDEX] = 4.2f;
            ens2.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_2_INDEX] = 5.2f;
            ens2.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_3_INDEX] = 6.2f;

            DataSet.Ensemble ens3 = EnsembleHelper.GenerateEnsemble(30);
            ens3.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6;
            ens3.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7;
            ens3.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8;
            ens3.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9;

            DataSet.Ensemble ens4 = EnsembleHelper.GenerateEnsemble(30);
            ens4.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6.1f;
            ens4.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7.1f;
            ens4.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8.1f;
            ens4.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9.1f;

            DataSet.Ensemble ens5 = EnsembleHelper.GenerateEnsemble(30);
            ens5.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_0_INDEX] = 6.2f;
            ens5.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_1_INDEX] = 7.23f;
            ens5.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_2_INDEX] = 8.2f;
            ens5.AmplitudeData.AmplitudeData[0, DataSet.Ensemble.BEAM_3_INDEX] = 9.2f;

            avgMgr.AddEnsemble(ens1);
            avgMgr.AddEnsemble(ens2);
            avgMgr.AddEnsemble(ens3);

            avgMgr.AveragedEnsemble -= RunningAvgAmpTest_AveragedEnsemble1;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(RunningAvgAmpTest_AveragedEnsemble2);
            avgMgr.AddEnsemble(ens4);

            avgMgr.AveragedEnsemble -= RunningAvgAmpTest_AveragedEnsemble2;
            avgMgr.AveragedEnsemble += new AverageManager.AveragedEnsembleEventHandler(RunningAvgAmpTest_AveragedEnsemble3);
            avgMgr.AddEnsemble(ens5);
        }