Home > matutils > angles > ra2ha.m

ra2ha

PURPOSE ^

SYNOPSIS ^

function ha = ra2ha(ra,time);

DESCRIPTION ^

Converts a source RA in degrees to the hour angle (in degrees)
relative to the local meridian.

HA = LST - RA

inputs:

ra = right ascension in degrees.
time = lst (frac hours)

outputs:

ha of source (s)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function ha = ra2ha(ra,time);
0002 %
0003 %Converts a source RA in degrees to the hour angle (in degrees)
0004 %relative to the local meridian.
0005 %
0006 %HA = LST - RA
0007 %
0008 %inputs:
0009 %
0010 %ra = right ascension in degrees.
0011 %time = lst (frac hours)
0012 %
0013 %outputs:
0014 %
0015 %ha of source (s)
0016 %
0017 %
0018 
0019 second = 1.0;
0020 minute = 60.0 * second;
0021 hour   = 60.0 * minute;
0022 day    = 24.0 * hour;
0023 
0024 ra1 = mod(ra, 360.0);
0025 
0026 if ra1 < 0
0027   ra1 = ra1 + 360.0;
0028 end
0029 
0030 timeDeg = time*15.0;
0031 ha = (timeDeg - ra1)/15.0;
0032

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