Home > lukes_code > southColdLoad > lukesSouthColdLoadTest.m

lukesSouthColdLoadTest

PURPOSE ^

% Dates

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Dates

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% Dates
0002 date = {...
0003     %'15-Dec-2013:20:28:43' '15-Dec-2013:22:16:47';...
0004     %'19-Dec-2013:22:12:48' '20-Dec-2013:00:00:53';...
0005     '15-Jan-2014:21:02:44' '15-Jan-2014:22:50:49';...
0006     '21-Jan-2014:14:43:38' '21-Jan-2014:16:31:43';...
0007     '26-Jan-2014:22:23:01' '26-Jan-2014:22:57:37';...
0008     '28-Jan-2014:01:30:24' '28-Jan-2014:03:18:28';...
0009     '29-Jan-2014:13:26:14' '29-Jan-2014:15:14:18';...
0010     '16-Feb-2014:17:31:19' '16-Feb-2014:19:19:23';...
0011     '17-Feb-2014:14:08:07' '17-Feb-2014:15:56:11';...
0012     '18-Feb-2014:02:36:21' '18-Feb-2014:04:24:25';...
0013     '19-Feb-2014:03:20:54' '19-Feb-2014:05:08:58';...
0014     '25-Feb-2014:23:55:20' '26-Feb-2014:01:43:25';...
0015     '27-Feb-2014:10:19:27' '27-Feb-2014:12:07:32';...
0016     '01-Mar-2014:16:15:14' '01-Mar-2014:18:03:18';...
0017     '02-Mar-2014:20:48:11' '02-Mar-2014:22:36:16';...
0018     '04-Mar-2014:02:03:56' '04-Mar-2014:03:52:00';...
0019     %'04-Mar-2014:20:00:53' '04-Mar-2014:21:48:57';...
0020     %'05-Mar-2014:02:38:14' '05-Mar-2014:04:26:18';...
0021     %'06-Mar-2014:23:34:09' '07-Mar-2014:01:22:14';...
0022     %'07-Mar-2014:17:12:33' '07-Mar-2014:19:00:37';...
0023     %'07-Mar-2014:23:30:52' '08-Mar-2014:01:18:56';...
0024     %'08-Mar-2014:19:46:23' '08-Mar-2014:21:34:27';...
0025     %'09-Mar-2014:13:43:20' '09-Mar-2014:15:31:24';...
0026     %'09-Mar-2014:20:20:40' '09-Mar-2014:22:08:44';...
0027     }
0028 
0029 
0030 %% Cold Load Step Balance
0031 % Get params we want
0032 i=1;
0033 %imax = length( date(:,1) );
0034 imax = length( start_string );
0035 nchan = 128;
0036 while i<imax+1
0037     % Read in the data
0038     a = char( [start_string(i),end_string(i)] )
0039     %a = char( [date(i,1),date(i,2)] )
0040     d = read_arcSouthColdLoad( a(1,:),a(2,:) )
0041     
0042     LL = [ d.antenna0.roach1.LL fliplr(d.antenna0.roach2.LL) ];
0043     RR = [ d.antenna0.roach1.RR fliplr(d.antenna0.roach2.RR) ];
0044     load1 = [ d.antenna0.roach1.load1 fliplr(d.antenna0.roach2.load1) ];
0045     load2 = [ d.antenna0.roach1.load2 fliplr(d.antenna0.roach2.load2) ];
0046     loadT = d.antenna0.thermal.ccTemperatureLoadFast;
0047     
0048     indMax = length( loadT );
0049     
0050     % LL - Fit a straight line to the data
0051     x = [ 1:1:length(LL(:,1)) ]';
0052     chan = 1;
0053     while chan<(nchan-1)
0054         difference = LL(:,chan)-load2(:,chan);
0055         p = polyfit( x,difference,1 );
0056         ind = -p(2)/p(1);
0057         ind = round( ind );
0058         if ind<indMax & ind>0
0059             tempL(chan) = loadT(ind);
0060         else
0061             tempL(chan) = NaN;
0062         end
0063         chan = chan+1;
0064     end
0065     
0066     % RR - Fit a straight line to the data
0067     x = [ 1:1:length(RR(:,1)) ]';
0068     chan = 1;
0069     while chan<(nchan-1)
0070         difference = RR(:,chan)-load1(:,chan);
0071         p = polyfit( x,difference,1 );
0072         ind = -p(2)/p(1);
0073         ind = round( ind );
0074         if ind<indMax & ind>0
0075             tempR(chan) = loadT(ind);
0076         else
0077             tempR(chan) = NaN;
0078         end
0079         chan = chan+1;
0080     end
0081    
0082     % TtempL/R how they change with mjd
0083     TtempL(i,:) = tempL;
0084     TtempR(i,:) = tempR;
0085     mjd(i) = tstr2mjd( a(1,:) );
0086     i=i+1
0087 end
0088 %% Plot the data
0089 TtempL(TtempL==0)=NaN;
0090 TtempR(TtempR==0)=NaN;
0091 [year1 month1 day1] = mjd2date(mjd);
0092 dateno = datenum( year1, month1, day1 );
0093 
0094 chpl = [1:1:126];
0095 figure
0096 subplot(1,2,1)
0097 surf(chpl, dateno, TtempL)
0098 xlabel( 'Channel No' )
0099 ylabel( 'Date' )
0100 zlabel( 'Temp' )
0101 title( 'LL and Load 2 Balance' )
0102 xlim( [0 128] )
0103 colorbar
0104 view(2)
0105 datetick('y',29)
0106 
0107 subplot(1,2,2)
0108 surf(chpl, dateno, TtempR)
0109 xlabel( 'Channel No' )
0110 ylabel( 'Date' )
0111 zlabel( 'Temp' )
0112 title( 'RR and Load 1 Balance' )
0113 xlim( [0 128] )
0114 colorbar
0115 view(2)
0116 datetick('y',29)
0117 
0118 
0119 %% Plot just one thing
0120 figure
0121 plot( tempL,'o-k' )
0122 xlabel( 'Channel Number' )
0123 ylabel( 'Temperature (K)' )
0124 title( ['LL Cold Load Step Balance Temp   ' startDate] )
0125 xlim( [0 126] )
0126 
0127 figure
0128 plot( tempR,'o-k' )
0129 xlabel( 'Channel Number' )
0130 ylabel( 'Temperature (K)' )
0131 title( ['RR Cold Load Step Balance Temp   ' startDate] )
0132 xlim( [0 126] )
0133 
0134 %% Channel 90 doing anything odd?
0135 oddChan = 90
0136 figure
0137 plot( LL(:,oddChan),'k' )
0138 hold
0139 plot( load2(:,oddChan),'r' )
0140 title( ['LL and load2 for chan ' num2str(oddChan) '   ' startDate] )
0141 
0142 figure
0143 plot( RR(:,oddChan),'k' )
0144 hold
0145 plot( load1(:,oddChan),'r' )
0146 title( ['RR and load1 for chan ' num2str(oddChan) '   ' startDate] )

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