comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » image rotation Fits headers?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: image rotation Fits headers? [message #52582 is a reply to message #52443] Fri, 09 February 2007 05:12 Go to previous message
wlandsman@jhu.edu is currently offline  wlandsman@jhu.edu
Messages: 12
Registered: September 2006
Junior Member
"elwood" <elwood@astro.umn.edu> wrote in message
news:1170970425.566639.104890@k78g2000cwa.googlegroups.com.. .
> How do I rotate and get correct WCS without clipping the image?
> I think what needs to be done is to REMAP the image and the WCS onto a
> big empty box
> so that it sits in the center and doesnt get clipped when rotated.

With apologies to non-astronomers...

Here's one way to embed a rectangular image into a square array and preserve
the world coordinate system.
You can then presumably use hrot directly on the square image.

Suppose you have a 1000 x 500 image, im, and a associated FITS header, h.
First embed this image into a square array....

IDL> im1 = fltarr(1000,1000)
IDL> im1[0,250] = im

;Now update the FITS header for the new array with updated values of
NAXIS2 (giving size of second
;dimension, and CRPIX2 (giving Y position of the astrometric reference
pixel).

IDL> h1 = h
IDL> sxaddpar,h1,'NAXIS2',1000 ;Update NAXIS2 keyword with new dimension
IDL> sxaddpar,h1,'CRPIX2', sxpar(h,'CRPIX2') + 250 ;CRPIX2 is offset by 250
in square image

then,

IDL> hrot,im1,h1,.....

I suppose it wouldn't be hard to write a general procedure to "squareify" an
image and preserve the WCS.

--Wayne
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Improving a piece of code with arrays and for-loops
Next Topic: Arrays of Structures

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 12:33:07 PDT 2025

Total time taken to generate the page: 0.87589 seconds