ReadMolecularLL.cc
Go to the documentation of this file.
1 #include <sstream>
2 
3 #include "ReadMolecularLL.h"
4 #include <utl/ErrorLogger.h>
5 
6 #include <evt/Event.h>
7 #include <det/Detector.h>
8 #include <utl/TimeStamp.h>
9 #include <utl/UTCDateTime.h>
10 
11 #include <atm/MolecularDB.h>
12 #include <atm/MolecularZone.h>
13 
14 using namespace std;
15 using namespace utl;
16 using namespace fwk;
17 using namespace det;
18 using namespace atm;
19 
20 using namespace ReadMolecularLLNS;
21 
22 ReadMolecularLL::ReadMolecularLL(){}
23 
24 ReadMolecularLL::~ReadMolecularLL(){}
25 
27  //
28  //
29  INFO("ReadMolecularLL::Init()");
30  return eSuccess;
31 }
32 
33 VModule::ResultFlag ReadMolecularLL::Run(evt::Event& event){
34  //
35  //
36  INFO("ReadMolecularLL::Run()");
37 
38  Detector& det = Detector::GetInstance();
39 
40  // Retrieve the low-level molecular DB interface, specifying, in this case,
41  // that you want to retrieve one of the Malarguemonthly average profiles.
42  //
44 
45  // Iterate over all the zones found in the db
46  //
47  cout << "Malargue montlhy model for January : " << endl;
48  for (MolecularDB::ZoneIterator zIt = mdb.ZonesBegin() ;
49  zIt != mdb.ZonesEnd() ; ++zIt){
50 
51  cout << "Got zone : " << zIt->GetName() << endl;
52  cout << " with coordinates : " << zIt->GetNorthing()/m << "N, " << zIt->GetEasting()/m << " E " << endl;
53 
54  // Iterate over slices in the zone
55  //
56  for (MolecularZone::LayerIterator sIt = zIt->LayersBegin() ;
57  sIt != zIt->LayersEnd() ; ++sIt){
58 
59  cout << endl;
60  cout << "height " << sIt->GetHeight()/m << " m " << endl;
61  cout << "depth " << sIt->GetDepth()/(gram/cm/cm) << " g/cm^2" << endl;
62  cout << "pressure " << sIt->GetPressure()/pascal << " pascal " << endl;
63  cout << "temperature " << sIt->GetTemperature()/kelvin << " kelvin " << endl;
64  }
65  }
66 
67  // Set detector time to something
68  //
69  det.Update(UTCDateTime(2005,1,10,12,0).GetTimeStamp());
70 
71  // Look up some data from a weather station for that time
72  //
74 
75  cout << endl << endl << "some weather station data for " << det.GetTime() << endl;
76  // iterate over zones
77  for (MolecularDB::ZoneIterator zIt = wsdb.ZonesBegin() ;
78  zIt != wsdb.ZonesEnd() ; ++zIt){
79 
80  // iterate over molecular layers for this zone (well, there is only 1 for the weather station)
81  for (MolecularZone::LayerIterator sIt = zIt->LayersBegin() ;
82  sIt != zIt->LayersEnd() ; ++sIt){
83 
84  cout << endl;
85  cout << "height " << sIt->GetHeight()/m << " m " << endl;
86  cout << "depth " << sIt->GetDepth()/(gram/cm/cm) << " g/cm^2" << endl;
87  cout << "pressure " << sIt->GetPressure()/pascal << " pascal " << endl;
88  cout << "temperature " << sIt->GetTemperature()/kelvin << " kelvin " << endl;
89  cout << "wind speed " << sIt->GetWindSpeed()/(m/s) << " m/s " << endl;
90  }
91  }
92 
93  return eSuccess;
94 }
95 
96 VModule::ResultFlag ReadMolecularLL::Finish(){
97  //
98  //
99  INFO("ReadMolecularLL::Finish()");
100  return eSuccess;
101 }
void Update(const utl::TimeStamp &time, const bool invData=true, const bool invComp=true, const bool forceRadio=false)
Update detector: deletes currently constructed stations and sets new time.
Definition: Detector.cc:179
boost::transform_iterator< InternalZoneFunctor, InternalZoneIterator, const MolecularZone & > ZoneIterator
ZoneIterator returns a pointer to a MolecularZone.
Definition: MolecularDB.h:52
utl::TimeStamp GetTime() const
Get time pertaining to the detector description.
Definition: Detector.h:134
ZoneIterator ZonesEnd() const
End of the collection of valid Zones.
Definition: MolecularDB.h:59
#define INFO(message)
Macro for logging informational messages.
Definition: ErrorLogger.h:161
Detector description interface for data in the Atm_Molecular database.
Definition: MolecularDB.h:29
from weather station
Definition: MolecularIds.h:11
void Init()
Initialise the registry.
const atm::Atmosphere & GetAtmosphere() const
Definition: Detector.h:113
January Malargue model.
Definition: MolecularIds.h:15
constexpr double s
Definition: AugerUnits.h:163
constexpr double pascal
Definition: AugerUnits.h:212
Top of the hierarchy of the detector description interface.
Definition: Detector.h:81
const MolecularDB & GetMolecularDB(const MolecularIds::ProfileId &id) const
Low-level interface to portion of the database with molecular information.
constexpr double kelvin
Definition: AugerUnits.h:259
ZoneIterator ZonesBegin() const
Beginning of the collection of valid Zones.
Definition: MolecularDB.h:55
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
boost::indirect_iterator< InternalLayerIterator, const MolecularLayer & > LayerIterator
Layer iterator returns a pointer to the molecular data slice for this zone.
Definition: MolecularZone.h:43
constexpr double cm
Definition: AugerUnits.h:117
constexpr double m
Definition: AugerUnits.h:121
constexpr double gram
Definition: AugerUnits.h:195

, generated on Tue Sep 26 2023.