Changeset 19852 for trunk/Mars/msim/MAtmosphere.cc
- Timestamp:
- 11/01/19 15:11:07 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/msim/MAtmosphere.cc
r19765 r19852 18 18 ! Author(s): Thomas Bretz, 1/2009 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: CheObs Software Development, 2000-20 0920 ! Copyright: CheObs Software Development, 2000-2019 21 21 ! 22 22 ! … … 25 25 ////////////////////////////////////////////////////////////////////////////// 26 26 // 27 // MSimAtmosphere 28 // 29 // Task to calculate wavelength or incident angle dependent absorption 30 // 31 // Input Containers: 32 // MPhotonEvent 33 // MCorsikaRunHeader 34 // 35 // Output Containers: 36 // MPhotonEvent 27 // MAtmosphere 28 // 29 // Class to calculate atmospheric absorption. 37 30 // 38 31 ////////////////////////////////////////////////////////////////////////////// … … 137 130 138 131 MAtmRayleigh::MAtmRayleigh() : fR(MCorsikaRunHeader::fgEarthRadius), 139 //fHeight{0, 300000, 1e+06, 5e+06, 1e+07}, 140 //fAtmA{-144.838, -124.071, 0.360027, -0.000824761, 0.00221589}, 141 fAtmB{1192.34, 1173.98, 1412.08, 810.682, 1}, 142 fAtmC{994186, 967530, 636143, 735640, 4.92961e9}, 132 // U.S. Standard Atmosphere (after Keilhauer) 133 fHeight{0, 7.0e5, 11.4e5, 37.0e5, 100e5}, 134 //fAtmA{-149.801663, -57.932486, 0.63631894, 4.35453690e-4}, 135 fAtmB{1183.6071, 1143.0425, 1322.9748, 655.67307}, 136 fAtmC{954248.34, 800005.34, 629568.93, 737521.77}, 143 137 fObsLevel(-1) 138 144 139 { 145 140 } … … 165 160 // the observer 166 161 167 // FIXME: Could be replaced by 0, AtmLay[0]-fAtmLay[3]168 169 const Double_t h[5] =170 {171 fObsLevel, // fObsLevel, // 0km172 TMath::Max(fObsLevel, 7.75e5), // TMath::Max(fObsLevel, 4e5), // 4km173 16.5e5, // 10e5, // 10km174 50.0e5, // 40e5, // 40km175 105.0e5, // 100e5 // 100km176 };177 178 memcpy(fHeight, h, sizeof(Double_t)*5);179 180 162 fRho[0] = 0; 181 163 for (int i=0; i<4; i++) 182 164 { 183 const Double_t b = fAtmB[i]; 184 const Double_t c = fAtmC[i]; 185 186 const Double_t h1 = h[i+1]; 187 const Double_t h0 = h[i]; 165 // Below the observation level, the atmospheric overburden is 0 166 const Float_t &h1 = fHeight[i+1]; 167 if (h1<=fObsLevel) 168 fRho[i] = 0; 169 170 // Start integration of the overburden at fObsLevel 171 const Float_t &h0 = TMath::Max(fHeight[i], fObsLevel); 172 173 const Float_t &b = fAtmB[i]; 174 const Float_t &c = fAtmC[i]; 188 175 189 176 const Double_t B = b*TMath::Exp(-h0/c); … … 198 185 } 199 186 200 void MAtmRayleigh::Init( Double_t obs, const Float_t *atmb, const Float_t *atmc)187 void MAtmRayleigh::Init(Float_t obs) 201 188 { 202 189 // Observation level above earth radius 203 190 fObsLevel = obs; 204 205 //memcpy(fAtmA, (Float_t*)h.GetAtmosphericCoeffA(), sizeof(Float_t)*4);206 if (atmb)207 memcpy(fAtmB, atmb, sizeof(Float_t)*5);208 if (atmc)209 memcpy(fAtmC, atmc, sizeof(Float_t)*5);210 211 191 PreCalcRho(); 192 } 193 194 void MAtmRayleigh::Init(Float_t obs, const Float_t *atmb, const Float_t *atmc, const Float_t *height) 195 { 196 memcpy(fAtmB, atmb, sizeof(Float_t)*4); 197 memcpy(fAtmC, atmc, sizeof(Float_t)*4); 198 memcpy(fHeight, height, sizeof(Float_t)*5); 199 200 Init(obs); 212 201 } 213 202 … … 220 209 fR = h.EarthRadius(); 221 210 222 Init(h.GetObsLevel(), h.GetAtmosphericCoeffB(), h.GetAtmosphericCoeffC()); 211 //memcpy(fAtmA, h.GetAtmosphericCoeffA(), sizeof(Float_t)*4); 212 Init(h.GetObsLevel(), h.GetAtmosphericCoeffB(), h.GetAtmosphericCoeffC(), h.GetAtmosphericLayers()); 223 213 } 224 214 … … 228 218 Double_t MAtmRayleigh::GetVerticalThickness(Double_t height) const 229 219 { 220 if (height<=fObsLevel) 221 return 0; 222 230 223 // FIXME: We could store the start point above obs-level 231 224 // (Does this really gain anything?) … … 237 230 const Double_t c = fAtmC[i]; 238 231 232 // fRho is the integral up to the lower bound of the layer or the 233 // observation level is the obervation level is within the bin 239 234 return fRho[i] - b*TMath::Exp(-height/c); 240 235 }
Note:
See TracChangeset
for help on using the changeset viewer.