Home > matutils > angles > fieldoff_to_radec.m

fieldoff_to_radec

PURPOSE ^

[ra,dec]=fieldoff_to_radec(x,y,racen,deccen)

SYNOPSIS ^

function [ra,dec]=fieldoff_to_radec(x,y,racen,deccen)

DESCRIPTION ^

 [ra,dec]=fieldoff_to_radec(x,y,racen,deccen)

 Assuming x,y are points in an orthographic (sin)
 projection field centered at racen,deccen, de-project
 to find the corresponding spherical polar coordinates
 ra,dec.

 Input/output in degrees.

 These formula taken from an AIPS memo
 ftp://fits.cv.nrao.edu/fits/documents/wcs/aips27.ps

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ra,dec]=fieldoff_to_radec(x,y,racen,deccen)
0002 % [ra,dec]=fieldoff_to_radec(x,y,racen,deccen)
0003 %
0004 % Assuming x,y are points in an orthographic (sin)
0005 % projection field centered at racen,deccen, de-project
0006 % to find the corresponding spherical polar coordinates
0007 % ra,dec.
0008 %
0009 % Input/output in degrees.
0010 %
0011 % These formula taken from an AIPS memo
0012 % ftp://fits.cv.nrao.edu/fits/documents/wcs/aips27.ps
0013 
0014 % Convert to rad
0015 x=x*pi/180; y=y*pi/180;
0016 a0=racen*pi/180; d0=deccen*pi/180;
0017 
0018 z=sqrt(1-x.^2-y.^2);
0019 
0020 d=asin(z.*sin(d0)+y.*cos(d0));
0021 a=a0+atan2(x,z.*cos(d0)-y.*sin(d0));
0022 
0023 % Go back to deg
0024 ra=a*180/pi;
0025 dec=d*180/pi;

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005