00001 #pragma ident "$Id$"
00002
00008 #ifndef GPSTK_DIFFERENTIATOR_HPP
00009 #define GPSTK_DIFFERENTIATOR_HPP
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include "ProcessingClass.hpp"
00036 #include "FIRDifferentiator5thOrder.hpp"
00037
00038
00039
00040 namespace gpstk
00041 {
00042
00045
00046
00080 class Differentiator : public ProcessingClass
00081 {
00082 public:
00083
00085 Differentiator()
00086 : inputType(TypeID::L1), outputType(TypeID::L1dot),
00087 tolerance(0.005), useSatArcs(true), watchCSFlag(TypeID::CSL1)
00088 { setSamplingPeriod(1.0); setIndex(); };
00089
00090
00099 Differentiator( const TypeID& inType,
00100 const TypeID& outType,
00101 double samplingPeriod,
00102 double tol,
00103 bool useArc = true );
00104
00105
00107 virtual void Reset(void)
00108 { svData.clear(); return; };
00109
00110
00112 virtual TypeID getInputType() const
00113 { return inputType; };
00114
00115
00120 virtual Differentiator& setInputType(const TypeID& inType)
00121 { inputType = inType; return (*this); };
00122
00123
00125 virtual TypeID getOutputType() const
00126 { return outputType; };
00127
00128
00133 virtual Differentiator& setOutputType(const TypeID& outType)
00134 { outputType = outType; return (*this); };
00135
00136
00139 virtual bool getUseSatArc() const
00140 { return useSatArcs; };
00141
00142
00149 virtual Differentiator& setUseSatArc(bool useArc)
00150 { useSatArcs = useArc; return (*this); };
00151
00152
00154 virtual TypeID getCSFlag() const
00155 { return watchCSFlag; };
00156
00157
00162 virtual Differentiator& setCSFlag(const TypeID& watchFlag)
00163 { watchCSFlag = watchFlag; return (*this); };
00164
00165
00167 virtual double getSamplingPeriod() const
00168 { return Ts; };
00169
00170
00175 virtual Differentiator& setSamplingPeriod(double samplingPeriod);
00176
00177
00179 virtual double getTolerance() const
00180 { return tolerance; };
00181
00182
00187 virtual Differentiator& setTolerance(double tol);
00188
00189
00191 virtual double getDelay() const
00192 { return delay; };
00193
00194
00197 virtual std::map<SourceID, std::map<SatID, double> >
00198 getSvDerivativesMap() const
00199 { return svDerivativesMap; };
00200
00201
00208 double getValue( const SourceID& source,
00209 const SatID& satellite ) const
00210 throw( SourceIDNotFound, SatIDNotFound );
00211
00212
00218 virtual gnssSatTypeValue& Process(gnssSatTypeValue& gData)
00219 throw(ProcessingException);
00220
00221
00227 virtual gnssRinex& Process(gnssRinex& gData)
00228 throw(ProcessingException);
00229
00230
00236 virtual gnssDataMap& Process(gnssDataMap& gData)
00237 throw(ProcessingException);
00238
00239
00241 virtual int getIndex(void) const;
00242
00243
00245 virtual std::string getClassName(void) const;
00246
00247
00249 virtual ~Differentiator() {};
00250
00251
00252 private:
00253
00254
00256 struct filterData
00257 {
00258
00259 filterData() : arcNumber(0.0),
00260 previousEpoch(DayTime::BEGINNING_OF_TIME),
00261 filter(1.0) {};
00262
00263 double arcNumber;
00264 DayTime previousEpoch;
00265 FIRDifferentiator5thOrder filter;
00266
00267
00268 };
00269
00270
00271 protected:
00272
00273
00275 TypeID inputType;
00276
00277
00279 TypeID outputType;
00280
00281
00283 double Ts;
00284
00285
00287 double tolerance;
00288
00289
00291 double delay;
00292
00293
00297 bool useSatArcs;
00298
00299
00301 TypeID watchCSFlag;
00302
00303
00305 std::map<SourceID, std::map<SatID, double> > svDerivativesMap;
00306
00307
00309 std::map<SourceID, std::map<SatID, filterData> > svData;
00310
00311
00319 void Compute( const DayTime& epoch,
00320 const SourceID& source,
00321 const satTypeValueMap& gData )
00322 throw(ProcessingException);
00323
00324
00325 private:
00326
00327
00329 static int classIndex;
00330
00331
00333 int index;
00334
00335
00337 void setIndex(void)
00338 { index = classIndex++; };
00339
00340
00341 };
00342
00343
00345
00346 }
00347
00348 #endif // GPSTK_DIFFERENTIATOR_HPP