Home > pointing > calcRADECJ2000.m

calcRADECJ2000

PURPOSE ^

%%%%%

SYNOPSIS ^

function df = calcRADECJ2000(df)

DESCRIPTION ^

%%%%%
 
 Function to calculate RA and DEC in J2000 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

%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function df = calcRADECJ2000(df)
0002 
0003 %%%%%%
0004 %
0005 % Function to calculate RA and DEC in J2000 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 J2000');
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 J2000');
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;
0029   
0030   % Precess to be J2000
0031    yearoff = (mean(df.array.frame.utc) - date2mjd(2000, 01, ...
0032      01,0,0,0))/365.25;
0033    yearoff = round( (2000+yearoff)*10)/10;
0034    txt = sprintf('[equa2000] = coco(df.antenna0.servo.equa, ''j%4.1f'', ''j2000.0'', ''r'', ''r'');', yearoff);
0035    eval(txt);
0036    df.antenna0.servo.equa=equa2000;  % Now have RA and DEC in radians in J2000
0037    
0038    % Make a note of what epoch you've made so that we can store this in the
0039    % .fits header
0040   
0041   df.antenna0.servo.epoch = 'J2000'
0042    
0043   clear az;   
0044   clear el;
0045   clear equa;
0046   clear equa2000;
0047 end

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