NRAO Home > CASA > CASA Toolkit Reference Manual
image.pad - Function

1.1.1 Pad the perimeter of the direction plane with a number of pixels of specified value and mask.


Description

This method pads the directional plane of an image with a specified number of pixels on each side. The numerical and mask values of the padding pixels may also be specified. If a region is selected, a subimage of that region is created and then padded with the specified pixel parameters. Thus, padding an image of shape (ra, dec, freq) = (512, 512, 10) specifying npixels = 3 results in an image of size (518, 518, 10), with the blc of the directional plane of the original pixel set corresponding to the directional pixel of (3, 3) in the output. If wantreturn is True, an image analysis tool attached to the output image is returned. If False, none is returned.

Arguments





Inputs

outfile

Output image name. If not specified, no persistent image is created.

allowed:

string

Default:

npixels

Number of pixels with which to pad each side of the direction plane.

allowed:

int

Default:

1

value

Value given to the padding pixels.

allowed:

double

Default:

0

padmask

Value of the mask for the padding pixels. True=>good (unmasked), False=>bad (masked).

allowed:

bool

Default:

false

overwrite

Overwrite the output if it exists? Default False

allowed:

bool

Default:

false

region

Region selection. Default is to use the full image.

allowed:

any

Default:

variant

box

Rectangular region to select in direction plane. Default is to use the entire direction plane.

allowed:

string

Default:

chans

Channels to use. Default is to use all channels.

allowed:

string

Default:

stokes

Stokes planes to use. Default is to use all stokes planes.

allowed:

string

Default:

mask

Mask to use. Default is none.

allowed:

string

Default:

stretch

Stretch the mask if necessary and possible? Default False

allowed:

bool

Default:

false

wantreturn

Return an image analysis tool attached to the created subimage?

allowed:

bool

Default:

true

Returns
image

Example

 
        ia.fromshape("",[50, 50, 10])  
        # pad it with 5 pixels of value 2.5 all unmasked  
        padded = ia.pad(npixels=5, value=2.5, padmask=True)  
        ia.done()  
        # returns [60, 60, 10]  
        paddedshape = padded.shape()  
        padded.done()  

__________________________________________________________________


More information about CASA may be found at the CASA web page

Copyright © 2016 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search