Home > lukes_code > trigPoint > lukesElevationAnalyser.m

lukesElevationAnalyser

PURPOSE ^

% Input

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Input
d = read_arcSouth('','')

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% Input
0002 %d = read_arcSouth('','')
0003 [d LL RR QQ UU] = cbassS2N( d );
0004 % Set x as the vector you want to de-modulate
0005 x = LL(:,78);
0006 
0007 %% Automatic i finder
0008 % Assume modulation of wavelength = imax
0009 % Assume 4 points on and the rest off or building up
0010 imax = 10;
0011 istart = 1;
0012 
0013 % Loop through i values
0014 while istart<imax
0015     i = istart;
0016     j = 1;
0017     while i<( length( x )-imax )
0018         y( j ) = x( i );
0019         y( j+1 ) = x( i+1 );
0020         y( j+2 ) = x( i+2 );
0021         y( j+3 ) = x( i+3 );
0022         i = i + imax;
0023         j = j + 4;
0024     end
0025     % Score this choice of i
0026     score( istart ) = sum( y );
0027     ival( istart ) = istart;
0028     istart = istart + 1;
0029 end
0030 % Pick the best i value
0031 [ maxScore,maxScoreIndex ] = max( score );
0032 ichoice = ival(maxScoreIndex)
0033 
0034 %% Use this i choice
0035 % z is the mean of 4 signal points - mean of four bg points
0036 i = ichoice;
0037 k = 1;
0038 while i<( length(x) - imax )
0039     z(k) = mean( [x(i) x(i+1) x(i+2) x(i+3)] ) - mean( [x(i+5) x(i+6) x(i+7) x(i+8)] );
0040     i = i + 10;
0041     k = k + 1;
0042 end
0043 figure
0044 plot( z )
0045 
0046 
0047 %% Use this i choice to get el
0048 % elz is the mean of 4 signal points - mean of four bg points
0049 i = ichoice;
0050 k = 1;
0051 x = d.antenna0.servo.apparent(:,2);
0052 while i<( length(x) - imax )
0053 elz(k) = mean([x(i) x(i+1) x(i+2) x(i+3)]);
0054     i = i + 10;
0055     k = k + 1;
0056 end
0057 plot( elz,'.' )
0058 
0059 figure
0060 plot( z((1+length(z))/2:length(z)), elz( (1+length(elz))/2:length(elz)))
0061 figure
0062 plot(z(1:(1+length(z))/2),elz(1:(1+length(elz))))
0063 
0064 
0065 %% Looking at the sun
0066 x = delscan.antenna0.roach1.LL(:,77);
0067 el = delscan.antenna0.servo.apparent(:,2);
0068 az = delscan.antenna0.servo.apparent(:,1);
0069 figure
0070 %plot( x( length(x)/2 : length(x)*3/4 ) , el( length(el)/2 : length(el)*3/4 ) )
0071 plot( el,x,'.' )
0072 
0073 figure
0074 plot(az)                                            
0075 hold all
0076 plot(el)
0077 hold all
0078 plot(x*1e-4)

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