示例#1
0
        /// <summary>
        /// Take the last ensemble as the parameter.  Fill in
        /// the averaged data to the ensemble.  Then publish
        /// it to all the subscribers.
        /// </summary>
        /// <param name="ensemble">Last ensemble that was accumulated.</param>
        private void PublishAverage(DataSet.Ensemble ensemble)
        {
            // Clone the ensemble
            DataSet.Ensemble avgEnsemble = ensemble.Clone();

            // Set the num of samples and the first ping time to the ensemble
            SetAveragedEnsembleParameters(ref avgEnsemble);

            // Correlation Averaging
            if (IsCorrelationAveraging)
            {
                _correlationAverager.SetAverage(ref avgEnsemble, _options.CorrelationScale);
            }

            // Amplitude averaging
            if (IsAmplitudeAveraging)
            {
                _amplitudeAverager.SetAverage(ref avgEnsemble, _options.AmplitudeScale);
            }

            // Beam Velocity Averging
            if (IsBeamVelocityAveraging)
            {
                _beamVelAverager.SetAverage(ref avgEnsemble, _options.BeamVelocityScale);
            }

            // Instrument Velocity Averging
            if (IsInstrumentVelocityAveraging)
            {
                _instrumentVelAverager.SetAverage(ref avgEnsemble, _options.InstrumentVelocityScale);
            }

            // Earth Velocity Averging
            if (IsEarthVelocityAveraging)
            {
                _earthVelAverager.SetAverage(ref avgEnsemble, _options.EarthVelocityScale);
            }

            // Bottom Track Averging
            if (IsBottomTrackAveraging)
            {
                _bottomTrackAverager.SetAverage(ref avgEnsemble, _options.BottomTrackRangeScale, _options.BottomTrackSnrScale,
                                                _options.BottomTrackAmplitudeScale, _options.BottomTrackCorrelationScale,
                                                _options.BottomTrackBeamVelocityScale, _options.BottomTrackInstrumentVelocityScale, _options.BottomTrackEarthVelocityScale);
            }

            // Reference Layer Averaging
            if (IsReferenceLayerAveraging)
            {
                _refLayerAverager.SetAverage(ref avgEnsemble, 1.0f);
            }

            // Publish the ensemble to all the subscribers
            PublishAveragedEnsemble(avgEnsemble);

            // Clear the accumulated data if not a running average
            if (!IsSampleRunningAverage)
            {
                // Clear the accumulated data
                ClearAccumulatedData();
            }
        }