Commits

Martin Pokorny authored 218bef55c97 Merge
Merge branch 'master' of https://open-bitbucket.nrao.edu/scm/casa/casa into CAS-11009
No tags

code/atnf/atca/ATAtmosphere.cc

Modified
127 127 AlwaysAssert(itsMaxAlt > 0., AipsError);
128 128 AlwaysAssert(itsWVScale > 0., AipsError);
129 129
130 130 const Double heightStep = itsMaxAlt/Double(nLayers());
131 131 // molar mass of the air
132 132 const Double M = 28.96e-3;
133 133 // free-fall acceleration
134 134 const Double g = 9.81;
135 135
136 136 const Double wvGndSaturationPressure = wvSaturationPressure(itsGndTemperature);
137 - const Double gndPressure = itsPressure*exp(-M*g/(QC::R.get().getValue()*itsGndTemperature)*
137 + const Double gndPressure = itsPressure*exp(-M*g/(QC::R( ).get().getValue()*itsGndTemperature)*
138 138 (itsObsHeight+0.5*itsLapseRate*itsObsHeight*itsObsHeight/itsGndTemperature));
139 139 for (Int layer = 0; layer < nLayers(); ++layer) {
140 140 const Double height = Double(layer)*heightStep;
141 141 itsHeights[layer] = height;
142 142 itsTemperatures[layer] = itsGndTemperature/(1.+itsLapseRate*height/itsGndTemperature);
143 - const Double pressure = gndPressure * exp(-M*g/(QC::R.get().getValue()*itsGndTemperature)*
143 + const Double pressure = gndPressure * exp(-M*g/(QC::R( ).get().getValue()*itsGndTemperature)*
144 144 (height+0.5*itsLapseRate*height*height/itsGndTemperature));
145 145 itsVapourPressures[layer] = casacore::min(itsGndHumidity*exp(-height/itsWVScale)*wvGndSaturationPressure,
146 146 wvSaturationPressure(itsTemperatures[layer]));
147 147 itsDryPressures[layer] = pressure - itsVapourPressures[layer];
148 148 //std::cout<<"layer="<<layer<<": H="<<itsHeights[layer]<<" T="<<itsTemperatures[layer]<<
149 149 // " Pvap="<<itsVapourPressures[layer]<<" Pdry="<<itsDryPressures[layer]<<endl;
150 150 }
151 151 }
152 152
153 153 /**
382 382 dH = 0.5*(itsHeights[1]-itsHeights[0]);
383 383 } else if (layer + 1 == int(nLayers())) {
384 384 dH = 0.5*(itsHeights[nLayers()-1]-itsHeights[nLayers()-2]);
385 385 } else {
386 386 dH = 0.5*(itsHeights[layer+1]-itsHeights[layer-1]);
387 387 }
388 388 // imaginary part of the total complex refractivity
389 389 const Double nImag = 1e-6*std::imag(dryRefractivity(freq,itsTemperatures[layer],itsDryPressures[layer],
390 390 itsVapourPressures[layer])+vapourRefractivity(freq,itsTemperatures[layer],itsDryPressures[layer],
391 391 itsVapourPressures[layer]));
392 - tau += dH*4.*casacore::C::pi/QC::c.get().getValue()*freq*nImag;
392 + tau += dH*4.*casacore::C::pi/QC::c( ).get().getValue()*freq*nImag;
393 393 }
394 394 return tau;
395 395 }
396 396
397 397 /**
398 398 * Calculate zenith opacity for the range of frequencies. Same as zenithOpacity, but
399 399 * for a vector of frequencies.
400 400 * @param[in] freqs vector of frequencies in Hz
401 401 * @return vector of zenith opacities, one value per frequency (nepers, i.e. dimensionless)
402 402 **/
435 435 // total complex refractivity
436 436 const DComplex n = dryRefractivity(freq,itsTemperatures[layer],itsDryPressures[layer],
437 437 itsVapourPressures[layer]) +
438 438 vapourRefractivity(freq,itsTemperatures[layer],itsDryPressures[layer],
439 439 itsVapourPressures[layer]);
440 440 // real and imaginary part of the total complex refractivity scaled appropriately
441 441 const Double nImag = 1e-6*std::imag(n);
442 442 const Double nReal = 1. + 1e-6*std::real(n);
443 443 // length increment
444 444 const Double dL = dH*nReal/sqrt(nReal*nReal+sineEl*sineEl-1.);
445 - tau += dL*4.*casacore::C::pi/QC::c.get().getValue()*freq*nImag;
445 + tau += dL*4.*casacore::C::pi/QC::c( ).get().getValue()*freq*nImag;
446 446 }
447 447 return tau;
448 448 }
449 449
450 450 /**
451 451 * Calculate opacities for the range of frequencies at the given elevation. Same as
452 452 * opacity, but for a vector of frequencies.
453 453 * @param[in] freqs vector of frequencies in Hz
454 454 * @param[in] el elevation in radians
455 455 * @return vector of opacities, one value per frequency (nepers, i.e. dimensionless)

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut