// $Id: MSISE_00Atmosphere.hh,v 1.20 2005/11/14 14:08:08 moreggia Exp $ // S. Moreggia created 18 November 2003 // Mass Spectrometer, Incoherent Scatter Radar Extended Model : NRLMSISE_00 // For atmospheric description #ifndef __MSISE_00ATMOSPHERE_HH__ #define __MSISE_00ATMOSPHERE_HH__ /***************************************************************************** * ESAF: Euso Simulation and Analysis Framework * * * * Id: MSISE_00Atmosphere * * Package: atmosphere * * Coordinator: S. Moreggia * * * *****************************************************************************/ //////////////////////////////////////////////////////////////////////////////////////////// // // // MSISE_00Atmosphere // // // // Mass Spectrometer, Incoherent Scatter Radar Extended Model : NRLMSISE_00 // // Atmospheric description using msise model // // Source code (see MSISETool) has been downloaded from Nasa Website // // // //////////////////////////////////////////////////////////////////////////////////////////// #include "Atmosphere.hh" #include "MSISEtool.hh" #include "EsafMsgSource.hh" #include "MSISE_00AtmosphereData.hh" class MSISE_00Atmosphere : public Atmosphere { public: // create the single atmosphere instance as a MSISE_00Atmosphere object static void CreateInstance(); // To get specific parameters of MSISE atmosphere from the interface virtual Double_t GetValue(const string& parname) const {return 0;} // get date and geographic atmosphere parameters virtual Double_t GetLatitude() const; // from -90 (south) to 90 (north) virtual Double_t GetLongitude() const; // from 0 to 360 (east) virtual Double_t GetDate() const; // in sec UT, from 1st Jan 00:00:00 (year not taken into account) // Following methods give relevant densities, temperature, pressure virtual Double_t Pressure(Double_t h) const; virtual Double_t Temperature(Double_t h) const; virtual Double_t AbsoluteHumidity(Double_t h) const; virtual Double_t Air_Density(Double_t h) const; virtual Double_t O_Density(Double_t h) const; virtual Double_t O2_Density(Double_t h) const; virtual Double_t O3_Density(Double_t h) const; virtual Double_t N2_Density(Double_t h) const; virtual Double_t Aerosols_Density(string& type,Double_t h) const; EsafConfigClass(Atmosphere,MSISE_00Atmosphere) //virtual void Test(); to test MSISE code interface.. //TOFIX private: // default ctor (not used) MSISE_00Atmosphere() {} // ctor MSISE_00Atmosphere(string); // dtor virtual ~MSISE_00Atmosphere(); // Build atmosphere according to config parameters virtual void Build(); // Calculate interpolations (if working with tables) Double_t Interpolate(string&,string&,Double_t) const; Bool_t fFlag; // 1: creation of tables (0: not) MSISE_00AtmosphereData* fData; // tables storage MSISEtool* fTool; // source C-code adapted in C++ mutable struct nrlmsise_input fInput; // input of MSISE (date,location..) mutable struct nrlmsise_flags fTuning; // set particular requirements for msise ClassDef(MSISE_00Atmosphere,0) }; inline Double_t MSISE_00Atmosphere::GetLatitude() const { if(fData) return fData->GetLatitude(); else return fInput.g_lat; } inline Double_t MSISE_00Atmosphere::GetLongitude() const { if(fData) return fData->GetLongitude(); else return fInput.g_long; } inline Double_t MSISE_00Atmosphere::GetDate() const { if(fData) return fData->GetDate(); else if(fInput.doy == 0) return fInput.sec; else return (fInput.doy - 1)*24*3600 + fInput.sec; } #endif /*__MSISE_00ATMOSPHERE_HH__*/