Last modified: December 2022

URL: https://cxc.cfa.harvard.edu/ciao/ahelp/dmmaskbin.html
AHELP for CIAO 4.17

dmmaskbin

Context: Tools::Image

Synopsis

Bins an image based on input mask

Syntax

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

Description

`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)).


Examples

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)).


Parameters

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)


Bugs

There are no known bugs for this tool.

See Also

dm
dmfiltering
tools::core
dmappend
tools::image
centroid_map, dmfilth, dmimg2jpg, dmimgadapt, dmimgblob, dmimgcalc, dmimgdist, dmimgfilt, dmimghist, dmimgpick, dmimgpm, dmimgproject, dmimgreproject, dmimgthresh, dmmaskfill, dmnautilus, dmradar, dmregrid, dmregrid2, energy_hue_map, evalpos, hexgrid, map2reg, merge_too_small, mkregmap, pathfinder, vtbin
tools::region
dmcontour, dmellipse, dmimghull, dmimglasso
tools::response
mean_energy_map, pileup_map
tools::statistics
dmstat, imgmoment, statmap