This help file is split up into the following sections:
-
1. Image filtering on logical coordinates
-
2. Image filtering on physical coordinates
-
3. Image filtering on world coordinates
See `ahelp dmimages' for information on the logical and physical
coordinate systems used for images.
To filter an image on its logical coordinates,
dmcopy "im.fits[#1=257:512,#2=1:100]" subset.fits
pulls out a 256 x 100 subset of the image.
dmcopy "im.fits[(#1,#2)=circle(145,356,25)]" circle.fits
sets everything outside the specified circle to zero
(unless the BLANK keyword is defined in which case that value
is used).
The default behaviour of a filter like this is to also
shrink the resulting image to be as small as possible
surrounding the circle. To suppress this behaviour, and
get a big, almost empty, image (the same size as im.fits)
with a small circle in the middle, use the "opt full" modifier
as shown below:
dmcopy "im.fits[(#1,#2)=circle(145,356,25)][opt full]" circle.fits
One can explicitly set the value to be used for pixels lying
outside the filter using the 'opt null' directive, e.g.
dmcopy "im.fits[(#1,#2)=circle(145,356,25)][opt null=-100]" circle.fits
To filter on the original physical coordinates, we refer to
the physical axis names:
dmcopy "im.fits[x=4096.5:4213.5,y=4142.3:6120.1]" subset.fits
You can also use a region filter:
dmcopy "im.fits[(x,y)=circle(4096,4096,12)]" circle.img
This will give you a square image bounding the given circle,
and set to zero all pixels outside the circle. If you wish to mark
these pixels as "invalid", you can use the
"opt null" syntax described in "ahelp dmopt":
dmcopy "im.fits[(x,y)=circle(4096,4096,12)][opt null=-999]" circ2.img
Note that not all programs will recognise that such pixels are to be
ignored, although both ds9 and dmstat do.
You can also use world coordinates in a region filter:
dmcopy 'im.fits[(x,y)=circle(11:03:28.4,-20:11:23.2,20.1\")]' circ.img
Note: The arcsecond symbol should work on the command line, but you may have
problems using the parameter interface (pset).
However, you can't use the world coordinates when filtering
on a one dimensional range - i.e. [x=11:03:28.2:11:03:32.1] won't work,
you would have to do use "(x,y)=rectangle(...)" instead.