[R] Using WCSLIB in R

Lee Kelvin lsk9 at st-andrews.ac.uk
Sun Oct 25 18:32:11 CET 2009


I'm aware that not everyone who uses R is an astronomer, and so 
apologies in advance to those people for the nature of this email.  I 
need to convert right-ascension and declination (RA & DEC) coordinates 
for an object on the sky into physical pixel positions in a FITS image 
in R. 

There is a C library that does this, WCSLIB by Mark Calabretta 
(http://www.atnf.csiro.au/people/mcalabre/WCS/), however I am unsure how 
to use it in R.  I do not program in C, which adds to the problem.  I 
have created the libwcs.so file and moved it to /usr/local/lib already, 
and am able to load the library in R using:

 > dyn.load("/usr/local/lib/libwcs.so")

and then check that the function I need is available using:

 > is.loaded("wcss2p")
[1] TRUE

My problem now is how to actually use it, as the author of the library 
does not use R.  I was wondering if anyone in the community has used 
this library before, and if so how?

Thankyou in advance,
    Lee Kelvin

School of Physics & Astronomy
University of St Andrews
North Haugh
St Andrews KY16 9SS
United Kingdom

Phone (+44) [0]1334461668
Email lsk9 at st-andrews.ac.uk

More information about the R-help mailing list