Rotation and flipping image of spectrum
Petr Skoda wrote on Mar 15, 2007
Hello,
I have problems with simple rotation and flipping 2D image of spectrum followed by apall and identify. What I want is to physically rotate and/or flip image by changing the pixels contents not just transformation matrix keywords. The problem can be demostrated on echelle spectrum oriented in a such a way:
lamda is going from blue to red from right to left and bottom to up (blue order below the redder ones, but horizontaly the red is at the left sid).
When I extract orders I see again the opposite direction of lamda (right to left)
Now I apply (as recommended) the image transformation
imcopy image[-*,*] flipimage
The flipimage is displayed (ds9) correctly flipped,
after apall the extracted orders have increasing lambda from left to right and all seems ok.
But the ecidentify shows the reversed lambda axis (the same as for no flipped image) all the time!
Even more confused I was when trying to rotate spectra with orders placed vertically by
imtransp image[-*,*] tranimage
After some play with dispaxis, image sections for cutting regions and other transformations I was completely lost (usually on ecident). To make things more clear I wanted to flip the image in a real sense in pixels but I could not find suitable procedure. What should I do ?
Regards
Petr
I have problems with simple rotation and flipping 2D image of spectrum followed by apall and identify. What I want is to physically rotate and/or flip image by changing the pixels contents not just transformation matrix keywords. The problem can be demostrated on echelle spectrum oriented in a such a way:
lamda is going from blue to red from right to left and bottom to up (blue order below the redder ones, but horizontaly the red is at the left sid).
When I extract orders I see again the opposite direction of lamda (right to left)
Now I apply (as recommended) the image transformation
imcopy image[-*,*] flipimage
The flipimage is displayed (ds9) correctly flipped,
after apall the extracted orders have increasing lambda from left to right and all seems ok.
But the ecidentify shows the reversed lambda axis (the same as for no flipped image) all the time!
Even more confused I was when trying to rotate spectra with orders placed vertically by
imtransp image[-*,*] tranimage
After some play with dispaxis, image sections for cutting regions and other transformations I was completely lost (usually on ecident). To make things more clear I wanted to flip the image in a real sense in pixels but I could not find suitable procedure. What should I do ?
Regards
Petr
Francisco Valdes wrote on Mar 15, 2007
Hello Petr,
IDENTIFY and ECIDENTIFY work in "physical" coordinates. This is a coordinate system that is preserved through various operations like flips, transforms, and subsections. The reason for this is that one might do a solution on a full spectrum and then want it to apply to a subsection.
In any case, the solution is to "erase" this physical coordinate system. This is done with the command
So you would do this command after the flipping and before using the EC tasks. Everything should then work as if the original image was observed flipped.
Yours,
Frank Valdes
IDENTIFY and ECIDENTIFY work in "physical" coordinates. This is a coordinate system that is preserved through various operations like flips, transforms, and subsections. The reason for this is that one might do a solution on a full spectrum and then want it to apply to a subsection.
In any case, the solution is to "erase" this physical coordinate system. This is done with the command
wcsreset <images> wcs=physical
So you would do this command after the flipping and before using the EC tasks. Everything should then work as if the original image was observed flipped.
Yours,
Frank Valdes
Petr Skoda wrote on Mar 15, 2007
Thank you Frank a lot !
Now it works exactly the way I wanted.
Now it works exactly the way I wanted.
Last post on Mar 15, 2007