9 #include <utl/Reader.h>
10 #include <utl/ErrorLogger.h>
11 #include <utl/AugerException.h>
12 #include <utl/AugerUnits.h>
13 #include <utl/MathConstants.h>
14 #include <utl/TabulatedFunction.h>
15 #include <utl/PhysicalConstants.h>
16 #include <utl/PhysicalFunctions.h>
18 #include <fwk/CentralConfig.h>
20 #include <atm/USStdADBProfileModel.h>
21 #include <atm/MolecularDB.h>
22 #include <atm/ProfileResult.h>
23 #include <atm/MolecularLayer.h>
24 #include <atm/MolecularZone.h>
25 #include <atm/ProfileResult.h>
26 #include <det/Detector.h>
67 return *fTabLogPressureVsHeight;
77 return *fTabTemperatureVsHeight;
87 return *fTabLogVaporPressureVsHeight;
97 return *fTabLogDensityVsHeight;
107 return *fTabLogDepthVsHeight;
117 return *fTabHeightVsLogDepth;
127 return *fTabRIVsHeight;
149 const double minLog =
kLn10 * numeric_limits<double>::min_exponent10;
155 lIt != zIt->LayersEnd(); ++lIt) {
162 if (lIt != zIt->LayersBegin()) {
164 if (newIt->GetHeight() <= (--newIt)->GetHeight())
170 lIt->GetHeight(), lIt->GetHeightError(),
171 log(lIt->GetDepth()), lIt->GetDepthError() / lIt->GetDepth()
174 const double refracIndex =
182 lIt->GetHeight(), lIt->GetHeightError(),
183 log(lIt->GetPressure()), lIt->GetPressureError() / lIt->GetPressure()
188 const double pVapor = lIt->GetHumidity() * pSat;
189 const double dpVapor = lIt->GetHumidityError() * pSat;
191 tabLogVaporPressureVsHeight.
PushBack(
192 lIt->GetHeight(), lIt->GetHeightError(),
193 (pVapor > 0) ? log(pVapor) : minLog, (pVapor > 0 && dpVapor > 0) ? pVapor / dpVapor : minLog
197 lIt->GetHeight(), lIt->GetHeightError(),
198 lIt->GetTemperature(), lIt->GetTemperatureError()
202 lIt->GetHeight(), lIt->GetHeightError(),
203 log(lIt->GetAirDensity()),
204 lIt->GetAirDensityError() / lIt->GetAirDensity()
210 while (lIt != zIt->LayersBegin()) {
217 if (lIt != --(zIt->LayersEnd())) {
219 if (newIt->GetHeight() >= (++newIt)->GetHeight())
225 log(lIt->GetDepth()), lIt->GetDepthError() / lIt->GetDepth(),
226 lIt->GetHeight(), lIt->GetHeightError()
231 if (nZonesCheck != 1) {
233 msg <<
"Expected to find one zone in DB for US Std Atmosphere, but found"
240 *fTabLogPressureVsHeight =
243 *fTabLogVaporPressureVsHeight =
246 *fTabTemperatureVsHeight =
249 *fTabLogDensityVsHeight =
252 *fTabLogDepthVsHeight =
255 *fTabHeightVsLogDepth =
262 ExtendProfilesTo100km();
264 fTablesFilled =
true;
boost::transform_iterator< InternalZoneFunctor, InternalZoneIterator, const MolecularZone & > ZoneIterator
ZoneIterator returns a pointer to a MolecularZone.
constexpr double atmosphere
constexpr double kOverburdenSeaLevel
ZoneIterator ZonesEnd() const
End of the collection of valid Zones.
Detector description interface for data in the Atm_Molecular database.
const atm::ProfileResult & EvaluateDepthVsHeight() const override
Table of depth as a function of height.
Class describing the Atmospheric profile.
#define DEBUGLOG(message)
Macro for logging debugging messages.
const atm::ProfileResult & EvaluateTemperatureVsHeight() const override
Table of temperature as a function of height.
double SaturationVaporPressure(const double temperature)
Evaluate the saturation vapor pressure over ice or water.
void PushBack(const double x, const double xErr, const double y, const double yErr)
ZoneIterator ZonesBegin() const
Beginning of the collection of valid Zones.
double LorentzLorentz(const double verticalDepth)
Calculate the refraction index for a given depth.
bool HasData() const override
True if a data source is for the given model.
const ProfileResult & EvaluateVaporPressureVsHeight() const override
Table of H2O vapor pressure as a function of height.
boost::indirect_iterator< InternalLayerIterator, const MolecularLayer & > LayerIterator
Layer iterator returns a pointer to the molecular data slice for this zone.
const atm::ProfileResult & EvaluateHeightVsDepth() const override
Table of height as a function of depth.
const atm::ProfileResult & EvaluatePressureVsHeight() const override
Table of air pressure as a function of height.
const atm::ProfileResult & EvaluateRefractionIndexVsHeight() const override
Table of refraction index as a function of height.
const atm::ProfileResult & EvaluateDensityVsHeight() const override
Table of density as a function of height.