⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mwcsdetector.hpp

📁 gps源代码
💻 HPP
📖 第 1 页 / 共 2 页
字号:
        /// Method to get the maximum interval of time allowed between two successive epochs, in seconds.        virtual double getDeltaTMax() const        {           return deltaTMax;        };        /** Method to set the maximum deviation allowed before declaring cycle slip (in number of Melbourne-Wubbena wavelenghts).         * @param mLambdas     Maximum deviation allowed before declaring cycle slip (in number of Melbourne-Wubbena wavelenghts).         */        virtual void setMaxNumLambdas(const double& mLambdas)        {            // Don't allow number of lambdas less than or equal to 0            if (mLambdas > 0.0) maxNumLambdas = mLambdas; else maxNumLambdas = 10.0;        };        /// Method to get the maximum deviation allowed before declaring cycle slip (in number of Melbourne-Wubbena wavelenghts).        virtual double getMaxNumLambdas() const        {           return maxNumLambdas;        };        /** Method to set whether the LLI indexes will be used as an aid or not.         * @param use   Boolean value enabling/disabling LLI check         */        virtual void setUseLLI(const bool& use)        {            useLLI = use;        };        /// Method to know if the LLI check is enabled or disabled.        virtual bool getUseLLI() const        {           return useLLI;        };        /** Returns a gnnsSatTypeValue object, adding the new data generated when calling this object.         *         * @param gData    Data object holding the data.         */        virtual gnssSatTypeValue& Detect(gnssSatTypeValue& gData)        {            (*this).Detect(gData.header.epoch, gData.body);            return gData;        };        /** Returns a gnnsRinex object, adding the new data generated when calling this object.         *         * @param gData    Data object holding the data.         */        virtual gnssRinex& Detect(gnssRinex& gData)        {            (*this).Detect(gData.header.epoch, gData.body, gData.header.epochFlag);            return gData;        };        /// Destructor        virtual ~MWCSDetector() {};    private:        /// Type of code.        TypeID obsType;        /// Type of LMW1 record.        TypeID lliType1;        /// Type of LMW2 record.        TypeID lliType2;        /// Type of result #1.        TypeID resultType1;        /// Type of result #2.        TypeID resultType2;        /// Maximum interval of time allowed between two successive epochs, in seconds.        double deltaTMax;        /// Maximum deviation allowed before declaring cycle slip (in number of Melbourne-Wubbena wavelenghts).        double maxNumLambdas;        /// This field tells whether to use or ignore the LLI indexes as an aid.         bool useLLI;        /// A structure used to store filter data for a SV.        struct filterData        {            // Default constructor initializing the data in the structure            filterData() : formerEpoch(DayTime::BEGINNING_OF_TIME), windowSize(0), meanMW(0.0) {};            DayTime formerEpoch;    ///< The previous epoch time stamp.            int windowSize;         ///< Size of current window, in samples.            double meanMW;          ///< Accumulated mean value of combination        };        /// Map holding the information regarding every satellite        std::map<SatID, filterData> MWData;        /** Returns a satTypeValueMap object, adding the new data generated when calling this object.         *         * @param epoch     Time of observations.         * @param sat       SatID.         * @param tvMap     Data structure of TypeID and values.         * @param epochflag Epoch flag.         * @param mw        Current MW observation value.         * @param lli1      LLI1 index.         * @param lli2      LLI2 index.         */        virtual double getDetection(const DayTime& epoch, const SatID& sat, typeValueMap& tvMap, const short& epochflag, const double& mw, const double& lli1, const double& lli2)        {            bool reportCS(false);            double currentDeltaT(0.0);  // Difference between current and former epochs, in sec            double currentBias(0.0);    // Difference between current and former MW values            double lambdaLimit(maxNumLambdas*0.862);    // Limit to declare cycle slip based on lambdas (LambdaLW = 0.862 m)            double tempLLI1(0.0);            double tempLLI2(0.0);            // Get the difference between current epoch and former epoch, in seconds            currentDeltaT = ( epoch.MJDdate() - MWData[sat].formerEpoch.MJDdate() ) * DayTime::SEC_DAY;            // Store current epoch as former epoch            MWData[sat].formerEpoch = epoch;            // Difference between current value of MW and average value            currentBias = std::abs(mw - MWData[sat].meanMW);            // Increment size of window            ++MWData[sat].windowSize;            // Check if receiver already declared cycle slip or too much time has elapsed            // Note: If tvMap(lliType1) or tvMap(lliType2) don't exist, then 0 will be used and those tests will pass            if ( (tvMap(lliType1)==1.0) || (tvMap(lliType1)==3.0) || (tvMap(lliType1)==5.0) || (tvMap(lliType1)==7.0) ) tempLLI1 = 1.0;            if ( (tvMap(lliType2)==1.0) || (tvMap(lliType2)==3.0) || (tvMap(lliType2)==5.0) || (tvMap(lliType2)==7.0) ) tempLLI2 = 1.0;            if ( (epochflag==1) || (epochflag==6) || (tempLLI1==1.0) || (tempLLI2==1.0) || (currentDeltaT > deltaTMax) )            {                MWData[sat].windowSize = 1;     // We reset the filter with this                reportCS = true;                // Report cycle slip            }            if (MWData[sat].windowSize > 1)            {                // Test for current bias bigger than lambda limit and for current bias squared bigger than sigma squared limit                if ( (currentBias > lambdaLimit) )                {                    MWData[sat].windowSize = 1;     // We reset the filter with this                    reportCS = true;                // Report cycle slip                }            }            // Let's prepare for the next time            // If a cycle-slip happened or just starting up            if (MWData[sat].windowSize < 2)            {                MWData[sat].meanMW = mw;            } else {                // Compute average                MWData[sat].meanMW += (mw - MWData[sat].meanMW) / (static_cast<double>(MWData[sat].windowSize));            }            if (reportCS) return 1.0; else return 0.0;        };   }; // end class MWCSDetector       /// Input operator from gnssSatTypeValue to MWCSDetector.    inline gnssSatTypeValue& operator>>(gnssSatTypeValue& gData, MWCSDetector& mwD)    {            mwD.Detect(gData);            return gData;    }    /// Input operator from gnssRinex to MWCSDetector.    inline gnssRinex& operator>>(gnssRinex& gData, MWCSDetector& mwD)    {            mwD.Detect(gData);            return gData;    }      //@}   }#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -