Examples

Note atmosphere tool is instanciated as 'at' tool when CASA is loaded.

Minimum execution

Default atmospheric profile, obtain opacities of wet and dry components in 100GHz.

#In CASA

CASA <1>: out = at.initAtmProfile()

CASA <2>: nchan = at.initSpectralWindow(1, "100GHz", "500kHz", "0Hz")

CASA <3>: at.getDryOpacity(0, 0)

Out[3]: 0.01163068623916133

 

CASA <4>: at.getWetOpacity(0, 0)

Out[4]: {'unit': 'neper', 'value': array([ 0.01113428])}

Define Atmospheric Profile

Atmospheric profile that represents ALMA site.

#In CASA

CASA <1>: out = at.initAtmProfile(humidity=20.0, temperature="273K", altitude="5059m", pressure="563mbar", atmType=3)

CASA <2>: print(out)

BASIC ATMOSPHERIC PARAMETERS TO GENERATE REFERENCE ATMOSPHERIC PROFILE

  

Ground temperature T:         273 K

Ground pressure P:            563 mb

Relative humidity rh:         20 %

Scale height h0:              2 km

Pressure step dp:             10 mb

Altitude alti:                5059 m

Attitude top atm profile:     48 km

Pressure step factor:         1.2 

Tropospheric lapse rate:      -5.6 K/km

Atmospheric type:             MIDLATWINTER

 

Built atmospheric profile with 21 layers.

Now, get atmospheric model profile constructed in atmosphere tool. 

The method, getProfile, returns the thickness, temperature, mass and number density of H2O, pressure, number dentities of O3, CO, and N2O in each layer of atmosphere model. One can use the return values, e.g., to plot the atmosphere model used to calculate transmission.

#In CASA

CASA <3>: (out, thick, temp, h2o_mass, h2o_num, press, o3, co, n2o) = at.getProfile()

 

Set Up Spectral Windows

 Define the first spectral window (center=100GHz, band width=1.5GHz, channel resolution=15MHz).

#In CASA

CASA <4>: nchan0 = at.initSpectralWindow(1, fCenter="100GHz", fWidth="1.5GHz", fRes="15MHz")

CASA <5>: nchan0

Out[5]: 100

Add another spectral window (center=200GHz, band width=50MHz, channel resolution=10MHz) .

#In CASA

CASA <6>: at.addSpectralWindow(fCenter="200GHz", fWidth="50MHz", fRes="10MHz")

Out[6]: 5

Obtain channel frequencies of the second spectral window (id=1).

#In CASA

CASA <7>: at.getSpectralWindow(1)

Out[7]: 

{'unit': 'Hz',

 'value': array([  1.99990000e+11,   2.00000000e+11,   2.00010000e+11,

          2.00020000e+11,   2.00030000e+11])}

 

Get Atmospheric Transmission

Set a user defined PWV (1.7mm) to compute atmospheric transimission.

#In CASA

CASA <8>: at.setUserWH2O("1.7mm")

Obtain the opacities of water vapor and dry species (CO, N2O, NO2, O2, O3, SO2) of the second spectral window (id=1). The methods return channel number of spw and opacity of all channels in the spw.

#In CASA

CASA <9>: at.getDryOpacitySpec(1)

Out[9]: (5, array([ 0.00837107,  0.00836607,  0.0083671 ,  0.00836841,  0.00837001]))

 

CASA <10>: at.getWetOpacitySpec(1)

Out[10]: 

(5, {'unit': 'mm-1', 'value': array([ 0.08193662,  0.08191223,  0.08188794,  0.08186376,  0.08183968])})

Compute atmospheric transmission of all channels in the first spectral window (id=0) for airmas=1.5.

#In CASA

CASA <11>: dry = at.getDryOpacitySpec(0)[1]

CASA <12>: wet = at.getWetOpacitySpec(0)[1]['value']

CASA <13>: airmass=1.5

CASA <14>: transmission = numpy.exp(-airmass*(dry+wet))