Chandra X-Ray Observatory
Skip to the navigation links
Last modified: December 2013

AHELP for CIAO 4.9


Context: tools


Bins an image based on input mask


dmmaskbin infile maskfile outfile [errfile] [snrfile] [verbose]


`dmmaskbin' will take an input image and an input mask file. The output image will be the sum of the pixels in the input image who's corresponding value in the mask image are the same; and then divided by the number of pixels w/ the same mask value.

`dmmaskbin' is designed to work with the output outmaskfile of dmnautilus to group other images using the scheme as the input file.

The SNR of the new groups can be computed and saved. If no errfile is used; a Gaussian approximation is used (sqrt(value)).

Example 1

dmmaskbin img.fits mask.fits out.fits

Bins/Groups the input image, img.fits, based on groups identifed in 'mask.fits'

Example 2

dmmaskbin img.fits mask.fits out.fits snrfile=snr.fits

Similar to above but also output the SNR for each pixel. Since no variance image is input the error is taken to be a Gaussian approximation (sqrt(img.fits)).


name type ftype def reqd autoname
infile file input   yes  
maskfile file input   yes  
outfile file output   yes yes
errfile file input      
snrfile file output   no yes
clobber boolean   no no  

Detailed Parameter Descriptions

Parameter=infile (file required filetype=input)

Input 2D image

Input image to be rebinned.

Parameter=maskfile (file required filetype=input)

Input 2D mask image

Integer (only) image whose pixels represent various bins. All the pixels whose values are the same in the mask file will be grouped in the input file to make the output image. Must be same dimensions as the infile and must be an integer datatype.

Parameter=outfile (file required filetype=output autoname=yes)

Output image name

Output image file name. Image will be a real valued data type.

Parameter=errfile (file filetype=input)

Input variance image

Input error estimate for each pixel. If blank or none will use sqrt(infile).

Parameter=snrfile (file not required filetype=output autoname=yes)

Output SNR image

Image containing the SNR for the newly grouped/binned image.

Parameter=clobber (boolean not required default=no)


There are no known bugs for this tool.

See Also

dmappend, dmcontour, dmellipse, dmfilth, dmimg2jpg, dmimgadapt, dmimgblob, dmimgcalc, dmimgdist, dmimgfilt, dmimghist, dmimghull, dmimglasso, dmimgpick, dmimgpm, dmimgproject, dmimgreproject, dmimgthresh, dmmaskfill, dmnautilus, dmregrid, dmregrid2, dmstat, evalpos, imgmoment, mean_energy_map, pileup_map

Last modified: December 2013
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email: Smithsonian Institution, Copyright © 1998-2017. All rights reserved.