Home > cbassSouthFunctions > ACTFunctions > interpRegistersSa_ACT.m

interpRegistersSa_ACT

PURPOSE ^

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

SYNOPSIS ^

function d = interpRegistersSa(d)

DESCRIPTION ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  function d = interpRegisterSa(d)

  only the cryocon and the az/el need to be interpolated
   Based off the interpRegister(d) for the Northern system
  Modified:
   21-May-2013 (CJC) -- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function d = interpRegistersSa(d)
0002 
0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0004 %  function d = interpRegisterSa(d)
0005 %
0006 %  only the cryocon and the az/el need to be interpolated
0007 %   Based off the interpRegister(d) for the Northern system
0008 %  Modified:
0009 %   21-May-2013 (CJC) --
0010 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0011 
0012 %First we find out if the servo/cryo data are required
0013 hasRx   = 0;
0014 hasCryo = 0;
0015 hasServo= 0;
0016 %display('interpRegisters');
0017 if(isfield(d, 'antenna0'))
0018   if(isfield(d.antenna0, 'servo'))
0019     if(isfield(d.antenna0.servo, 'fast_az_pos'))
0020       hasServo = 1;
0021     end
0022   end
0023   
0024   if(isfield(d.antenna0, 'thermal'))
0025     if(isfield(d.antenna0.thermal, 'ccTemperatureLoad'))
0026       hasCryo = 1;
0027     end
0028   end
0029   
0030   if(isfield(d.antenna0, 'roach1'))
0031     if(isfield(d.antenna0.roach1, 'utc'))
0032       hasRx = 1;
0033     end
0034   end
0035 end
0036 
0037 %display('interpRegisters1');
0038 hasAny = hasServo + hasRx + hasCryo;
0039 if(hasAny<2)
0040   %display('Nothing to inpterpolate')
0041   return;
0042 end
0043 
0044 if(~hasRx)
0045   display('Nothing to interpolate')
0046   return;
0047 end
0048 
0049 
0050 utcLength = length(d.antenna0.roach1.utc);
0051 
0052 %%the servo control timestamp is generated on the servo board and sent
0053 %%through to the PC while the thermal timestamp is generated on the PC-
0054 %i.e the position timestamps are different to the
0055 %%thermal timestamps- we need to get these aligned
0056 %First we find the point where they are within 0.1seconds of each other
0057 %Typically the servo data is about 1.05seconds behind the thermal data
0058 %24*60*60*(d.antenna0.servo.utc(1)-d.antenna0.thermal.utc(1)) =-1.05
0059 %24*60*60*(d.antenna0.servo.utc(6)-d.antenna0.thermal.utc(1))=-0.05
0060 matchedIndex=find(abs(24*60*60*(d.antenna0.thermal.utc(1)-d.antenna0.servo.utc))<0.1)
0061 
0062 servoAz=timeseries(d.antenna0.servo.fast_az_pos,d.antenna0.servo.utc); %timeseries of the azimuth
0063 servoEl=timeseries(d.antenna0.servo.fast_el_pos,d.antenna0.servo.utc); %timeseries of the elevation
0064 servoAzErr=timeseries(d.antenna0.servo.fast_az_err,d.antenna0.servo.utc); %timeseries of the azimuth error
0065 servoElErr=timeseries(d.antenna0.servo.fast_el_err,d.antenna0.servo.utc); %timeseries of the elevation error
0066 thermalCryo=timeseries(d.antenna0.thermal.ccTemperatureLoad,d.antenna0.thermal.utc); %timeseries of the crycon
0067 roachTime=d.antenna0.roach1.utc;
0068 
0069 
0070 servoAz=resample(servoAz,roachTime)
0071 servoAzErr=resample(servoAzErr,roachTime)
0072 servoEl=resample(servoEl,roachTime)
0073 servoElErr=resample(servoElErr,roachTime)
0074 thermalCryo=resample(thermalCryo,roachTime)
0075 
0076 d.antenna0.servo.az = servoAz.Data;
0077 d.antenna0.servo.el = servoEl.Data;
0078 d.antenna0.servo.azerr = servoAzErr.Data;
0079 d.antenna0.servo.elerr = servoElErr.Data;
0080 d.antenna0.servo.utcFast = servoAz.Time;
0081 d.antenna0.thermal.ccTemperatureLoadFast=thermalCryo.Data;
0082 d.antenna0.thermal.utcFast=thermalCryo.Time;
0083 
0084 
0085 
0086 return;

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