Home > lukes_code > trigPoint > lukesTrigPoint.m

lukesTrigPoint

PURPOSE ^

21/2/2014 - ACT

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 21/2/2014 - ACT
 raster and large az and el tracks on the sun

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % 21/2/2014 - ACT
0002 % raster and large az and el tracks on the sun
0003 
0004 %d = read_arcSouth('21-Feb-2014:13:23:03 ','     21-Feb-2014:13:57:26 ')
0005 close all; clear;
0006 d = read_arcSouth('23-Feb-2014:13:20:20','23-Feb-2014:13:54:44')
0007 
0008 % Horn at 45 deg, 0dBm-30dB attenuation
0009 close all; clear;
0010 %d = read_arcSouth('23-Feb-2014:15:09','23-Feb-2014:15:30')
0011 d = read_arcSouth('23-Feb-2014:15:07:51','23-Feb-2014:15:24:02') 
0012 
0013 %Horn at 0deg, 0dbm-30dB attenuation
0014 close all;clear;
0015 d = read_arcSouth('23-Feb-2014:15:27','23-Feb-2014:15:40')
0016 
0017 %Horn at 0deg, 0dbm-60dB attenuation
0018 close all;clear;
0019 d = read_arcSouth('23-Feb-2014:16:05','23-Feb-2014:16:15')
0020 
0021 %Hord at 0deg, 0dbm-40dbm attenuation
0022 close all;clear;
0023 d = read_arcSouth('09-May-2014:14:45:56','09-May-2014:14:57:26')
0024 %d = read_arcSouth('09-May-2014:14:41:56','09-May-2014:14:57:26')
0025 
0026 %
0027 close all;clear;
0028 d = read_arcSouth('10-May-2014: ','10-May-2014:  ')
0029 
0030 %
0031 close all; clear;
0032 d = read_arcSouth('10-May-2014:09:28:32','10-May-2014:09:44:02')
0033 
0034 % Below are at 0dbm - 60db, osc freq of 10Hz, centre freq of 5.104GHz
0035 % 0deg
0036 close all; clear;
0037 d = read_arcSouth( '10-May-2014:09:28:32','10-May-2014:09:44:02' )
0038 % +45deg
0039 close all; clear;
0040 d = read_arcSouth( '10-May-2014:09:56:44','10-May-2014:10:12:14' )
0041 % +90deg
0042 close all; clear;
0043 d = read_arcSouth( '10-May-2014:10:15:04','10-May-2014:10:30:34' )
0044 % -45deg
0045 close all; clear;
0046 d = read_arcSouth( '10-May-2014:10:34:45      10-May-2014:10:50:15' ) 
0047 
0048 
0049 %
0050 10-May-2014:11:49:57      10-May-2014:12:02:13      /home/cbassuser/cbass/gcpCbass/control/sch/Large_ElScan.sch( trigpoint )
0051 10-May-2014:12:04:16      10-May-2014:12:10:36      /home/cbassuser/cbass/gcpCbass/control/sch/Large_ElScan.sch( trigpoint )
0052 
0053 %% Look at the time ordered data
0054 figure
0055 suptitle( 'Time ordered data' )
0056 ax(1)=subplot(211)
0057 plot(d.antenna0.roach2.LL)
0058 ylabel('roach2.LL')
0059 ax(2)=subplot(212)
0060 plot(d.antenna0.roach2.RR)
0061 ylabel('roach2.RR')
0062 linkaxes(ax,'x')
0063 
0064 figure
0065 suptitle( 'Time ordered data' )
0066 ax(1)=subplot(211)
0067 plot(d.antenna0.roach2.Q)
0068 ylabel('roach2.Q')
0069 ax(2)=subplot(212)
0070 plot(d.antenna0.roach2.U)
0071 ylabel('roach2.U')
0072 linkaxes(ax,'x')
0073 
0074 
0075 %% Bits and bobs
0076 figure; plot( [d.antenna0.roach1.LL(6176,:) ( d.antenna0.roach2.LL(6176,:) )] )
0077 
0078 %% Put data into Cbass-N style
0079 disp( 'Puttiing data into CBASS-N style' )
0080 chan=78;
0081 nchan=4;
0082 plot_labels = {'LL','RR','QQ','UU'};
0083 d = cbassS2N(d,chan);
0084 % cbassS2N spits out d.data(:,1) = LL ; 6 = RR ; 2 = QQ ; 3 = UU
0085 LL_index = 1;
0086 RR_index = 6;
0087 QQ_index = 2;
0088 UU_index = 3;
0089  
0090 %% Calculate the az and El offset form the source
0091 disp( 'Calculating az and el offsets from the source' )
0092 
0093 az_trig=16
0094 el_trig=6.5
0095 
0096 d.azOffSave = (d.antenna0.servo.apparent(:,1)-az_trig).*cosd(d.antenna0.servo.apparent(:,2));
0097 d.elOffSave = d.antenna0.servo.apparent(:,2)-el_trig;
0098 d.angle = sqrt(d.elOffSave.^2 + d.azOffSave.^2);
0099 
0100 %% Separate data in to raster, elscan and azscan
0101 disp( 'Separating data into raster, elscan and azscan' )
0102 draster = framecut(d,d.index.beammap.fast);
0103 dazscan = framecut(d,d.index.radio_point_scan.fast);
0104 delscan = framecut(d,d.index.elscan.fast); 
0105  
0106 %% Prepare to analyse the raster
0107 % NaN Flagging
0108 disp( 'Flagging NaNs' )
0109 nanflag = isnan(draster.antenna0.receiver.data(:,1));
0110 flag = ~nanflag;
0111 
0112 % Demodulate the relevant parameters
0113 disp( 'Demodulating the data' )
0114 
0115 ichoice1 = demodStartIndexFinder( draster.antenna0.receiver.data(flag,LL_index) );
0116 ichoice2 = demodStartIndexFinder( draster.antenna0.receiver.data(flag,RR_index) );
0117 ichoice3 = demodStartIndexFinder( draster.antenna0.receiver.data(flag,QQ_index) );
0118 ichoice4 = demodStartIndexFinder( draster.antenna0.receiver.data(flag,UU_index) );
0119 %ichoice = round( mean( [ichoice1 ichoice2 ichoice3 ichoice4] ) );
0120 ichoice = round( mean( [ichoice1 ichoice2 ] ) );
0121 %ichoice=6
0122 LL_demod = demodBG( ichoice, draster.antenna0.receiver.data(flag,LL_index) );
0123 RR_demod = demodBG( ichoice, draster.antenna0.receiver.data(flag,RR_index) );
0124 QQ_demod = demodBG( ichoice, draster.antenna0.receiver.data(flag,QQ_index) );
0125 UU_demod = demodBG( ichoice, draster.antenna0.receiver.data(flag,UU_index) );
0126 dataRaster_demod = [ LL_demod', RR_demod', QQ_demod', UU_demod' ];
0127 
0128 azOffRaster_demod = demodNoBG( ichoice, draster.azOffSave(flag) );
0129 elOffRaster_demod = demodNoBG( ichoice, draster.elOffSave(flag) );
0130 
0131 
0132 %% Plot the raster
0133 disp( 'Plotting the raster' )
0134 pixel_size = 0.1; % degree
0135 
0136 azmin = min(azOffRaster_demod);
0137 azmax = max(azOffRaster_demod);
0138 elmin = min(elOffRaster_demod);
0139 elmax = max(elOffRaster_demod);
0140 colmin = 0
0141 colmax = 1e5
0142     
0143 for i=1:4
0144     [TauAmap{i}, xidx, yidx, TauAmapIdx{i}] = bin_quickly2d(azmin, azmax, elmin, elmax, pixel_size,...
0145         azOffRaster_demod, elOffRaster_demod,dataRaster_demod(:,i));
0146     
0147     % Raster Maps
0148     figure(3)
0149     subplot(4,1,i)
0150     clim=[colmin colmax]
0151     imagesc(fliplr(xidx),fliplr(yidx),TauAmap{i},clim)
0152     colormap('default')
0153     title(plot_labels{i})
0154     axis equal
0155     ylim( [elmin elmax] )
0156     xlim( [azmin azmax] )
0157     colorbar
0158     
0159     %Contour Plots
0160     figure(4)
0161     subplot(4,1,i)
0162     contour(fliplr(xidx),yidx,TauAmap{i})
0163     title(plot_labels{i})
0164     axis equal
0165     ylim( [elmin elmax] )
0166     xlim( [azmin azmax] )
0167 end
0168 
0169 %% Look at cuts through the raster maps
0170 disp( 'Look at cuts through the beam' )
0171 % Get the user to select the centre of the beam pattern
0172 figure(5)
0173 clim = [0 1e5]
0174 colormap('default')
0175 imagesc(TauAmap{1},clim)
0176 title('Please click on the centre of the LL beam pattern')
0177 [usr_TrigAz1 usr_TrigEl1] = ginput(1);
0178 figure(5)
0179 imagesc(TauAmap{2},clim)
0180 title('Please click on the centre of the RR beam pattern')
0181 [usr_TrigAz2 usr_TrigEl2] = ginput(1);
0182 figure(5)
0183 imagesc(TauAmap{3},clim)
0184 title('Please click on the centre of the QQ beam pattern')
0185 [usr_TrigAz3 usr_TrigEl3] = ginput(1);
0186 figure(5)
0187 imagesc(TauAmap{4},clim)
0188 title('Please click on the centre of the UU beam pattern')
0189 [usr_TrigAz4 usr_TrigEl4] = ginput(1);
0190 
0191 usr_TrigAz = mean( [usr_TrigAz1 usr_TrigAz2 usr_TrigAz3 usr_TrigAz4] );
0192 usr_TrigEl = mean( [usr_TrigEl1 usr_TrigEl2 usr_TrigEl3 usr_TrigEl4] );
0193 
0194 usr_TrigAz = round( usr_TrigAz );
0195 usr_TrigEl = round( usr_TrigEl );
0196 
0197 % Plot the two cuts through the beam
0198 figure(5)
0199 subplot(2,4,1)
0200 plot(10*log(TauAmap{1}(usr_TrigEl,:)))
0201 ylabel( 'LL' )
0202 xlabel( 'Azimuth' )
0203 subplot(2,4,5)
0204 plot(10*log(TauAmap{1}(:,usr_TrigAz)))
0205 ylabel( 'LL' )
0206 xlabel( 'Elevation' )
0207 
0208 
0209 subplot(2,4,2)
0210 plot(TauAmap{2}(usr_TrigEl,:))
0211 ylabel( 'RR' )
0212 xlabel( 'Azimuth' )
0213 subplot(2,4,6)
0214 plot(TauAmap{2}(:,usr_TrigAz))
0215 ylabel( 'RR' )
0216 xlabel( 'Elevation' )
0217 
0218 subplot(2,4,3)
0219 plot(TauAmap{3}(usr_TrigEl,:))
0220 ylabel( 'QQ' )
0221 xlabel( 'Azimuth' )
0222 subplot(2,4,7)
0223 plot(TauAmap{3}(:,usr_TrigAz))
0224 ylabel( 'QQ' )
0225 xlabel( 'Elevation' )
0226 
0227 subplot(2,4,4)
0228 plot(TauAmap{4}(usr_TrigEl,:))
0229 ylabel( 'UU' )
0230 xlabel( 'Azimuth' )
0231 subplot(2,4,8)
0232 plot(TauAmap{4}(:,usr_TrigAz))
0233 ylabel( 'UU' )
0234 xlabel( 'Elevation' )
0235 
0236 %% Plot the EL scan
0237 disp( 'Plotting the EL scan' )
0238 
0239 if (length(delscan.antenna0.receiver.data(:,LL_index))>10)
0240     % Demodulate el scan data
0241     LL_demod = demodBG( ichoice, delscan.antenna0.receiver.data(:,LL_index) );
0242     RR_demod = demodBG( ichoice, delscan.antenna0.receiver.data(:,RR_index) );
0243     QQ_demod = demodBG( ichoice, delscan.antenna0.receiver.data(:,QQ_index) );
0244     UU_demod = demodBG( ichoice, delscan.antenna0.receiver.data(:,UU_index) );
0245     dataElScan_demod = [ LL_demod', RR_demod', QQ_demod', UU_demod' ];
0246     
0247     azOffElScan_demod = demodNoBG( ichoice, delscan.antenna0.servo.az );
0248     elOffElScan_demod = demodNoBG( ichoice, delscan.antenna0.servo.el );
0249     
0250     % Plot the data
0251     figure
0252     h(1)=subplot(3,1,1);
0253     plot(azOffElScan_demod)
0254     title('Az')
0255     h(2)=subplot(3,1,2);
0256     plot(elOffElScan_demod)
0257     title('El')
0258     h(3)=subplot(3,1,3);
0259     plot(dataElScan_demod(:,1))
0260     title('LL')
0261     grid on
0262     linkaxes(h,'x')
0263     
0264     figure
0265     h(1)=subplot(4,1,1);
0266     plot(dataElScan_demod(:,1))
0267     title('LL')
0268     grid on
0269     h(2)=subplot(4,1,2);
0270     plot(dataElScan_demod(:,2))
0271     title('RR')
0272     grid on
0273     h(3)=subplot(4,1,3);
0274     plot(dataElScan_demod(:,3))
0275     title('QQ')
0276     grid on
0277     h(4)=subplot(4,1,4);
0278     plot(dataElScan_demod(:,4))
0279     title('UU')
0280     grid on
0281     linkaxes(h,'x')
0282 else
0283     disp( 'No Elevation Scan Data' )
0284 end
0285 
0286 %% Look at the EL scan in more detail
0287 disp( 'Looking at EL scan in more detail' )
0288 if (length(delscan.antenna0.receiver.data(:,1))>10)
0289     angleElScan_demod = demodNoBG( ichoice, delscan.angle);
0290     disp( 'Please click on each corner in the plot, including start and end' )
0291     figure
0292     plot( angleElScan_demod,'.' )
0293     title( 'Please click on each corner in this plot' )
0294     [cutx cuty] = ginput(8);
0295     cutx = round(cutx)
0296     cuty = round(cuty)
0297     for i=(1:nchan)
0298         figure
0299         suptitle( plot_labels(i) )
0300         h(1) = subplot(2,1,1);
0301         plot( angleElScan_demod(cutx(1):cutx(2)), dataElScan_demod(cutx(1):cutx(2),i), '.-' )
0302         hold
0303         plot( angleElScan_demod(cutx(7):cutx(8)), dataElScan_demod(cutx(7):cutx(8),i), '.-' )
0304         h(2) = subplot(2,1,2);
0305         plot( angleElScan_demod(cutx(3):cutx(4)), dataElScan_demod(cutx(3):cutx(4),i), '.-' )
0306         hold
0307         plot( angleElScan_demod(cutx(5):cutx(6)), dataElScan_demod(cutx(5):cutx(6),i), '.-' )
0308         xlabel('Angle')
0309         linkaxes(h,'xy')
0310     end
0311 else
0312     disp( 'No Elevation Scan Data' )
0313 end

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