00001 #pragma ident "$Id: WxObsMap.hpp 1161 2008-03-27 17:16:22Z ckiesch $"
00002
00003
00004
00005
00006
00007
00008
00009
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
00036
00037
00038
00039 #ifndef GPSTK_WXOBSMAP_HPP
00040 #define GPSTK_WXOBSMAP_HPP
00041
00048 #include <map>
00049 #include <iostream>
00050
00051 #include "DayTime.hpp"
00052
00053 namespace gpstk
00054 {
00056 struct WxObservation
00057 {
00059 WxObservation() throw()
00060 : t(DayTime::END_OF_TIME), temperatureSource(noWx),
00061 pressureSource(noWx), humiditySource(noWx)
00062 {}
00063
00070 WxObservation(const DayTime& t,
00071 float temp,
00072 float pres,
00073 float humid)
00074 throw()
00075 :t(t),
00076 temperature(temp), pressure(pres),
00077 humidity(humid), temperatureSource(obsWx),
00078 pressureSource(obsWx), humiditySource(obsWx)
00079 {}
00080
00081
00082 DayTime t;
00083 float temperature;
00084 float pressure;
00085 float humidity;
00086
00088 enum EWxSrc
00089 {
00090 noWx,
00091 defWx,
00092 obsWx
00093 };
00094
00095 enum EWxSrc temperatureSource;
00096 enum EWxSrc pressureSource;
00097 enum EWxSrc humiditySource;
00098
00102 bool isAllValid() const throw();
00103
00109 friend std::ostream& operator<<(std::ostream& s,
00110 const WxObservation& obs) throw();
00111 };
00112
00113
00116 typedef std::map<DayTime, WxObservation> WxObsMap;
00117
00119 struct WxObsData
00120 {
00122 WxObsData() throw()
00123 :firstTime(DayTime::END_OF_TIME),
00124 lastTime(DayTime::BEGINNING_OF_TIME) {}
00125
00126
00127 DayTime firstTime;
00128 DayTime lastTime;
00129
00131 unsigned rxId;
00132
00134 WxObsMap obs;
00135
00139 WxObservation getMostRecent(const DayTime& t) const throw();
00140
00144 void insertObservation(const WxObservation& obs) throw();
00145
00150 void flush(const DayTime& t) throw();
00151
00168 WxObservation getWxObservation(const DayTime& t,
00169 unsigned iv = 3600,
00170 bool interpolate = true) const
00171 throw(ObjectNotFound);
00172 };
00173 }
00174 #endif