| 
 
      Rebin a stack of 2-dimensional images.
    
dmregrid  infile outfile bin rotangle rotxcenter rotycenter xoffset
yoffset npts [coord_sys] [clobber] [verbose] 
      
	This tool regrids each input image within the input dataset
	based on the binning specification, offsets, minimum and
	maximum channels, rotation angle, and center of
	rotation.  For a stack of input files, the output file is the
	sum of the regridded images.  The rotation and offset
	parameters may be specified as a stack in order to apply
	different values to each of the input file.  However, the same
	binning is applied to all input files; it cannot be given as a
	stack. Physical 
	and world coordinate systems (containing the transformation
	given by the first regridding specification) are attached to
	the output image axes. 
       
        If the parameter npts=0, the exact algorithm is used in which
	for each unit pixel overlapping a regridded pixel, a polygon
	is created that is the intersection of the two pixels. The
	area of this polygon is calculated and used to weight the
	number of counts within the unit pixel to be allocated to the
	regridded pixel.
       
        If npts is given a positive value, the approximate regridding
	algorithm is used in which npts*npts uniformly spaced points
	within a regridded pixel are sampled; the appropriate fraction
	of the number of counts within the unit pixel encompassing
	each sampling point is then allocated to the regridded pixel.    
       
	The approximate algorithm is faster than the exact algorithm
	by a factor dependent on the value of npts, the binning
	scales, and the fraction of the input which is non-zero. For
	example, for npts=10 and the binning scales=1, the approximate
	algorithm is about 10 to 50 times faster.  For larger binning
	scales, the factor is greater due to fewer points being
	sampled.
       
dmregrid image.fits newimage.fits "20:50:1,30:60:1" rotangle=0
rotxcenter=0 rotycenter=0 xoffset=0 yoffset=0 npts=0 clobber=yes
verbose=0
            
               Regrid a single image by binning a subset of the image with unit bin
               factors, no rotation and no offsets, clobbering the previous output
               file, using the exact algorithm, minimum verbosity. 
             
dmregrid image.fits newimage.fits "20:100:5,30:110:10" rotangle=10
rotxcenter=25 rotycenter=40 xoffset=15 yoffset=20 npts=10 verbose=5
            
		Regrid an image by binning a subset of the image with
		bin factors of 5 and 10, rotating about (25,40) by 10
		degrees, with an offset of (15,20), clobbering the
		previous output file, maximum verbosity. The
		approximate algorithm is used, with 100 points within
		each regridded pixel sampled.
             
dmregrid @inlist.txt newimage.fits "1:100:1,1:300:3" rotangle=@rotlist
rotxcenter=@xrotlist rotycenter=@yrotlist xoffset=@xofflist
yoffset=@yoffset npts=0
            
		Regrid the images im1.fits and im2.fits listed in the
		ASCII file inlist.txt by binning from 1:100:1 in x and
		1:300:3 in y, rotation angles listed in the file
		rotlist, offsets listed in the files xofflist and
		yofflist, rotation center coordinates listed in the
		files xrotlist and yrotlist, and clobbering the
		previous output file, summing the images to be output
		using the exact algorithm.
             
dmregrid @inlist.txt newimage.fits "1:100:1,1:300:3" rotangle=25
rotxcenter=30 rotycenter=40 xoffset=@xofflist yoffset=@yoffset npts=0
            
                Identical to example 3, except perform both rotations
		about (30,40) by 25 degrees.
             
Parameter=infile (file required filetype=input stacks=yes)
            The input dataset or stack.
          
            
               Input images to rebin.  If more than 1 image is input, the
               output will be the sum (co-added) of the rebinned input images.
             
Parameter=bin (string required stacks=no)
            The binning specification.
          
            
               The binning specification which consists of the minimum
	       channel number for x, the maximum channel number for x,
	       the bin factor for x, and the analogous parameters for
	       y. The same binning is used for all input files.  The
	       binning may be given in either image or physical
	       coordinates; the coordinate system of the bin
	       parameter is defined by the `coords_sys' parameter.
             
Parameter=rotangle (string required default=0 units=degrees stacks=yes)
            The CCW rotation angle in degrees of the regridded image in degrees about the
            rotation center (the location about which the regridded image is to be
            rotated).
          
            The x-coordinate of the rotation center.
          
            The y-coordinate of the rotation center.
          
Parameter=xoffset (string required default=0 stacks=yes)
            The x-offset of the regridded image.
          
Parameter=yoffset (string required default=0 stacks=yes)
            The y-offset of the regridded image.
          
Parameter=npts (integer required default=0 min=0 max=999)
            If positive, the number of points sampled along a subgrid in each regridded  
            pixel calculated using the approximate algorithm. If 0, the exact algorithm is
            used. 
          
	   Controls whether the 'bin' parameter is interpreted as
	   'logical' or 'physical' pixels.
	  
            Specifies if an existing output file should be overwritten.
          
            Specifies the level of verbosity in displaying diagnostic
            messages (0-5).
          
      
        It is possible to specify the 'bin' grid in either image or
	physical coordinates. A new parameter (coords_sys) controls
	whether 'bin' is interpreted as logical (the default, old
	behavior) or physical.  Images covering different physical
	pixel ranges and at different resolutions (binning) can now be
	combined without applying offsets.
       
      
	Fixed limitation that multiple offsets, angles, or rotation
	centers required specification in external ("@") files.
       
         Fixed memory leak for large file(s) in stack.
       
	Fixed failure to propagate units from (first) file.
       
calibration
ardlib
dm
dmbinning,
dmimages,
dmimfiltering
tools
acis_bkgrnd_lookup,
acis_fef_lookup,
acis_set_ardlib,
acisspec,
aconvolve,
acrosscorr,
add_grating_orders,
add_grating_spectra,
arestore,
asphist,
dither_region,
dmappend,
dmarfadd,
dmcontour,
dmcoords,
dmcopy,
dmextract,
dmfilth,
dmgroup,
dmimg2jpg,
dmimgcalc,
dmimghist,
dmimgpick,
dmimgthresh,
fullgarf,
get_sky_limits,
mkacisrmf,
mkarf,
mkexpmap,
mkgarf,
mkgrmf,
mkinstmap,
mkpsf,
mkrmf,
mkwarf,
psextract,
psf_project_ray,
rmfimg,
specextract,
tgextract
 |