View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

polyphot doesn’t work (coordinates?)

pweilbacher wrote on Dec 21, 2007

I used polyphot successfully a few years ago (with IRAFV2.11.3) and now I am trying to use it again (with IRAFV2.12.2a, haven't upgraded to 2.14 but will try that soon).

Now that I want to try again, it doesn't work any more. The file with the vertices looks fine (two floats per line and a semicolon on the last line, and I verified with tvmark that the vertices are within the frame), but still, the output in *.ply.* looks always like this:

Vx                     INDEF     INDEF     1     nullfile               0      \
   INDEF      INDEF      0.000   0.000   INDEF   INDEF          101  OffImage  \
   INDEF          INDEF          INDEF          0      0        201  OffImage  \
   281.9896       1.38495        V_BESS                 INDEF                  \
   0.             0.             0.             INDEF    INDEF  801  NoPolygon \
   ver.MainSys25       0    0.00     0.00     0.00     0.00     0.00     0     \
   INDEF    INDEF


What I find particularly supicious are the INDEFs in the first line which should be the cursor position when I press <space>. Standard phot works fine from the same session, so I doubt that there is a problem reading the cursor position from the ds9 display...

Would be grateful for any ideas what I could try.

Mike Fitzpatrick wrote on Dec 21, 2007

Without seeing your input files all I can suggest is that you verify first that the cursor readback is working as you'd expect, e.g. by using the RIMCURSOR task to make sure you can read it properly at all, or the 'x' keystroke in IMEXAM with the world wcs. There's been problems in the past with reading DS9 cursors that have been fixed by doing


cl> set disable_wcs_maps=""
cl> flpr


Whether this has any effect depends on the DS9 and IRAF versions, if you still have problems please post your aperture file.

Cheers,
-Mike

pweilbacher wrote on Dec 21, 2007

Mike, thanks for the speedy reply that I couldn't follow up on similarly quick.

rimcursor and imexam seem to work fine. I don't see a change after setting disable_wcs_maps as you suggest.

By aperture file I guess you mean the polygon? A short one that doesn't work looks like this:
273.5542  163.4506
285.238  165.7621
292.2483  174.9353
286.4064  183.3623
271.2175  187.1844
258.3288  181.069
264.1707  172.642
266.5439  164.9977
;
which is just a star circled. Note that pressing x in imexam on the approximate center of the star results in
 281.00  174.00 391.823
and tvmark also nicely circles it on the display, so the coordinate systems should be fine.

pweilbacher wrote on Dec 21, 2007

I upgraded to IRAF 2.14 now which unfortunately didn't change anything. :(

Mike Fitzpatrick wrote on Dec 21, 2007

Hi Peter,

I don't really have any concrete ideas of what might be wrong, but you might check the APPHOT parameters to see whether the 'wcsin' parameter is perhaps set to 'world' indicating the coords should be interpreted as (ra,dec). If it is set to 'logical' see whether the image header contains any LTM keywords that may be applying an offset to the coords. In a worst case, unlearning the parameters and resetting everything is a good way to eliminate parameter errors, trying the same params on a test image like dev$pix can eliminate data problems.

Hope this helps,
-Mike

pweilbacher wrote on Dec 21, 2007

Hi Mike,

wcsin was set to logical and LTM1_1 and LTM2_2 were 1. Taking up your suggestion of trying with dev$pix I have now done the following (with IRAF 2.14 on Linux):

unlearn contour
contour dev$pix label-

unlearn apphot
unlearn polymark

set stdimcur=stdgraph
polymark dev$pix
# roughly mark the star at the bottom right
set stdimcur=stdimage

cat pix.ver.1
469.3358  47.00448
479.2613  49.37191
483.0787  55.68505
479.2613  65.17355
476.9708  67.54097
470.8628  69.92719
463.2279  67.54097
458.6469  61.22783
458.6469  54.8959
458.6469  47.79362
464.7549  43.03998
;

displ dev$pix 4
tvmark 4 pix.ver.1 mark=line
# check that the star is indeed surrounded by the line

unlearn polyphot
unlearn datapars
unlearn centerpars
unlearn fitskypars
unlearn polypars

polyphot dev$pix polygon=pix.ver.1
# press space over the star on the display

tail pix.ply.1 nl=7
pix                    INDEF     INDEF     1     nullfile               0      \
   INDEF      INDEF      0.000   0.000   INDEF   INDEF          101  OffImage  \
   INDEF          INDEF          INDEF          0      0        201  OffImage  \
   1.             INDEF          INDEF                  INDEF                  \
   0.             0.             0.             INDEF    INDEF  801  NoPolygon \
   pix.ver.1           0    0.00     0.00     0.00     0.00     0.00     0     \
   INDEF    INDEF

# check that mouse coordinates are correctly communicated, both times press 'x' over the star
imexam fram=4
 465.50   61.50   2172.
rimcur
465.5 61.5 400 x 

Hmm, I am not sure if there is something left that could be due to my installation or settings. Otherwise this should be a reproducible bug.

pweilbacher wrote on Dec 21, 2007

It seems that I just don't know any more how to use polyphot. I need to type 'n' before pressing space to go to the first polygon and the next ones. (I don't remember having to do that when I last used polyphot but as that was several years ago, my memory is probably wrong.)

Mike, sorry for wasting your time!

Last post on Dec 21, 2007