WxObsMap.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: WxObsMap.hpp 1161 2008-03-27 17:16:22Z ckiesch $"
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 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       // First and last time of any data in this object
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 } // namespace
00174 #endif 

Generated on Tue May 22 03:31:02 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1