ObsClockModel.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: ObsClockModel.hpp 3140 2012-06-18 15:03:02Z susancummins $"
00002 
00003 //============================================================================
00004 //
00005 //  This file is part of GPSTk, the GPS Toolkit.
00006 //
00007 //  The GPSTk is free software; you can redistribute it and/or modify
00008 //  it under the terms of the GNU Lesser General Public License as published
00009 //  by the Free Software Foundation; either version 2.1 of the License, or
00010 //  any later version.
00011 //
00012 //  The GPSTk is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU Lesser General Public License for more details.
00016 //
00017 //  You should have received a copy of the GNU Lesser General Public
00018 //  License along with GPSTk; if not, write to the Free Software Foundation,
00019 //  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
00020 //  
00021 //  Copyright 2004, The University of Texas at Austin
00022 //
00023 //============================================================================
00024 
00025 //============================================================================
00026 //
00027 //This software developed by Applied Research Laboratories at the University of
00028 //Texas at Austin, under contract to an agency or agencies within the U.S. 
00029 //Department of Defense. The U.S. Government retains all rights to use,
00030 //duplicate, distribute, disclose, or release this software. 
00031 //
00032 //Pursuant to DoD Directive 523024 
00033 //
00034 // DISTRIBUTION STATEMENT A: This software has been approved for public 
00035 //                           release, distribution is unlimited.
00036 //
00037 //=============================================================================
00038 
00039 #ifndef OBSCLOCKMODEL_HPP
00040 #define OBSCLOCKMODEL_HPP
00041 
00042 #include <map>
00043 #include "Exception.hpp"
00044 #include "gps_constants.hpp"
00045 
00046 #include "Stats.hpp"
00047 #include "ClockModel.hpp"
00048 #include "ORDEpoch.hpp"
00049 
00061 namespace gpstk
00062 {
00063    class ObsClockModel : public ClockModel
00064    {
00065    public:
00066       enum SvMode
00067       {
00068          IGNORE,   
00069          HEALTHY,  
00070          ALWAYS    
00071       };
00072       
00073       enum SvStatus
00074       {
00075          USED,      
00076          MANUAL,    
00077          SVHEALTH,  
00078          ELEVATION, 
00079          WONKY,     
00080          SIGMA      
00081       };
00082 
00084       typedef std::map<SatID, SvMode> SvModeMap;
00085 
00087       typedef std::map<SatID, SvStatus> SvStatusMap;
00088 
00089       ObsClockModel(double sigma = 2, double elmask = 0, SvMode mode = ALWAYS)
00090          : sigmam(sigma), elvmask(elmask), useWonkyData(false)
00091       {
00092          status.clear();
00093          setSvMode(mode);
00094       }
00095 
00096       virtual void addEpoch(const ORDEpoch& re) throw(gpstk::InvalidValue) = 0;
00097 
00098       // set accessor methods ----------------------------------------------   
00099 
00105       ObsClockModel& setSvModeMap(const SvModeMap& right) throw();
00106 
00113       ObsClockModel& setSvMode(const SatID& svid, const SvMode& mode) throw()
00114       { modes[svid] = mode; return *this; }
00115       
00121       ObsClockModel& setSvMode(const SvMode& mode) throw()
00122       {
00123          for(int prn = 1; prn <= gpstk::MAX_PRN; prn++)
00124          {
00125             SatID svid(prn, SatID::systemGPS);
00126             modes[svid] = mode;
00127          }
00128          return *this;
00129       }
00130 
00136       ObsClockModel& setSigmaMultiplier(double right) throw()
00137       { sigmam = right; return *this; }
00138    
00144       ObsClockModel& setElevationMask(double right) throw()
00145       { elvmask = right; return *this; }
00146 
00150       ObsClockModel& setUseWonkyData(bool right) throw()
00151       { useWonkyData = right; return *this; }
00152 
00153       // get accessor methods ----------------------------------------------   
00154    
00159       const SvStatusMap& getSvStatusMap() const throw()
00160       { return status; };
00161 
00168       SvStatus getSvStatus(const SatID& svid) const throw(ObjectNotFound);
00169 
00174       const SvModeMap& getSvModeMap() const throw() { return modes; }
00175 
00182       SvMode getSvMode(const SatID& svid) const throw(ObjectNotFound);
00183 
00188       double getSigmaMultiplier() const throw() { return sigmam; } 
00189 
00194       double getElevationMask() const throw() { return elvmask; }
00195 
00196 
00200       bool getUseWonkyData() const throw()
00201       { return useWonkyData; }
00202 
00207       Stats<double> simpleOrdClock(const ORDEpoch& oe)
00208          throw(InvalidValue);
00209 
00210       virtual void dump(std::ostream& s, short detail=1) const throw();
00211 
00212       friend std::ostream& operator<<(std::ostream& s, const ObsClockModel& r)
00213       { r.dump(s, 0); return s; };
00214       
00215    protected:
00216 
00217       double sigmam;        
00218       double elvmask;       
00219       SvStatusMap status;   
00220       SvModeMap modes;      
00221       bool useWonkyData;    
00222    };
00223 }
00224 #endif

Generated on Sun May 19 03:31:11 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1