LinearClockModel.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: LinearClockModel.hpp 229 2006-10-13 17:13:41Z ocibu $"
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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 LINEARCLOCKMODEL_HPP
00040 #define LINEARCLOCKMODEL_HPP
00041 
00042 #include <map>
00043 
00044 #include "Exception.hpp"
00045 
00046 #include "ObsClockModel.hpp"
00047 #include "ORDEpoch.hpp"
00048 
00055 namespace gpstk
00056 {
00057    class LinearClockModel : public ObsClockModel
00058    {
00059    public:
00060       LinearClockModel(double sigma = 2, double elmask = 0, SvMode mode = ALWAYS)
00061          :ObsClockModel(sigma, elmask, mode) {reset();};
00062 
00063       virtual double getOffset(const gpstk::DayTime& t) const 
00064          throw()
00065       {
00066          if (!isOffsetValid(t))
00067             return 0;
00068          else
00069             return clockModel.Slope()*(t-baseTime) + clockModel.Intercept();
00070       };
00071 
00072       virtual bool isOffsetValid(const gpstk::DayTime& t) const throw()
00073       {return t >= startTime && t <= endTime && clockModel.N() > 1;};
00074 
00076       virtual void addEpoch(const ORDEpoch& oe) throw(gpstk::InvalidValue);
00077 
00079       void reset() throw();
00080 
00081       void dump(std::ostream& s, short detail=1) const throw();
00082 
00083       friend std::ostream& operator<<(std::ostream& s, const LinearClockModel& r)
00084       { r.dump(s, 0); return s; };
00085       
00086    private:
00087       // x is time y is clock offset
00088       gpstk::TwoSampleStats<double> clockModel;
00089 
00090       gpstk::DayTime startTime, endTime, baseTime;
00091 
00092       unsigned long tossCount;
00093    
00094       // This is were we store what SVs were used to compute the individual
00095       // clock observations
00096       std::map<gpstk::DayTime, SvStatusMap> prnStatus;
00097 
00098       // This is a store of the clock observations that were added into the
00099       // clockModel object
00100       std::multimap<double,double> clockObs;
00101    };
00102    
00103 }
00104 #endif

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