casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
Functions
sdgrid Namespace Reference

Functions

def sdgrid

Function Documentation

def sdgrid.sdgrid (   infiles = [""],
  antenna = -1,
  scanlist = [],
  ifno = -1,
  pollist = [],
  gridfunction = 'BOX',
  convsupport = -1,
  truncate = -1,
  gwidth = -1,
  jwidth = -1,
  weight = 'UNIFORM',
  clipminmax = False,
  outfile = '',
  overwrite = False,
  npix = -1,
  cell = '',
  center = '',
  plot = False 
)
SD task: gridding single dish data
  Keyword arguments:
infiles -- name of input SD dataset. can be list.
        example: 'testimage.asap' 
                 ['testimage1.asap','testimage2.asap']
antenna -- select data based on antenna name(s) or id(s)
        default: -1
        example: 0, 'DV01'
scanlist -- list of scan numbers to process
        default: [] (use all scans)
        example: [21,22,23,24]
ifno -- IFNO to be gridded
        default: -1 (only process IFNO in the first row)
        example: 1
pollist -- POLNO to be gridded
        default: [] (all polarizations)
        example: 1,[0,1]
gridfunction -- gridding function 
        options: 'BOX' (Box-car), 'SF' (Spheroidal), 
                 'GAUSS' (Gaussian), 'PB' (Primary-beam)
                 'GJINC' (Gaussian*Jinc)
        default: 'BOX'
        example: 'SF'
    >>> gridfunction expandable parameter:
       convsupport -- convolution support for 'SF' 
           default: -1 (use default for each gridfunction)
           example: 3
       truncate -- truncattion radius of convolution kernel.
                   effective only for 'GAUSS' and 'GJINC'.
           default: '-1' (use default for each gridfunction)
           example: 3, '20arcsec', '3pixel'
       gwidth -- HWHM for gaussian. Effective only for 
                 'GAUSS' and 'GJINC'.
           default: '-1' (use default for each gridfunction)
           example: 3, '20arcsec', '3pixel'
       jwidth -- Width of jinc function. Effective only for 
                 'GJINC'.
           default: '-1' (use default for each gridfunction)
           example: 3, '20arcsec', '3pixel'
weight -- weight type (both lower-case and upper-case are 
          acceptable)
        options: 'UNIFORM',
                 'TSYS'  (1/Tsys**2 weighted)
                 'TINT'  (integration time weighted)
                 'TINTSYS'  (Tint/Tsys**2)
        default: 'UNIFORM'
clipminmax -- do min/max cliping if True
        default: False
outfile -- output data name
        default: '' (outfile will be set to infile+'.grid')
        example: 'mydata.asap.grid'
overwrite -- overwrite option for outfile
        default: False (not overwrite)
        options: True, False
        example: if True, existing file will be overwritten
npix -- x and y image size in pixels, symmetric for single value
        default: -1 (automatically calculated from cell size and 
                     the data)
        example: npix=200 (equivalent to [200,200])
cell -- x and y cell size. default unit arcsec
        default: '' (automatically calculated from npix if it is 
                     set, otherwise '1.0arcmin')
        example: cell=['0.2arcmin, 0.2arcmin']
                 cell='0.2arcmin' (equivalent to example above)
                 cell=12.0 (interpreted as '12.0arcsec'='0.2arcmin')
center -- grid center
        default: '' (automatically calculated from the data)
        example: 'J2000 13h44m00 -17d02m00'
                 ['05:34:48.2', '-05.22.17.7'] (in J2000 frame)
                 [1.46, -0.09] (interpreted as radian in J2000 frame)
plot -- Plot result or not
        default: False (not plot)
        example: if True, result will be plotted

DESCRIPTION:

The sdgrid task performs spatial gridding according to the user 
specification of spatial grid, convolution function, etc.

For grid configuration, the task supplements necessary information 
by referring input data if any of gridding parameter ('npix', 
'cell', or 'center') is not specified by the user. If 'center' is 
default value (empty string), central position of the grid will be 
set to the center of observed area, i.e. x=0.5*(xmax+xmin), 
y=0.5*(ymax+ymin). If either 'cell' or 'npix' is set, unspecified 
one will be calculated from the others. In that case, total extent of 
the grid will be set to cover all observed position. If neither 'cell' 
nor 'npix' is set, cell size will be set to 1.0 arcmin and number of 
pixel will be calculated based on that cell size.
 
Currently, only J2000 frame is supported.
 
The parameter gridfunction sets gridding function for imaging. 
Currently, the task supports 'BOX' (Box-car), 'SF' (Prolate 
Spheroidal Wave Function), 'GAUSS' (Gaussian), 'GJINC' (Gaussian*
Jinc), where Jinc(x) = J_1(pi*x/c)/(pi*x/c) with a first order 
Bessel function J_1, and 'PB' (Primary Beam, not implemented yet). 
For 'PB', correct antenna informations should be included in input 
file. 

There are four subparameters for gridfunction: convsupport, truncate, 
gwidth, and jwidth. The convsupport is an integer specifying cut-off 
radius for 'SF' in units of pixel. By default (convsupport=-1), 
the cut-off radius is set to 3 pixels. The truncate is a cut-off 
radius for 'GAUSS' or 'GJINC'. It accepts integer, float, and 
string values of numeric plus unit. Allowed units are angular 
units such as 'deg', 'arcmin', 'arcsec', and 'pixel'. Default unit 
is 'pixel' so that string without unit or numerical values (integer 
or float) will be interpreted as radius in pixel. Default value 
for truncate, which is used when negative radius is set, is 3*HWHM 
for 'GAUSS' and radius at first null for 'GJINC'. The gwidth is 
the HWHM of gaussian for 'GAUSS' and 'GJINC'. Default value is 
sqrt(log(2)) pixel for 'GAUSS' and 2.52*sqrt(log(2)) pixel for 
'GJINC'. The jwidth specifies width of the jinc function (parameter 
'c' in the definition above). Default is 1.55 pixel. Both gwidth 
jwidth allows integer, float, or string of numeric plus unit. 
Default values for gwidth and jwidth are taken from Mangum et al. 
(2007).

Boolean parameter 'plot' controls whether gridded result is plotted 
or not. If True, color map of gridded data will be shown. Pixel 
center and observed position are overlayed as blue dot and red dot, 
respectively. Currently, channel averaged value will be plotted.

Definition at line 13 of file sdgrid.py.

References task_sdgrid.sdgrid(), and vla_uvfits_line_sf.verify.