Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatools/atmosphere.py: 52%

151 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-10-31 17:39 +0000

1##################### generated by xml-casa (v2) from atmosphere.xml ################ 

2##################### e79b0bbe7303e5be53ed0d1656b65f07 ############################## 

3from __future__ import absolute_import 

4from .__casac__.atmosphere import atmosphere as _atmosphere 

5 

6from .errors import create_error_string 

7from .typecheck import CasaValidator as _validator 

8_pc = _validator( ) 

9from .coercetype import coerce as _coerce 

10 

11 

12class atmosphere: 

13 _info_group_ = """atmosphere""" 

14 _info_desc_ = """Atmosphere model""" 

15 ### self 

16 def __init__(self, *args, **kwargs): 

17 """This is used to construct an {tt atmosphere} tool. 

18 """ 

19 self._swigobj = kwargs.get('swig_object',None) 

20 if self._swigobj is None: 

21 self._swigobj = _atmosphere() 

22 

23 def close(self): 

24 """ 

25 """ 

26 return self._swigobj.close() 

27 

28 def done(self): 

29 """ 

30 """ 

31 return self._swigobj.done() 

32 

33 def getAtmVersion(self): 

34 """Returns the version of ATM library implemented to this tool. 

35 """ 

36 return self._swigobj.getAtmVersion() 

37 

38 def listAtmosphereTypes(self): 

39 """Returns a list of index numbers and corresponding atmosphere types 

40 used by the ATM library. 

41 """ 

42 return self._swigobj.listAtmosphereTypes() 

43 

44 def initAtmProfile(self, altitude={'value': float(5000.), 'unit': 'm'}, temperature={'value': float(270.0), 'unit': 'K'}, pressure={'value': float(560.0), 'unit': 'mbar'}, maxAltitude={'value': float(48.0), 'unit': 'km'}, humidity=float(20.0), dTem_dh={'value': float(-5.6), 'unit': 'K/km'}, dP={'value': float(10.0), 'unit': 'mbar'}, dPm=float(1.2), h0={'value': float(2.0), 'unit': 'km'}, atmType=int(1), layerBoundaries=[ ], layerTemperature=[ ]): 

45 """An atmospheric profile is composed of 4 quantities as a function of 

46 altitude z: 

47  

48 * the layer thickness 

49 * the pressure P 

50 * the temperature T and 

51 * the gas densities for H2O, O3, CO and N2O. 

52  

53  

54 This method is needed for computing the absorption and phase 

55 coefficients, as well as for performing radiative transfer 

56 calculations (only layer thickness/T are needed). 

57  

58 This method builds an atmospheric profile that can be used to calculate 

59 absorption and phase coefficients, as well as to perform forward 

60 and/or retrieval radiative transfer calculations. It is composed of a 

61 set of parameters needed to build a layer thickness/P/T/gas densities 

62 densities profile from simple parameters currently available at 

63 observatories (from weather stations for example) using functions from 

64 the ATM library. The set of input parameters consists of the pressure 

65 P, the temperature T and the relative humidity at the ground, the 

66 altitude of the site, the tropospheric temperature lapse rate,... The 

67 profile is built as: thickness of the considered atmospheric layers 

68 above the site, and mean P,T,H2O,O3,CO,N2O in them. The total number 

69 of atmospheric layers in the particular profile is also available (a 

70 negative value indicates an error). The zenith column of water vapor 

71 can be calculated by simply integrating the H2O profile. 

72 """ 

73 return self._swigobj.initAtmProfile(altitude, temperature, pressure, maxAltitude, humidity, dTem_dh, dP, dPm, h0, atmType, layerBoundaries, layerTemperature) 

74 

75 def updateAtmProfile(self, altitude={'value': float(5000.), 'unit': 'm'}, temperature={'value': float(270.0), 'unit': 'K'}, pressure={'value': float(560.0), 'unit': 'mbar'}, humidity=float(20.0), dTem_dh={'value': float(-5.6), 'unit': 'K/km'}, h0={'value': float(2.0), 'unit': 'km'}): 

76 """This is used to update the {tt atmosphere} tool when basic 

77 atmospheric parameters.change. 

78 """ 

79 return self._swigobj.updateAtmProfile(altitude, temperature, pressure, humidity, dTem_dh, h0) 

80 

81 def getBasicAtmParms(self): 

82 """ 

83 """ 

84 return self._swigobj.getBasicAtmParms() 

85 

86 def getNumLayers(self): 

87 """ 

88 """ 

89 return self._swigobj.getNumLayers() 

90 

91 def getGroundWH2O(self): 

92 """Method to get the zenith column of water vapor. It is computed by 

93 simply integrating the H2O profile: 

94 """ 

95 return self._swigobj.getGroundWH2O() 

96 

97 def getProfile(self): 

98 """Get the atmospheric profile. 

99 """ 

100 return self._swigobj.getProfile() 

101 

102 def initSpectralWindow(self, nbands=int(1), fCenter={'value': float(90), 'unit': 'GHz'}, fWidth={'value': float(0.64), 'unit': 'GHz'}, fRes={'value': float(0.0), 'unit': 'GHz'}): 

103 """function that defines a spectral window, computes absorption and emmision coefficients for this window, 

104 using the atmospheric model profile. 

105  

106 NOTE: This method should be invoked after setting atmospheric profile model by initAtmProfile. 

107 """ 

108 return self._swigobj.initSpectralWindow(nbands, fCenter, fWidth, fRes) 

109 

110 def addSpectralWindow(self, fCenter={'value': float(350), 'unit': 'GHz'}, fWidth={'value': float(0.008), 'unit': 'GHz'}, fRes={'value': float(0.002), 'unit': 'GHz'}): 

111 """Add a new spectral window, uniformly sampled, this spectral window 

112 having no sideband. 

113 """ 

114 return self._swigobj.addSpectralWindow(fCenter, fWidth, fRes) 

115 

116 def getNumSpectralWindows(self): 

117 """ 

118 """ 

119 return self._swigobj.getNumSpectralWindows() 

120 

121 def getNumChan(self, spwid=int(0)): 

122 """Return the number of channels of ith band ( passes in as parameter ). 

123 """ 

124 return self._swigobj.getNumChan(spwid) 

125 

126 def getRefChan(self, spwid=int(0)): 

127 """Return the reference channel of the given spectral window 

128 """ 

129 return self._swigobj.getRefChan(spwid) 

130 

131 def getRefFreq(self, spwid=int(0)): 

132 """Return the reference frequency of the given spectral window 

133 """ 

134 return self._swigobj.getRefFreq(spwid) 

135 

136 def getChanSep(self, spwid=int(0)): 

137 """Return the channel separation of the given spectral window 

138 """ 

139 return self._swigobj.getChanSep(spwid) 

140 

141 def getChanFreq(self, chanNum=int(0), spwid=int(0)): 

142 """Return the channel frequency for a given grid point for the specified spectral window. 

143  

144 """ 

145 return self._swigobj.getChanFreq(chanNum, spwid) 

146 

147 def getSpectralWindow(self, spwid=int(0)): 

148 """Return the spectral grid for the specified spectral window. 

149  

150 """ 

151 return self._swigobj.getSpectralWindow(spwid) 

152 

153 def getChanNum(self, freq, spwid=int(0)): 

154 """Return the channel number for given frequency in the specified 

155 spectral window relative to the reference channel number. 

156  

157 """ 

158 return self._swigobj.getChanNum(freq, spwid) 

159 

160 def getBandwidth(self, spwid=int(0)): 

161 """Get the frequency range encompassing the list of frequency grid points for the specified spectral window. 

162  

163 """ 

164 return self._swigobj.getBandwidth(spwid) 

165 

166 def getMinFreq(self, spwid=int(0)): 

167 """Get lowest frequency channel for the specified spectral window. 

168  

169 """ 

170 return self._swigobj.getMinFreq(spwid) 

171 

172 def getMaxFreq(self, spwid=int(0)): 

173 """Get highest frequency channel for the specified spectral window. 

174  

175 """ 

176 return self._swigobj.getMaxFreq(spwid) 

177 

178 def getDryOpacity(self, nc=int(-1), spwid=int(0)): 

179 """Get the integrated Dry Opacity for one channel in a band. 

180 """ 

181 return self._swigobj.getDryOpacity(nc, spwid) 

182 

183 def getDryContOpacity(self, nc=int(-1), spwid=int(0)): 

184 """Get the integrated Dry Continuum Opacity for one channel in a band. 

185 """ 

186 return self._swigobj.getDryContOpacity(nc, spwid) 

187 

188 def getO2LinesOpacity(self, nc=int(-1), spwid=int(0)): 

189 """Get the integrated O2 Lines Opacity for one channel in a band. 

190 """ 

191 return self._swigobj.getO2LinesOpacity(nc, spwid) 

192 

193 def getO3LinesOpacity(self, nc=int(-1), spwid=int(0)): 

194 """Get the integrated O3 Lines Opacity for one channel in a band. 

195 """ 

196 return self._swigobj.getO3LinesOpacity(nc, spwid) 

197 

198 def getCOLinesOpacity(self, nc=int(-1), spwid=int(0)): 

199 """Get the integrated CO Lines Opacity for one channel in a band. 

200 """ 

201 return self._swigobj.getCOLinesOpacity(nc, spwid) 

202 

203 def getN2OLinesOpacity(self, nc=int(-1), spwid=int(0)): 

204 """Get the integrated N2O Lines Opacity for one channel in a band. 

205 """ 

206 return self._swigobj.getN2OLinesOpacity(nc, spwid) 

207 

208 def getWetOpacity(self, nc=int(-1), spwid=int(0)): 

209 """Get the integrated zenith Wet Opacity for one channel in a band. 

210 """ 

211 return self._swigobj.getWetOpacity(nc, spwid) 

212 

213 def getH2OLinesOpacity(self, nc=int(-1), spwid=int(0)): 

214 """Get the integrated zenith H2O Lines Opacity for one channel in a band. 

215 """ 

216 return self._swigobj.getH2OLinesOpacity(nc, spwid) 

217 

218 def getH2OContOpacity(self, nc=int(-1), spwid=int(0)): 

219 """Get the integrated zenith H2O Continuum Opacity for one channel in a band. 

220 """ 

221 return self._swigobj.getH2OContOpacity(nc, spwid) 

222 

223 def getDryOpacitySpec(self, spwid=int(0)): 

224 """Get the integrated Dry opacity along the atmospheric path on each channel in a band. 

225 """ 

226 return self._swigobj.getDryOpacitySpec(spwid) 

227 

228 def getWetOpacitySpec(self, spwid=int(0)): 

229 """Getthe integrated zenith Wet Opacity along the atmospheric path on each channel in a band. 

230 """ 

231 return self._swigobj.getWetOpacitySpec(spwid) 

232 

233 def getDispersivePhaseDelay(self, nc=int(-1), spwid=int(0)): 

234 """Get the integrated zenith H2O Atmospheric Phase Delay (Dispersive part) 

235 for the current conditions, for channel number nc of spectral window spwid. 

236 """ 

237 return self._swigobj.getDispersivePhaseDelay(nc, spwid) 

238 

239 def getDispersiveWetPhaseDelay(self, nc=int(-1), spwid=int(0)): 

240 """Function to retrievethe the integrated Atmospheric Phase Delay 

241 (Dispersive part) along the atmospheric path corresponding to the 1st 

242 guess water column. 

243 """ 

244 return self._swigobj.getDispersiveWetPhaseDelay(nc, spwid) 

245 

246 def getNonDispersiveWetPhaseDelay(self, nc=int(-1), spwid=int(0)): 

247 """Function to retrieve the integrated wet Atmospheric Phase Delay 

248 (NonDispersive part) along the atmospheric path corresponding to the 1st 

249 guess water column. 

250 """ 

251 return self._swigobj.getNonDispersiveWetPhaseDelay(nc, spwid) 

252 

253 def getNonDispersiveDryPhaseDelay(self, nc=int(-1), spwid=int(0)): 

254 """Function to retrieve the integrated dry Atmospheric Phase Delay 

255 (NonDispersive part) along the atmospheric path corresponding to the 1st 

256 guess water column. 

257 """ 

258 return self._swigobj.getNonDispersiveDryPhaseDelay(nc, spwid) 

259 

260 def getNonDispersivePhaseDelay(self, nc=int(-1), spwid=int(0)): 

261 """Get the integrated zenith H2O Atmospheric Phase Delay (Non-Dispersive 

262 part) for the current conditions, for channel number nc of spectral 

263 window spwid. 

264 """ 

265 return self._swigobj.getNonDispersivePhaseDelay(nc, spwid) 

266 

267 def getDispersivePathLength(self, nc=int(-1), spwid=int(0)): 

268 """Retrieve the integrated zenith H2O Atmospheric Path length (Dispersive part) 

269 along the atmospheric path corresponding to the user water column 

270 for channel nc in spectral window spwid. 

271 """ 

272 return self._swigobj.getDispersivePathLength(nc, spwid) 

273 

274 def getDispersiveWetPathLength(self, nc=int(-1), spwid=int(0)): 

275 """Retrieve the integrated wet Atmospheric Path length (Dispersive part) 

276 along the atmospheric path corresponding to the 1st guess water column 

277 for channel nc in spectral window spwid. 

278 """ 

279 return self._swigobj.getDispersiveWetPathLength(nc, spwid) 

280 

281 def getNonDispersiveWetPathLength(self, nc=int(-1), spwid=int(0)): 

282 """Retrieve the integrated wet Atmospheric Path length (NonDispersive part) 

283 along the atmospheric path corresponding to the 1st guess water column 

284 for channel nc in spectral window spwid. 

285 """ 

286 return self._swigobj.getNonDispersiveWetPathLength(nc, spwid) 

287 

288 def getNonDispersiveDryPathLength(self, nc=int(-1), spwid=int(0)): 

289 """Retrieve the integrated dry Atmospheric Path length (NonDispersive part) 

290 along the atmospheric path corresponding to the 1st guess water column 

291 for channel nc in spectral window spwid. 

292 """ 

293 return self._swigobj.getNonDispersiveDryPathLength(nc, spwid) 

294 

295 def getO2LinesPathLength(self, nc=int(-1), spwid=int(0)): 

296 """Retrieve the integrated Atmospheric Path length (due to O2 Lines) along 

297 the atmospheric path corresponding to the 1st guess water column 

298 for channel nc in spectral window spwid. 

299 """ 

300 return self._swigobj.getO2LinesPathLength(nc, spwid) 

301 

302 def getO3LinesPathLength(self, nc=int(-1), spwid=int(0)): 

303 """Retrieve the integrated Atmospheric Path length (due to O3 Lines) along 

304 the atmospheric path corresponding to the 1st guess water column 

305 for channel nc in spectral window spwid. 

306 """ 

307 return self._swigobj.getO3LinesPathLength(nc, spwid) 

308 

309 def getCOLinesPathLength(self, nc=int(-1), spwid=int(0)): 

310 """Retrieve the integrated Atmospheric Path length (due to CO Lines) 

311 along the atmospheric path corresponding to the 1st guess water column 

312 for channel nc in spectral window spwid. 

313 """ 

314 return self._swigobj.getCOLinesPathLength(nc, spwid) 

315 

316 def getN2OLinesPathLength(self, nc=int(-1), spwid=int(0)): 

317 """Retrieve the integrated Atmospheric Path length (due to N2O Lines) 

318 along the atmospheric path corresponding to the 1st guess water column 

319 for channel nc in spectral window spwid. 

320 """ 

321 return self._swigobj.getN2OLinesPathLength(nc, spwid) 

322 

323 def getNonDispersivePathLength(self, nc=int(-1), spwid=int(0)): 

324 """Get the integrated zenith H2O Atmospheric Path length (Non-Dispersive part) 

325 for the current conditions, for channel nc in spectral window spwid. 

326 """ 

327 return self._swigobj.getNonDispersivePathLength(nc, spwid) 

328 

329 def getAbsH2OLines(self, nl, nf=int(0), spwid=int(0)): 

330 """Accessor to get H2O lines Absorption Coefficient at layer nl, 

331 spectral window spwid and channel nf. 

332 """ 

333 return self._swigobj.getAbsH2OLines(nl, nf, spwid) 

334 

335 def getAbsH2OCont(self, nl, nf=int(0), spwid=int(0)): 

336 """Get H2O continuum Absorption Coefficient at layer nl, 

337 spectral window spwid and frequency channel nf 

338 """ 

339 return self._swigobj.getAbsH2OCont(nl, nf, spwid) 

340 

341 def getAbsO2Lines(self, nl, nf=int(0), spwid=int(0)): 

342 """Get O2 lines Absorption Coefficient at layer nl, 

343 spectral window spwid and frequency channel nf 

344 """ 

345 return self._swigobj.getAbsO2Lines(nl, nf, spwid) 

346 

347 def getAbsDryCont(self, nl, nf=int(0), spwid=int(0)): 

348 """Get Dry Continuum Absorption Coefficient at layer nl, 

349 spectral window spwid and frequency channel nf 

350 """ 

351 return self._swigobj.getAbsDryCont(nl, nf, spwid) 

352 

353 def getAbsO3Lines(self, nl, nf=int(0), spwid=int(0)): 

354 """Get O3 lines Absorption Coefficient at layer nl, 

355 spectral window spwid and frequency channel nf 

356 """ 

357 return self._swigobj.getAbsO3Lines(nl, nf, spwid) 

358 

359 def getAbsCOLines(self, nl, nf=int(0), spwid=int(0)): 

360 """Get CO lines Absorption Coefficient at layer nl, 

361 spectral window spwid and frequency channel nf 

362 """ 

363 return self._swigobj.getAbsCOLines(nl, nf, spwid) 

364 

365 def getAbsN2OLines(self, nl, nf=int(0), spwid=int(0)): 

366 """Get N2O lines Absorption Coefficient at layer nl, 

367 spectral window spwid and frequency channel nf 

368 """ 

369 return self._swigobj.getAbsN2OLines(nl, nf, spwid) 

370 

371 def getAbsTotalDry(self, nl, nf=int(0), spwid=int(0)): 

372 """Get total dry Absorption Coefficient at layer nl, 

373 spectral window spwid and frequency channel nf 

374 """ 

375 return self._swigobj.getAbsTotalDry(nl, nf, spwid) 

376 

377 def getAbsTotalWet(self, nl, nf=int(0), spwid=int(0)): 

378 """Get total wet absorption coefficient at layer nl, 

379 spectral window spwid and frequency channel nf 

380 """ 

381 return self._swigobj.getAbsTotalWet(nl, nf, spwid) 

382 

383 def setUserWH2O(self, wh2o={'value': float(0.0), 'unit': 'mm'}): 

384 """Set user zenith water vapor column for forward radiative transfer 

385 calculations. 

386 """ 

387 return self._swigobj.setUserWH2O(wh2o) 

388 

389 def getUserWH2O(self): 

390 """Get user zenith water vapor column for forward radiative transfer 

391 calculations. 

392 """ 

393 return self._swigobj.getUserWH2O() 

394 

395 def setAirMass(self, airmass): 

396 """Setter for air mass in SkyStatus without performing water vapor retrieval. 

397 """ 

398 return self._swigobj.setAirMass(airmass) 

399 

400 def getAirMass(self): 

401 """Accessor to get airmass. 

402 """ 

403 return self._swigobj.getAirMass() 

404 

405 def setSkyBackgroundTemperature(self, tbgr={'value': float(2.73), 'unit': 'K'}): 

406 """Set sky background temperature in SkyStatus without performing water vapor retrieval 

407 """ 

408 return self._swigobj.setSkyBackgroundTemperature(tbgr) 

409 

410 def getSkyBackgroundTemperature(self): 

411 """Get the sky background temperature 

412 """ 

413 return self._swigobj.getSkyBackgroundTemperature() 

414 

415 def getAverageTebbSky(self, spwid=int(0), wh2o={'value': float(-1), 'unit': 'mm'}): 

416 """Returns the average Equivalent Blackbody Temperature in spectral 

417 window spwid, for the current conditions and a perfect sky coupling. 

418 """ 

419 return self._swigobj.getAverageTebbSky(spwid, wh2o) 

420 

421 def getTebbSky(self, nc=int(-1), spwid=int(0), wh2o={'value': float(-1), 'unit': 'mm'}): 

422 """Gets the Equivalent Blackbody Temperature in spectral window spwid and 

423 channel nc, for the current (user) Water Vapor Column wh2o, 

424 the current Air Mass, and perfect Sky Coupling to the sky. 

425 """ 

426 return self._swigobj.getTebbSky(nc, spwid, wh2o) 

427 

428 def getTebbSkySpec(self, spwid=int(0), wh2o={'value': float(-1), 'unit': 'mm'}): 

429 """Gets the Equivalent Blackbody Temperatures in a spectral window spwid 

430 for the current (user) Water Vapor Column wh2o, the current Air Mass, and 

431 perfect Sky Coupling to the sky. 

432 """ 

433 return self._swigobj.getTebbSkySpec(spwid, wh2o) 

434 

435 def getAverageTrjSky(self, spwid=int(0), wh2o={'value': float(-1), 'unit': 'mm'}): 

436 """Returns the average Rayleigh-Jeans Temperature in spectral 

437 window spwid, for the current (user) Water Vapor Column wh2o, 

438 the current Air Mass, and perfect Sky Coupling to the sky. 

439 """ 

440 return self._swigobj.getAverageTrjSky(spwid, wh2o) 

441 

442 def getTrjSky(self, nc=int(-1), spwid=int(0), wh2o={'value': float(-1), 'unit': 'mm'}): 

443 """Gets the Rayleigh-Jeans Temperature in spectral window spwid and 

444 channel nc, for the current (user) Water Vapor Column wh2o, the 

445 current Air Mass, and perfect Sky Coupling to the sky. 

446 """ 

447 return self._swigobj.getTrjSky(nc, spwid, wh2o) 

448 

449 def getTrjSkySpec(self, spwid=int(0), wh2o={'value': float(-1), 'unit': 'mm'}): 

450 """Gets the Rayleigh-Jeans Temperatures in a spectral window spwid 

451 for the current (user) Water Vapor Column wh2o, the current Air 

452 Mass, and perfect Sky Coupling to the sky. 

453 """ 

454 return self._swigobj.getTrjSkySpec(spwid, wh2o) 

455