Difference between revisions of "Simutil.py"

From CASA Guides
Jump to: navigation, search
Line 5: Line 5:
  
 
Methods:
 
Methods:
; average_direction(directions) : Returns the average of directions as a string, and relative offsets
+
; simutil.average_direction(directions) : Returns the average of directions as a string, and relative offsets
; calc_pointings(spacing, imsize, cell, direction=None, relmargin=0.5)  
+
; simutil.calc_pointings(spacing, imsize, cell, direction=None, relmargin=0.5)  
 
: If direction is a list, simply returns direction and the number of pointings in it.  Otherwise, returns a hexagonally packed list of pointings separated by spacing and fitting inside an image specified by direction, imsize and cell, and the number of pointings.  The hexagonal packing starts with a horizontal row centered on direction, and the other rows alternate being horizontally offset by a half spacing.  All of the pointings will be within a rectangle relmargin * spacing smaller than the image on all sides.
 
: If direction is a list, simply returns direction and the number of pointings in it.  Otherwise, returns a hexagonally packed list of pointings separated by spacing and fitting inside an image specified by direction, imsize and cell, and the number of pointings.  The hexagonal packing starts with a horizontal row centered on direction, and the other rows alternate being horizontally offset by a half spacing.  All of the pointings will be within a rectangle relmargin * spacing smaller than the image on all sides.
 +
; simutil.ephemeris(date, direction=None, telescope=None)
 +
: calculate the elevation of a source on a date, in a direction, seen from a telescope
 +
;
 +
 +
For more detailed examples, find the python script for the <tt>simdata</tt> task, which is a file called <tt>task_simdata.py</tt> in your distribution.

Revision as of 13:15, 15 December 2009

The python utility is called simutil.py, and is located in a scripts directory of your installation.

CASA <> execfile(".../simutil.py")
CASA <> util=simutil()
CASA <> util<TAB>

Methods:

simutil.average_direction(directions) 
Returns the average of directions as a string, and relative offsets
simutil.calc_pointings(spacing, imsize, cell, direction=None, relmargin=0.5)
If direction is a list, simply returns direction and the number of pointings in it. Otherwise, returns a hexagonally packed list of pointings separated by spacing and fitting inside an image specified by direction, imsize and cell, and the number of pointings. The hexagonal packing starts with a horizontal row centered on direction, and the other rows alternate being horizontally offset by a half spacing. All of the pointings will be within a rectangle relmargin * spacing smaller than the image on all sides.
simutil.ephemeris(date, direction=None, telescope=None)
calculate the elevation of a source on a date, in a direction, seen from a telescope

For more detailed examples, find the python script for the simdata task, which is a file called task_simdata.py in your distribution.