View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

wcsctran suggestion …

Frank Valdes wrote on Apr 08, 2003

Q:  It would be useful to have an option in wcsctran which 
prepended or appended the wcs coordinates to each line,
rather than overwriting the original coordinates.


A:  Thanks for the feedback.  I have also thought this could be useful.  But
since there is an easy workaround it is likely not to be done soon.

The workaround is to use the FIELDS task to first copy the two columns
you want to transform and then use WCSCTRAN on that.  So suppose you
have a list of x/y in columns 1/2 and you want to end up with a file
with ra/dec in colums 1/2, the x/y values in columns 3/4 and any other
columns following.


cl> fields john1 1,2,1,2,3-10 > john2
cl> wcsctran john2 john3 dev$wpix logical world col="1 2" format="%H %h" verb-
cl> type john1,john2,john3
===> john1 <===
1 1
200 200
500 500


===> john2 <===
1   1   1   1   
200   200   200   200   
500   500   500   500   


===> john3 <===
13:28:06.3 47:23:58.3   1   1   
13:27:51.3 47:26:30.8   200   200   
13:27:28.6 47:30:20.6   500   500   



Naturally you can use STDIN/STDOUT and pipes.  For instance to do what you
asked for in one command:

cl> fields john1 1,2,1,2,3-10 | \
>>> wcsctran STDIN STDOUT dev$wpix logical world col="1 2" format="%H %h" verb-
13:28:06.3 47:23:58.3   1   1   
13:27:51.3 47:26:30.8   200   200   
13:27:28.6 47:30:20.6   500   500

Last post on Apr 08, 2003