Matching DS9 image with implot image
cosmologist wrote on May 23, 2011
I have some basic questions about understanding the image of a spectrum that I see in DS9 vs what I see when I use "implot" to see that same object spectrum.
Let's say I have a 2D spectrum image on DS9 where there is a white horizontal line on a blank background.
When I move my cursor across the image I can see the values of the physical coordinates (but I can't see the WCS).
Question 1: for this image is it true that the value of X coordinate is the column number that would be drawn with "implot" (if I use for example :c (that particular x axis value)), and the Y axis is the line number that would be drawn by "implot" (if I use for example :l (that particular y axis value)). ??
Question2: Would it make any difference if I set the parameter WCS in implot to logical or physical? (in other words does it have to be set to physical to match the values of x and y I see in the DS9 image)?
Questions 3: In this case is the x axis the dispersion axis and the y axis the spatial axis?
These issues are really basic but I still can't find an accurate answer for them, the help would be really really appreciated!
Let's say I have a 2D spectrum image on DS9 where there is a white horizontal line on a blank background.
When I move my cursor across the image I can see the values of the physical coordinates (but I can't see the WCS).
Question 1: for this image is it true that the value of X coordinate is the column number that would be drawn with "implot" (if I use for example :c (that particular x axis value)), and the Y axis is the line number that would be drawn by "implot" (if I use for example :l (that particular y axis value)). ??
Question2: Would it make any difference if I set the parameter WCS in implot to logical or physical? (in other words does it have to be set to physical to match the values of x and y I see in the DS9 image)?
Questions 3: In this case is the x axis the dispersion axis and the y axis the spatial axis?
These issues are really basic but I still can't find an accurate answer for them, the help would be really really appreciated!
Mike Fitzpatrick wrote on May 23, 2011
When I move my cursor across the image I can see the values of the physical coordinates (but I can't see the WCS).
Right, there is a long-standing issue with DS9 not displaying the WCS when you use the DISPLAY task, but even if you were to load the image standalone I don't think DS9 is able to display the spectral WCS if present.
Question 1: for this image is it true that the value of X coordinate is the column number that would be drawn with "implot" (if I use for example :c (that particular x axis value)), and the Y axis is the line number that would be drawn by "implot" (if I use for example :l (that particular y axis value)). ??
Yes
Question2: Would it make any difference if I set the parameter WCS in implot to logical or physical? (in other words does it have to be set to physical to match the values of x and y I see in the DS9 image)?
No. Logical coordinates are used when you e.g. use an image section and the physical coords then refer to the image section where the logical coords would be the coords in the parent image. If you're not using sections these should be the same.
Note you still need to specify an image frame buffer large enough for your image, if you're seeing a difference it may be that e.g. only the central 512x512 of the image is being displayed in ds9.
Questions 3: In this case is the x axis the dispersion axis and the y axis the spatial axis?
From your description of the data this sounds right (i.e.horizontal lines). Spectral tasks usually use the 'dispaxis' package parameter to control which is the dispersion axis to use.
[/quote]
cosmologist wrote on May 23, 2011
fitz
[quote:9aec0a06b3]
No. Logical coordinates are used when you e.g. use an image section and the physical coords then refer to the image section where the logical coords would be the coords in the parent image. If you're not using sections these should be the same.
Note you still need to specify an image frame buffer large enough for your image, if you're seeing a difference it may be that e.g. only the central 512x512 of the image is being displayed in ds9.
So if I trim the image is that considered using just a section of the whole image (after trimming I can't go back to the original image so I would assume that now this is a new picture, with its own coordinates, right?)
What confuses me is that in my ds9 image the x values run from -68 to 1900... why are there negative values?
Note that for implot if I put :c -68 I automatically get the plot of column 1 (no negative values). The last column that I can plot is 1901.
Mike Fitzpatrick wrote on May 23, 2011
If there LTM and/or LTV keywords in the header then DS9 may be using this to do the same sort of 'logical' coord system on a trimmed image. Under the DS9 'View' menu try adding 'Detector' coords to the readouts to see if it makes a difference.
cosmologist wrote on May 23, 2011
fitz
If there LTM and/or LTV keywords in the header then DS9 may be using this to do the same sort of 'logical' coord system on a trimmed image. Under the DS9 'View' menu try adding 'Detector' coords to the readouts to see if it makes a difference.
I added "Detector" coordinates but that didn't make a difference.
I searched with hselect for LTM and LTV but I didn't get anything.
Any other thoughts?
Mike Fitzpatrick wrote on May 23, 2011
Maybe 'Amplifier"?? Note that I meant e.g. LTMi_j when I said "LTM keywords", not literally "LTM". Otherwise, please post an image header.
cosmologist wrote on May 23, 2011
fitz
Maybe 'Amplifier"?? Note that I meant e.g. LTMi_j when I said "LTM keywords", not literally "LTM". Otherwise, please post an image header.
Oh I got it, it's here:
WCSDIM = 2
LTV2 = -195.
LTM1_1 = 1.
LTM2_2 = 1.
WAT0_001= 'system=physical'
WAT1_001= 'wtype=linear'
WAT2_001= 'wtype=linear'
TRIM = 'May 1 20:38 Trim data section is [1000:2900,70:640]'
ZEROCOR = 'May 1 20:38 Zero level correction image is Zero'
BIASSEC = '[1:1901,1:571]'
LTV1 = -999.
CCDMEAN = 2481.819
CCDMEANT= 988811551
CCDPROC = 'May 2 13:52 CCD processing done'
DARKCOR = 'May 2 13:25 Dark count correction image is Dark50.fits with scale=1'
FLATCOR = 'May 2 13:52 Flat field image is Flatres with scale=1.'
Francisco Valdes wrote on May 23, 2011
Hi, I thought I would add a comment.
One of the features of IRAF is that it attempts to maintain a link between the coordinates of the pixels in the current image and the original image. Specifically, taking a section out of a parent image (or trimming) keeps track of the pixel coordinates as they would be in the parent image. This can be a very useful thing and it can be confusing. It also depends on whether tasks make use of this. Some of the spectral task use this and something like IDENTIFY might should the original coordinates to the confusion of some users.
The most important usefulness for this feature is when different images must be matched such as a mask to an image, a flat field to a science exposures, or an arc spectrum to a science spectrum. In these cases it is possible that one image, usually the science image, was trimmed and the associated image was not.
Anyway, fundamentally if one gets confused it is due to the LTMi_j (which accounts for a change of scale) or LTVj (which accounts for origin offsets). One can clear this with "wcsreset wcs=physical" and often that makes things behave as novice users would expect.
Frank Valdes
One of the features of IRAF is that it attempts to maintain a link between the coordinates of the pixels in the current image and the original image. Specifically, taking a section out of a parent image (or trimming) keeps track of the pixel coordinates as they would be in the parent image. This can be a very useful thing and it can be confusing. It also depends on whether tasks make use of this. Some of the spectral task use this and something like IDENTIFY might should the original coordinates to the confusion of some users.
The most important usefulness for this feature is when different images must be matched such as a mask to an image, a flat field to a science exposures, or an arc spectrum to a science spectrum. In these cases it is possible that one image, usually the science image, was trimmed and the associated image was not.
Anyway, fundamentally if one gets confused it is due to the LTMi_j (which accounts for a change of scale) or LTVj (which accounts for origin offsets). One can clear this with "wcsreset wcs=physical" and often that makes things behave as novice users would expect.
Frank Valdes
Last post on May 23, 2011