Simutil.py: Difference between revisions

From CASA Guides
Jump to navigationJump to search
No edit summary
No edit summary
Line 5: Line 5:


Methods:
Methods:
* average_direction(directions) Returns the average of directions as a string, and relative offsets
; average_direction(directions) : Returns the average of directions as a string, and relative offsets
* calc_pointings(spacing, imsize, cell, direction=None, relmargin=0.5)  
; 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.
: If direction is a list, simply returns direction and the number of pointings in it. <br> 
   
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.
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.

Revision as of 13:09, 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:

average_direction(directions)
Returns the average of directions as a string, and relative offsets
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.