OneFreqCSDetector.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: OneFreqCSDetector.hpp 1310 2008-07-23 15:53:02Z architest $"
00002 
00009 #ifndef ONEFREQCSDETECTOR_HPP
00010 #define ONEFREQCSDETECTOR_HPP
00011 
00012 //============================================================================
00013 //
00014 //  This file is part of GPSTk, the GPS Toolkit.
00015 //
00016 //  The GPSTk is free software; you can redistribute it and/or modify
00017 //  it under the terms of the GNU Lesser General Public License as published
00018 //  by the Free Software Foundation; either version 2.1 of the License, or
00019 //  any later version.
00020 //
00021 //  The GPSTk is distributed in the hope that it will be useful,
00022 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00023 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00024 //  GNU Lesser General Public License for more details.
00025 //
00026 //  You should have received a copy of the GNU Lesser General Public
00027 //  License along with GPSTk; if not, write to the Free Software Foundation,
00028 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00029 //
00030 //  Dagoberto Salazar - gAGE ( http://www.gage.es ). 2007, 2008
00031 //
00032 //============================================================================
00033 
00034 
00035 
00036 #include <deque>
00037 #include "ProcessingClass.hpp"
00038 
00039 
00040 
00041 namespace gpstk
00042 {
00043 
00046 
00047 
00122    class OneFreqCSDetector : public ProcessingClass
00123    {
00124       public:
00125 
00129       OneFreqCSDetector()
00130          : codeType(TypeID::C1), phaseType(TypeID::L1), lliType(TypeID::LLI1),
00131            resultType(TypeID::CSL1), deltaTMax(31.0), maxWindowSize(60),
00132            maxNumSigmas(4.5), defaultBiasSigma(4.0)
00133       { setIndex(); };
00134 
00135 
00147       OneFreqCSDetector( const TypeID& codeT,
00148                          const double& dtMax = 31.0,
00149                          const int& mwSize = 60,
00150                          const double& mnSigmas = 4.5,
00151                          const double& dbSigma = 4.0 );
00152 
00153 
00161       virtual satTypeValueMap& Process( const DayTime& epoch,
00162                                         satTypeValueMap& gData,
00163                                         const short& epochflag = 0 )
00164          throw(ProcessingException);
00165 
00166 
00171       virtual OneFreqCSDetector& setCodeType(const TypeID& codeT)
00172       { codeType = codeT; return (*this); };
00173 
00174 
00176       virtual TypeID getCodeType() const
00177       { return codeType; };
00178 
00179 
00184       virtual OneFreqCSDetector& setPhaseType(const TypeID& phaseT)
00185       { phaseType = phaseT; return (*this); };
00186 
00187 
00189       virtual TypeID getPhaseType() const
00190       { return phaseType; };
00191 
00192 
00197       virtual OneFreqCSDetector& setLLIType(const TypeID& lliT)
00198       { lliType = lliT; return (*this); };
00199 
00200 
00202       virtual TypeID getLLIType() const
00203       { return lliType; };
00204 
00205 
00210       virtual OneFreqCSDetector& setResultType(const TypeID& resultT)
00211       { resultType = resultT; return (*this); };
00212 
00213 
00215       virtual TypeID getResultType() const
00216       { return resultType; };
00217 
00218 
00224       virtual OneFreqCSDetector& setDeltaTMax(const double& maxDelta)
00225       { deltaTMax = maxDelta; return (*this); };
00226 
00227 
00230       virtual double getDeltaTMax() const
00231       { return deltaTMax; };
00232 
00233 
00238       virtual OneFreqCSDetector& setMaxWindowSize(const int& maxSize);
00239 
00240 
00242       virtual int getMaxWindowSize() const
00243       { return maxWindowSize; };
00244 
00245 
00252       virtual OneFreqCSDetector& setMaxNumSigmas(const double& maxNSigmas)
00253       { maxNumSigmas = maxNSigmas; return (*this); };
00254 
00255 
00258       virtual double getMaxNumSigmas() const
00259       { return maxNumSigmas; };
00260 
00261 
00268       virtual OneFreqCSDetector& setDefaultBiasSigma(const double& defSigma)
00269       { defaultBiasSigma = defSigma; return (*this); };
00270 
00271 
00274       virtual double getDefaultBiasSigma() const
00275       { return defaultBiasSigma; };
00276 
00277 
00283       virtual gnssSatTypeValue& Process(gnssSatTypeValue& gData)
00284          throw(ProcessingException)
00285       { Process(gData.header.epoch, gData.body); return gData; };
00286 
00287 
00293       virtual gnssRinex& Process(gnssRinex& gData)
00294          throw(ProcessingException);
00295 
00296 
00298       virtual int getIndex(void) const;
00299 
00300 
00302       virtual std::string getClassName(void) const;
00303 
00304 
00306       virtual ~OneFreqCSDetector() {};
00307 
00308 
00309    private:
00310 
00311 
00313       TypeID codeType;
00314 
00315 
00317       TypeID phaseType;
00318 
00319 
00321       TypeID lliType;
00322 
00323 
00325       TypeID resultType;
00326 
00327 
00329       double deltaTMax;
00330 
00331 
00333       int maxWindowSize;
00334 
00335 
00338       double maxNumSigmas;
00339 
00340 
00342       double defaultBiasSigma;
00343 
00344 
00346       struct filterData
00347       {
00348             // Default constructor initializing the data in the structure
00349          filterData() : previousEpoch(DayTime::BEGINNING_OF_TIME),
00350                         windowSize(0), meanBias(0.0), variance(0.0)
00351          {};
00352 
00353          DayTime previousEpoch;  
00354          int windowSize;         
00355          double meanBias;        
00356          double variance;        
00357 
00358          std::deque<double> biasBuffer;   
00359          std::deque<double> dif2Buffer;   
00360       };
00361 
00362 
00364       std::map<SatID, filterData> OneFreqData;
00365 
00366 
00377       virtual double getDetection( const DayTime& epoch,
00378                                    const SatID& sat,
00379                                    typeValueMap& tvMap,
00380                                    const short& epochflag,
00381                                    const double& code,
00382                                    const double& phase );
00383 
00384 
00386       static int classIndex;
00387 
00388 
00390       int index;
00391 
00392 
00394       void setIndex(void)
00395       { index = classIndex++; };
00396 
00397 
00398    }; // End of class 'OneFreqCSDetector'
00399 
00401 
00402 }
00403 #endif   // ONEFREQCSDETECTOR_HPP

Generated on Wed Feb 8 03:31:01 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1