Home > pointing > applyDiurnalAberration.m

applyDiurnalAberration

PURPOSE ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

SYNOPSIS ^

function [az, el] = applyDiurnalAberration(az, el)

DESCRIPTION ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  function [az, el] = applyDiurnalAberration(az, el)


  name is pretty self-explanatory

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [az, el] = applyDiurnalAberration(az, el)
0002 
0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0004 %
0005 %  function [az, el] = applyDiurnalAberration(az, el)
0006 %
0007 %
0008 %  name is pretty self-explanatory
0009 %
0010 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0011 
0012 
0013 tiny = 1e-7;
0014 
0015 theta = acos(cos(el).*sin(az));
0016 
0017 % If the source is along the direction of the tangential velocity
0018 %  vector then the azimuth and elevation are unaffected.
0019 if(abs(theta)<tiny)
0020   return;
0021 end
0022 
0023 x = -cos(el).*cos(az);
0024 if(x~=0 | sin(el) ~= 0)
0025   psi = atan2(x, sin(el));
0026 else
0027   psi = 0;
0028 end
0029 
0030 % The aberration causes the source to appear to shift towards
0031 % the direction of the site's velocity. Since the tangential
0032 % velocity of the Earth is directed along the y axis, this
0033 % results in a reduction of theta.
0034     
0035 theta -= actual_.velocity/cvel.*sin(theta);
0036 
0037 % Compute the modified azimuth and elevation.
0038 el = asin(sin(theta).*cos(psi));
0039 
0040 % Compute the new azimuth, unless pointing at the zenith. The
0041 % azimuth is irrelevant at the zenith.
0042 if(cos(theta) ~= 0 | (sin(theta).*sin(psi))~= 0)
0043   az = atan2(cos(theta), -sin(theta).*sin(psi));
0044 else
0045   az = 0;
0046 end
0047 
0048 return;
0049

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