Analysis Utilities: Difference between revisions

From CASA Guides
Jump to navigationJump to search
Thunter (talk | contribs)
Thunter (talk | contribs)
Line 4: Line 4:
=Getting Started=
=Getting Started=


'''If you are working on a machine at NRAO Charlottesville or Socorro, then you can skip the download step, because the latest modules are already available at: /home/thunter/AIV/science/analysis_scripts. '''  
'''If you are working on a machine at NRAO Charlottesville or Socorro, then you can skip Step 1, because the latest modules are already available at: /home/thunter/AIV/science/analysis_scripts. '''  


First, download Analysis Utilities from [ftp://ftp.cv.nrao.edu/pub/casaguides/analysis_scripts.tar here] and extract the tar ball.  From a Unix command line this can be done with
'''Step 1:''' Download Analysis Utilities from [ftp://ftp.cv.nrao.edu/pub/casaguides/analysis_scripts.tar here] and extract the tar ball.  From a Unix command line this can be done with


<source lang="bash">
<source lang="bash">
Line 15: Line 15:
and date that the tar ball was generated, which can be useful for reporting bugs.
and date that the tar ball was generated, which can be useful for reporting bugs.


Second, edit your casapy init file in <tt>$HOME/.casa/init.py</tt>, and add the following
'''Step 2:''' Edit your casapy init file in <tt>$HOME/.casa/init.py</tt>, and add the following


<source lang="Python">
<source lang="Python">

Revision as of 19:40, 10 January 2012

Analysis Utilities (or analysisUtils for short) is a small set of Python source code files that provide a number of analysis and plotting utilities. The utilities were developed for ALMA data reduction and are, in many cases, also useful for EVLA data reduction. This CASA Guide documents some of the most useful functions contained in the analysisUtils Python module from a user's perspective.

Getting Started

If you are working on a machine at NRAO Charlottesville or Socorro, then you can skip Step 1, because the latest modules are already available at: /home/thunter/AIV/science/analysis_scripts.

Step 1: Download Analysis Utilities from here and extract the tar ball. From a Unix command line this can be done with

$ tar xvf analysis_scripts.tar

Seven files will be extracted -- a README file, and six python scripts. The README file contains the time and date that the tar ball was generated, which can be useful for reporting bugs.

Step 2: Edit your casapy init file in $HOME/.casa/init.py, and add the following

import sys
sys.path.append("/PATH_TO_ANALYSIS_SCRIPTS")
import analysisUtils as au

where /PATH_TO_ANALYSIS_SCRIPTS is the path to the directory you just extracted from the tar ball. When this is done, start casapy and you will have access to all the functions contained in the analysisUtils module.

Key Functions

plotbandpass
a faster version of plotcal for bandpass tables, with useful overlay capabilities

Other Functions

editIntents
change the intents for a specified field in an ms (based on John Lightfoot's pipeline script)
getBaselineLengths
returns a dictionary of the baseline lengths in your ms, by default sorted by length
lstrange
lists the range of LST, UT, MJD for the whole ms, and for scans with ON_SOURCE intent (including the elevation range)
obslist
prints the antenna station coordinates in local offsets from the Center of Array, and computes longest/shortest baselines
plotconfig
plot any standard telescope configuration of observatories known to casa
plotmosaic
shows relative location of pointings in an .ms
plotweather
plot weather conditions vs. time for your ms
smoothbandpass
smooths an existing bandpass table with options for window length and type (Ed Fomalont)
timeOnSource
compute the total time spent integrating on-source for each specified field