Home > matutils > angles > radec_to_fieldoff.m

radec_to_fieldoff

PURPOSE ^

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

SYNOPSIS ^

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

DESCRIPTION ^

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

 Make an orthographic (sin) projection of
 the spherical polar coordinates ra,dec
 into a field centered at racen,deccen.

 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 [x,y]=radec_to_fieldoff2(ra,dec,racen,deccen)
0002 % [x,y]=radec_to_fieldoff(ra,dec,racen,deccen)
0003 %
0004 % Make an orthographic (sin) projection of
0005 % the spherical polar coordinates ra,dec
0006 % into a field centered at racen,deccen.
0007 %
0008 % Input/output in degrees.
0009 %
0010 % These formula taken from an AIPS memo
0011 % ftp://fits.cv.nrao.edu/fits/documents/wcs/aips27.ps
0012 
0013 % Convert to rad
0014 a=ra*pi/180; d=dec*pi/180;
0015 a0=racen*pi/180; d0=deccen*pi/180;
0016 
0017 % Take deltas
0018 dela=a-a0;
0019 deld=d-d0;
0020 
0021 % Calc x,y
0022 x=cos(d).*sin(dela);
0023 y=sin(d).*cos(d0)-cos(d).*sin(d0).*cos(dela);
0024 
0025 % Go back to deg
0026 x=x*180/pi;
0027 y=y*180/pi;
0028 
0029 
0030

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