CASA Contributed Script: getgain: Difference between revisions

From CASA Guides
Jump to navigationJump to search
Thunter (talk | contribs)
Thunter (talk | contribs)
Line 6: Line 6:
This utility reads the EVLA GainCurves file and make a plot for a specified antenna and band. It is meant to run inside of casa, but is located in its own file but in the same directory as analysisUtils.py (and is also attached below). There are 3 required arguments: The first argument is the antenna (either an integer number or a string name in the form of 'ea03'), the second argument is the band letter: 4, P, L, S, C, X, U, K, A, Q. Note that 'S' band (as of May 2012) has no entries. An optional third argument is the elevation for which to report the gain. An optional fourth argument is the path to the GainCurves file, which is assumed to be $CASAPATH/data/nrao/VLA/GainCurves.
This utility reads the EVLA GainCurves file and make a plot for a specified antenna and band. It is meant to run inside of casa, but is located in its own file but in the same directory as analysisUtils.py (and is also attached below). There are 3 required arguments: The first argument is the antenna (either an integer number or a string name in the form of 'ea03'), the second argument is the band letter: 4, P, L, S, C, X, U, K, A, Q. Note that 'S' band (as of May 2012) has no entries. An optional third argument is the elevation for which to report the gain. An optional fourth argument is the path to the GainCurves file, which is assumed to be $CASAPATH/data/nrao/VLA/GainCurves.


[[Image:Gaincurve.K.3.png.png|200px|thumb|right|gain curve of ea03 at K-band]
[[Image:Gaincurve.K.3.png|200px|thumb|right|gain curve of ea03 at K-band]


This can be run from within CASA as a Script in the following way:
This can be run from within CASA as a Script in the following way:

Revision as of 19:28, 1 May 2013

Plotting VLA gain tables

Download script: File:Getgain.py

This utility reads the EVLA GainCurves file and make a plot for a specified antenna and band. It is meant to run inside of casa, but is located in its own file but in the same directory as analysisUtils.py (and is also attached below). There are 3 required arguments: The first argument is the antenna (either an integer number or a string name in the form of 'ea03'), the second argument is the band letter: 4, P, L, S, C, X, U, K, A, Q. Note that 'S' band (as of May 2012) has no entries. An optional third argument is the elevation for which to report the gain. An optional fourth argument is the path to the GainCurves file, which is assumed to be $CASAPATH/data/nrao/VLA/GainCurves.

[[Image:Gaincurve.K.3.png|200px|thumb|right|gain curve of ea03 at K-band]

This can be run from within CASA as a Script in the following way:

# In CASA
CASA <4>: execfile('getgain.py')     or      from getgain import *
CASA <5>: getgain(3,'K',45.0)
elev=45.000000
band=K
antenna=3
current time = 4829398371.042835
Using table =  /usr/lib64/casapy/release/data/nrao/VLA/GainCurves
There are 250 rows with band K
There are 8 rows with antenna 3 and band K: 475 532 558 587 616 645 673 703 
Using row number 703
gain=1.026696 at ZA=45.0 or EL=45.0
Plot stored in gaincurve.K.3.png