Common Image Analysis Task Parameters

Parameters that are frequently found in Image Analysis tasks

Common Image Analysis Task Parameters

 Some parameters are common to many image analysis tasks. These include: 

imagename

for specifying the image(s) to operate on. In some tasks, this can be a list of images, e.g. in immath. Note that most image analysis tasks accept both, CASA images and fits images. 

 

outfile 

typically the parameter for the processed image of a task. 

 

axes

A list that specifies the axes to be selected. Typically, CASA images have the following axis order (0-based python numbers) 0) RA 1) DEC  2) Stokes 3) Frequency.  Spatial axes can also be GLON/GLAT.  The spectral axis of CASA images will always be in frequency units but may also have one or more additional velocity labels that can be created and modified with imreframe.  E.g. if one would like to receive statistics across RA/DEC in imstat per velocity channel, axes should be set to [0,1]. The spectral axis alone would be [3]. Imhead will  provide information on the actual axis specifications which may well differ from the above sequence, in particular when image (cubes) are imported intop CASA from fits. 

 

box, chans, stokes

are used to select parts of an image and are described in 'Image Selection Parameters'.  

 

mask 

referes to an image mask that can be a Boolean mask inside an image, a separate zero/non-zero image or a mathematical expression, see 'Image Masks'. 

 

stretch 

This parameter is typically used for single-plane masks that are to be applied to each spectral plane of an image cube. The concept also works for other axes. 

 

Returned Python Dictionaries 

Many image analysis tasks also return python dictionaries with information that is also printed to the logger. The dictionaries can be assigned to a variable and then used later for other scripting purposes. In the following the output of imstat is assigned to the python dictionary 'dict':

CASA <20>: dict=imstat(imagename='test.image')

CASA <21>: dict
Out[21]:
{'blc': array([0, 0, 0, 0], dtype=int32),
'blcf': '17:45:40.899, -29.00.18.780, I, 1.62457e+10Hz',
'max': array([ 0.49454519]),
'maxpos': array([32, 32, 0, 0], dtype=int32),
'maxposf': '17:45:40.655, -29.00.15.580, I, 1.62457e+10Hz',
'mean': array([ 0.00033688]),
'medabsdevmed': array([ 0.]),
'median': array([ 0.]),
'min': array([-0.0174111]),
'minpos': array([15, 42, 0, 0], dtype=int32),
'minposf': '17:45:40.785, -29.00.14.580, I, 1.62457e+10Hz',
'npts': array([ 4096.]),
'q1': array([ 0.]),
'q3': array([ 0.]),
'quartile': array([ 0.]),
'rms': array([ 0.00906393]),
'sigma': array([ 0.00905878]),
'sum': array([ 1.37985568]),
'sumsq': array([ 0.3365063]),
'trc': array([63, 63, 0, 0], dtype=int32),
'trcf': '17:45:40.419, -29.00.12.480, I, 1.62457e+10Hz'}

A description of how to deal with Python dictionaries is given in 'Python and CASA'.