Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: image.maskhandlergui - Function Up: image - Tool Previous: image.makecomplex - Function


image.maskhandler - Function



Package general
Module images
Tool image


Handle pixel masks


Synopsis
maskhandler(op, name)


Description



Arguments

op in The operation
    Allowed: String, one of `set', `default', `delete', `rename', `get', `copy'
name in Name of mask or masks
    Allowed: Vector of strings


Returns
Vector string, string, T or fail

This function (short-hand name mh) is used to manage or handle pixel masks (there is also a custom GUI interface through the maskhandlergui function). An AIPS++ image may contain zero, one or more pixel masks. Any of these masks can be designated the default pixel mask. The default mask is acted upon by AIPS++ applications. For example, if you ask for statistics from an image, pixels which are masked as bad (F) will be excluded from the calculations.

This function has an argument (op) that specifies the behaviour. In all cases, you can shorten the operation string to three characters. It is not the job of this function to modify the values of masks.

  • default - this retrieves the name of the default pixel mask as the return value of the function call.

  • get - this retrieves the name(s) of the existing pixel masks as the return value of the function call (string or vector of strings).

  • set - this lets you change the default pixel mask to that given by the name argument. If name is empty, then the default mask is unset (i.e. an all good mask is effectively applied).

  • delete - this lets you delete the pixel masks specified by the name argument. To delete more than one mask, name can be a vector of strings. Any supplied pixel mask name that does not exist is silently ignored.

  • rename - this lets you rename the mask specified by name[1] to name[2]. Thus the name argument must be a vector of length 2.

  • copy - this lets you copy a mask to another in the same image, or copy a mask from another image into this image. Thus the name argument must be a vector of length 2.

    For the first case, the first element of name must be the name of the mask to copy, and the second element must be the name of the pixel mask to which it will be copied.

    For the second case, the first element of name must be the name of the input image and pixel mask with a colon delimiter (e.g. hcn:mask2). The second element must be the name of the pixel mask to which the input pixel mask will be copied.

Use the summary function to see the available pixel masks. You can do this either via the logger display, or via the returned record, which contains the mask names. In the logger display, any pixel mask which is not the default mask is listed in square brackets. If a default mask is set, it is listed first, and is not enclosed in square brackets.



Example
- im := image('myimage')
- local names, name
- names := im.maskhandler('get')            # Get the mask names
- name := im.maskhandler('default')         # Get the default mask names
- im.maskhandler('set', 'mask1')            # Make 'mask1' the default mask
- im.maskhandler('set', '')                 # Unset the default mask
- im.maskhandler('delete', 'mask1')         # Delete 'mask1' 
- im.maskhandler('delete', 'mask0 mask1')   # Delete 'mask0' and 'mask1' 
- im.maskhandler('rename', 'mask1 mask0')   # Rename 'mask1' to 'mask0'
- im.maskhandler('copy', 'g1.app:mask1 mask10')   # Copy 'mask1' from image 'g1.app'  to 'mask10' in image 'myimage'





next up previous contents index
Next: image.maskhandlergui - Function Up: image - Tool Previous: image.makecomplex - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01