%%%%% Function to calculate RA and DEC at the current epoch for an existing CBASS d structure using the az and el at epoch as stored in df.antenna0.servo.apparent RA and DEC are stored in df.antenna0.servo.equa. In Radians. ACT - 11/8/2014 - adapted from existing code embedded in reduceData.m %%%%%%
0001 function df = calcRADECcurrent(df) 0002 0003 %%%%%% 0004 % 0005 % Function to calculate RA and DEC at the current epoch for an existing CBASS d structure 0006 % using the az and el at epoch as stored in df.antenna0.servo.apparent 0007 % 0008 % RA and DEC are stored in df.antenna0.servo.equa. In Radians. 0009 % 0010 % ACT - 11/8/2014 - adapted from existing code embedded in reduceData.m 0011 % 0012 %%%%%%% 0013 0014 disp('Getting Equatorial co-ordinates in current epoch'); 0015 % we do not need to calculate the ra/dec until we get ready to write things 0016 % out. 0017 display('Calculating RA/DEC for current epoch'); 0018 0019 % grab the telescope latitude and longitude 0020 long=df.antenna0.tracker.siteActual(2,1); 0021 lat =df.antenna0.tracker.siteActual(2,2); 0022 0023 az = df.antenna0.servo.apparent(:,1); 0024 el = df.antenna0.servo.apparent(:,2); 0025 jd=mjd2jd(df.antenna0.receiver.utc); 0026 [equa] = horiz_coo([pi/180*(az) pi/180*(el)],jd,[pi/180*(long) ... 0027 pi/180*(lat)],'e'); 0028 df.antenna0.servo.equa=equa; % Now have RA and DEC at the current epoch 0029 0030 % Make a note of what epoch you've made so that we can store this in the 0031 % .fits header 0032 0033 df.antenna0.servo.epoch = 'Current' 0034 0035 clear az; 0036 clear el; 0037 clear equa; 0038 0039 end