Home > reduc > pipe_read.m

pipe_read

PURPOSE ^

define the antenna being used

SYNOPSIS ^

function d = pipe_read(start, stop, d)

DESCRIPTION ^

define the antenna being used

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function d = pipe_read(start, stop, d)
0002 
0003 %define the antenna being used
0004 antenna='ovro';
0005 
0006 % reads, sets up all registers, etc etc
0007 if(nargin<3)
0008   d = read_arc(start, stop);
0009 end
0010 display('pipe_read:: Finished with read_arc');
0011 % do the rudimentary flagging
0012 d = flagMask(d);
0013 %d = flagData(d, [0 1 5 6 7 8 10 12], []);
0014 d = flagData(d, [0 6 7 8 10 11], []);
0015 % NOTE: RFI flagging occurss in deglitch module
0016 d = determineIndices(d);
0017 d = fillRegisters(d);
0018 
0019 % calculate the apparent az/el right off the bat;
0020 display('pipe_read:: Calculating apparent Azimuth and Elevation');
0021 d = apparentAzEl(d);
0022 
0023 %Added by CJC 3/5/2010 to update the structure with the RA/DEC- stored in
0024 %d.antenna0.servo.equa
0025 %d.antenna0.servo.equa(:,1) -> RA (in radians)
0026 %d.antenna0.servo.equa(:,2) - >DEC (in radians)
0027 display('pipe_read:: Calculating RA/DEC Values')
0028 if strcmp(antenna,'ovro')
0029     long=-118.2822;
0030     lat=37.2339;
0031 end
0032 
0033 az = d.antenna0.servo.apparent(:,1);
0034 el = d.antenna0.servo.apparent(:,2);
0035 jd=mjd2jd(d.antenna0.receiver.utc);
0036 %%%%%%%%%%%%%%%%%%%%%%%%
0037 % ogk edit here: removed call to deg2rad: needs special toolbox
0038 %[equa] = horiz_coo([deg2rad(az) deg2rad(el)],jd,[deg2rad(long) deg2rad(lat)],'e');
0039 [equa] = horiz_coo([pi/180*(az) pi/180*(el)],jd,[pi/180*(long) pi/180*(lat)],'e');
0040 d.antenna0.servo.equa=equa;
0041 [galactic,to]=coco(d.antenna0.servo.equa,'j2000.0','g','r','r');
0042 display('pipe_read:: Calculating Galactic Long/Lat')
0043 d.antenna0.servo.galactic=galactic;
0044 %%%%%%%%%%%%%%%%%%%%%%%%
0045 
0046 return;

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