shift and magnify
douglas brenner wrote on Feb 13, 2009
I want to shift and then demagnify an image. The final size should be the same size as the original and the final center should be the same center as in the shifted image.
Any help would be appreciated.
Thanks.
Any help would be appreciated.
Thanks.
Mike Fitzpatrick wrote on Feb 13, 2009
If you know the exact shift and scale factors, then the IMSHIFT and MAGNIFY tasks may be all you need. If your images have a WCS, then something like WREGISTER should be able to do it for you automatically, otherwise poke around in the IMAGES.IMMATCH package.
-Mike
-Mike
douglas brenner wrote on Feb 13, 2009
Shift changes the physical coordinates but not the image coordinates; magnify changes the image coordinates but not the physical.
I need to get the coordinates to agree after shifting ??
And to trim the image after magnifying (imcopy)
Will imcopy trim the image coordinates but not the physical?
I need to get the coordinates to agree after shifting ??
And to trim the image after magnifying (imcopy)
Will imcopy trim the image coordinates but not the physical?
Mike Fitzpatrick wrote on Feb 13, 2009
WREGISTER should take care of tracking the WCS changes needed to align the images. I don't quite follow your comments though: both IMSHIFT and MAGNIFY will modify the WCS to update the offset/scale you use. What do you mean by "physical" and "image" coordinates in your question?
-Mike
-Mike
douglas brenner wrote on Feb 13, 2009
By the physical and image coordinates, I'm talking about as they appear in DS9.
Regarding the WCS coordinates, maybe I don't understand but there is no header information that I can see about WCS.
Regarding the WCS coordinates, maybe I don't understand but there is no header information that I can see about WCS.
Mike Fitzpatrick wrote on Feb 13, 2009
If you display to DS9 from IRAF be aware DS9 can't access the image header (actually, it chooses not to) so you won't see the WCS changes, only updates in pixel coordinates. Loading images from DS9 in standalone mode should show the updates, specifically you're looking for new values of e.g. the CRVAL/CRPIX, CDELT and/or CD matrix keywords.
-Mike
-Mike
douglas brenner wrote on Feb 13, 2009
My Iraf code works. When I shift, magnify and display in ds9, the images can be aligned as they should be. However, the coordinates physical and logical (or "image" in ds9 parlance) are as follows. If I shift a 300 x 300 image by -10,-10,
and then magnify by 0.5, in the physical coordinates the array size is about the same size as originally but the center of the image is still at the original location (160,160) and the image (not the array) has been compressed by a factor of 2. The array size in logical coordinates has been reduced so that the array is 150X150 and the image is now in the center of the FOV at 75,75.
The fits files are the size of the reduced array.
I need a combination of the two. I need the imaged center at 150,150 and reduced in size but with the original array size. (300x300).
I hope I've made myself clear and that you have a solution. Worse comes to worse, I can always calculate where I am from the header values but I rather not use the computing time.
Thanks
and then magnify by 0.5, in the physical coordinates the array size is about the same size as originally but the center of the image is still at the original location (160,160) and the image (not the array) has been compressed by a factor of 2. The array size in logical coordinates has been reduced so that the array is 150X150 and the image is now in the center of the FOV at 75,75.
The fits files are the size of the reduced array.
I need a combination of the two. I need the imaged center at 150,150 and reduced in size but with the original array size. (300x300).
I hope I've made myself clear and that you have a solution. Worse comes to worse, I can always calculate where I am from the header values but I rather not use the computing time.
Thanks
Last post on Feb 13, 2009