9 #include <atm/VProfileModel.h>
10 #include <atm/ProfileResult.h>
12 #include <utl/AugerUnits.h>
13 #include <utl/MathConstants.h>
14 #include <utl/PhysicalConstants.h>
15 #include <utl/PhysicalFunctions.h>
16 #include <utl/TabulatedFunctionErrors.h>
34 VProfileModel::VProfileModel() :
92 return *profIt->second;
104 tabRefIndex.PushBack(*heightIt, 0, nAir, 0);
119 const double height1 = min(h1, h2);
120 const double height2 =
max(h1, h2);
124 const int nLayers = 6;
125 const double borders[nLayers + 1] = {
135 const double bParams[nLayers] = {
144 const double cParams[nLayers] = {
159 const double rho0 = bParams[eSeaLevel] / cParams[eSeaLevel];
167 double verticalLength = 0;
169 for (
int i = 0; i < nLayers; ++i) {
171 if (height1 > borders[i] && height1 <= borders[i+1]) {
173 double startHeight = height1;
175 for (
int j = i; j < nLayers; ++j) {
177 const double stopHeight =
178 (height2 > borders[j] && height2 <= borders[j+1]) ? height2 : borders[j+1];
180 const double deltaH = stopHeight - startHeight;
182 if (j == eBelowSeaLevel)
184 else if (j == eVacuum)
185 verticalLength += deltaH;
187 verticalLength += deltaH +
188 deltaN*bParams[j]/rho0 * (exp(-startHeight / cParams[j]) - exp(-stopHeight / cParams[j]));
190 if (stopHeight == height2)
193 startHeight = stopHeight;
213 fTabRIVsHeightAndWaveLength.clear();
228 const double maxHeight = logDepthVsHeight.
XBack();
229 const double minLog =
kLn10 * numeric_limits<double>::min_exponent10;
232 if (maxHeight < 11*
km) {
239 if (maxHeight < 20*
km) {
265 logDensityVsHeight.
PushBack( 32*
km, 0, log(0.0132*
kg/
m3), minLog);
266 logDensityVsHeight.
PushBack( 47*
km, 0, log(0.0014*
kg/
m3), minLog);
267 logDensityVsHeight.
PushBack( 51*
km, 0, log(0.0009*
kg/
m3), minLog);
268 logDensityVsHeight.
PushBack( 71*
km, 0, log(0.0001*
kg/
m3), minLog);
269 logDensityVsHeight.
PushBack(100*
km, 0, log(0.00001*
kg/
m3), minLog);
278 if (maxHeight < 11*
km)
279 hxIt = heightVsLogDepth.
Insert(hxIt, log(231.81*
g/
cm2), minLog, 11*
km, 0);
280 if (maxHeight < 20*
km)
281 hxIt = heightVsLogDepth.
Insert(hxIt, log(56.24*
g/
cm2), minLog, 20*
km, 0);
283 hxIt = heightVsLogDepth.
Insert(hxIt, log(8.95*
g/
cm2), minLog, 32*
km, 0);
284 hxIt = heightVsLogDepth.
Insert(hxIt, log(1.15*
g/
cm2), minLog, 47*
km, 0);
285 hxIt = heightVsLogDepth.
Insert(hxIt, log(0.68*
g/
cm2), minLog, 51*
km, 0);
286 hxIt = heightVsLogDepth.
Insert(hxIt, log(0.04*
g/
cm2), minLog, 71*
km, 0);
287 hxIt = heightVsLogDepth.
Insert(hxIt, log(1e-3*
g/
cm2), minLog, 100*
km, 0);
ArrayConstReference XBack() const
read-only reference to back of array of X
ProfileResult * fTabRIVsHeight
ArrayIterator XEnd()
end of array of X
constexpr double kRefractiveIndexSeaLevel
ProfileResult * fTabLogDepthVsHeight
void CleanRIVsWavelength() const
Clean up refraction indices. Derived modules decide when to do this.
ProfileResult * fTabTemperatureVsHeight
double Y(const double x) const
Get the Y value (coordinate) for given X (ordinate)
virtual const ProfileResult & EvaluateRefractionIndexVsHeight() const
Return a table of wavelength-independent refractive index vs. altitude.
void ExtendProfilesTo100km() const
Class describing the Atmospheric profile.
ProfileResult * fTabLogVaporPressureVsHeight
ProfileResult * fTabLogDensityVsHeight
void PushBack(const double x, const double xErr, const double y, const double yErr)
constexpr double kSpeedOfLight
ProfileResult * fTabLogPressureVsHeight
double Ciddor95(const double wl, const double temperature, const double pressure, const double vaporPressure)
Wavelength-dependent index of refraction for humid air.
ArrayIterator XBegin()
begin of array of X
virtual double GetVerticalTimeOfFlight(const double height1, const double height2) const
Evaluate light signal time-of-flight between two altitudes.
IteratorErr Insert(const IteratorErr &pos, const double x, const double xErr, const double y, const double yErr)
utl::TabulatedFunctionErrors fProfile
ProfileResult * fTabHeightVsLogDepth
AltWLFunction fTabRIVsHeightAndWaveLength