NRAO Home > CASA > CASA Toolkit Reference Manual
##### image.getslice - Function

1.1.1 Get 1-D slice from the image

Description

This function returns a 1-D slice (the pixels and opionally the pixel mask) from the image file. The slice is constrained to lie in a plane of two cardinal axes (e.g. XY or YZ). At some point this constraint will be relaxed. A range of interpolation schemes are available.

You specify the slice as a polyline giving the x (x) and y (y) coordinates and the axes of the plane holding that slice (axes). As well, you must specify the absolute pixel coordinates of the other axes (coord). This defaults to the first pixel (e.g. first plane).

The return value is a record with fields ’pixels’ (interpolated intensity), ’mask’ (interpolated mask), ’xpos’ (x-location in absolute pixel coordinates), ’ypos’ (y-location in absolute pixel coordinates), ’distance’ (distance along slice in pixels), ’axes’ (the x and y axes of slice).

Arguments

 Inputs x Polyline x vertices in absolute pixel coordinates allowed: doubleArray Default: y Polyline y vertices in absolute pixel coordinates allowed: doubleArray Default: axes Pixel axes of plane holding slice. Default is first two axes. allowed: intArray Default: 01 coord Specify pixel coordinate for other axes. Default is first pixel. allowed: intArray Default: -1 npts Number of points in slice. Default is auto determination. allowed: int Default: 0 method The interpolation method, String from ’nearest’, ’linear’, ’cubic’ allowed: string Default: linear
Returns
record

Example

Suppose that we have a 2-dimensional image. Then:

"""
#
print "\t----\t getslice Ex 1 \t----"
ia.maketestimage();
rec = ia.getslice (x=[1,20], y=[2,30])     # SLice from [1,2] -> [20,30]
print rec.keys()
#[’distance’, ’xpos’, ’axes’, ’mask’, ’ypos’, ’pixel’]
rec = ia.getslice (x=[1,20,25,11], y=[2,30,32,40]) # Polyline slice
ia.close()
#
"""

__________________________________________________________________