ad.to.xy | R Documentation |
Converts RA/DEC (degrees) to X/Y (pixels) position using the TAN Gnomonic projection system.
ad.to.xy(ra, dec, astr.struc, diagnostic = FALSE)
ra |
numeric (n) vector; RA values |
dec |
numeric (n) vector; Dec values |
astr.struc |
list; Astrometry Keywords and values returned from read of a fits header. See "read.astrometry" function |
diagnostic |
logical; if TRUE, diagnostic information will be output as type ‘message’ |
numeric (n,2) array; two numeric (n) vectors ‘X’ and ‘Y’, column-bound
While this routine is designed for use with the TAN Gnomonic projection, an orthographic SIN projection *without rotation* is degenerate and therefore also valid for use
Angus H Wright ICRAR angus.wright@icrar.org
radec.to.xy, read.astrometry, measure.fluxes
#Load LAMBDAR
library(LAMBDAR)
#Load sample image
data(SDSS.sample)
#Load sample catalogue
data(ApCat.sample)
#Save sample image to File
write.fits(file="SampleImage.fits",SDSS.sample)
#Read Astrometry
astr<-read.astrometry("SampleImage.fits")
#Determine the pixel-locations of the aperture catalogue objects
xy<-ad.to.xy(ra=ApCat.sample$RAdeg,dec=ApCat.sample$DECdeg,astr.struc=astr)
#Print sample
print(head(xy))
#Show the positions on the image
#Plot the Image
image(x=1:length(SDSS.sample$dat[[1]][,1]),y=1:length(SDSS.sample$dat[[1]][1,]),z=SDSS.sample$dat[[1]],col=grey.colors(1E3),
zlim=quantile(SDSS.sample$dat[[1]],c(0,0.995)),useRaster=TRUE,xlab="X (pix)",ylab="Y (pix)")
#Overlay the points
points(xy,pch=3,col='red')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.