%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [az, el] = calcAzEl2(az,el,d) applies the corrections to the a set of az/el values (az,el inputs)in order to iteratively remove the poining corrections. Uses pointing/refraction data stored in the d data structure- charles copley-borrowed from SJCM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function [az, el] = calcAzEl2(az,el,d) 0002 0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0004 % 0005 % function [az, el] = calcAzEl2(az,el,d) 0006 % 0007 % applies the corrections to the a set of az/el values (az,el inputs)in order to 0008 % iteratively remove the poining corrections. Uses pointing/refraction 0009 % data stored in the d data structure- 0010 % 0011 % 0012 % charles copley-borrowed from SJCM 0013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0014 0015 % % 0016 utc = d.antenna0.roach1.utc; 0017 azVal = az; 0018 elVal = el; 0019 0020 % need to re-interpolate the utc for the refraction corrections. 0021 Avals = d.antenna0.tracker.refraction(:,1); 0022 Bvals = d.antenna0.tracker.refraction(:,2); 0023 A = interp1(d.array.frame.utc, Avals, utc); 0024 B = interp1(d.array.frame.utc, Bvals, utc); 0025 % apply refraction corrections 0026 Pvals = d.array.weather.pressure; 0027 Tvals = d.array.weather.airTemperature; 0028 P = interp1(d.array.frame.utc, Pvals, utc); 0029 T = interp1(d.array.frame.utc, Tvals, utc); 0030 0031 long=+27.6852; 0032 lat=-25.8897; 0033 el=1400.00; 0034 0035 % now we calculate the lst 0036 %jd = utc + 2400000.5; 0037 %jd0 = floor(utc) + 2400000.5; 0038 %H = 24*(jd - jd0); 0039 %D = jd - 2451545.0; 0040 %D0 = jd0 - 2451545.0; 0041 0042 % now we get the LST: 0043 %GMT = 6.697374558 + 0.06570982441908*D0 + 1.00273790935*H; 0044 %GMT = rem(GMT, 24); 0045 %eps = 23.4393 - 0.0000004*D; 0046 %L = 280.47 + 0.98565*D; 0047 %omega = 125.04 - 0.052954*D; 0048 %deltaPsi = -0.000319*sin(omega) - 0.000024*sin(2*L); 0049 %eqeq = deltaPsi.*cos(eps); 0050 %GAST = GMT + eqeq; 0051 %lst2 = GAST + long/15; 0052 %lst2(lst2<0) = lst2(lst2<0)+24; 0053 %lst = lst2*15; 0054 0055 lst = interp1(d.array.frame.utc, d.antenna0.tracker.lst, utc)*15; % in degrees 0056 0057 % now for hour angle: 0058 %ra = interp1(d.array.frame.utc, d.antenna0.tracker.equat_geoc(:,1), utc); 0059 %ra = ra*15; % in degrees 0060 %dec = interp1(d.array.frame.utc, d.antenna0.tracker.equat_geoc(:,2), utc); % in degrees 0061 %ha = lst - ra; % also in degrees 0062 % 0063 %% convert all to radians: 0064 %HA = ha*pi/180; 0065 %de = dec*pi/180; 0066 %La = lat*pi/180; 0067 % 0068 %[az, el] = hdl2ae(HA,de,La); 0069 %az=deg2rad(azVal); 0070 %el=deg2rad(elVal); 0071 0072 az = azVal*pi/180; 0073 el = elVal*pi/180; 0074 0075 % apply refraction correction. 0076 R = 0.00452.*P./( (273.15+T ).*tan(el))*pi/180; 0077 el = el+R; 0078 0079 az = az*180/pi; 0080 el = el*180/pi; 0081 az(az<0) = az(az<0)+360; 0082 % we need to add the online pointing model applied 0083 model = [d.antenna0.tracker.flexure(1,:), d.antenna0.tracker.tilts(1,:), ... 0084 d.antenna0.tracker.fixedCollimation(1,:), ... 0085 d.antenna0.tracker.encoder_off(1,:)]; 0086 0087 % apply the pointing model 0088 [az, el] = pointing_model(model, az, el); 0089 0090 %daz = azVal-az; 0091 %del= elVal-el; 0092 return;