Home > comms > beammap.m

beammap

PURPOSE ^

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

SYNOPSIS ^

function beammap(d, elStepSizeDeg)

DESCRIPTION ^

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

  function beammap(d, elStepSizeDeg)

   function to analyze our beammap schedules


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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function beammap(d, elStepSizeDeg)
0002 
0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0004 %
0005 %  function beammap(d, elStepSizeDeg)
0006 %
0007 %   function to analyze our beammap schedules
0008 %
0009 %
0010 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0011 if(nargin>1)
0012 end
0013 
0014 
0015 % This function should.
0016 % 0a.  (NOT DONE - SJCM ON IT) flag the data for known hardware issues.
0017 % 0b. flag for rfi
0018 
0019 % 1. (NOT DONE) calibrate the data using the noise source (data with f10 set to high)
0020 %  methinks the best way to do this is to obtain an average power value for
0021 %  the 5second noise observation relative to the 5 seconds before and after
0022 %  the observation and set this as a gain value for a given time.  then do
0023 %  an interpolation over the whole track and correct the data.  does that
0024 %  make sense?
0025 %  this should be a separate function, as it will be used in other
0026 %  calibrations as well.
0027 
0028 [d_noise d_nonoise indNoise] = cutNoise(d);
0029 
0030 % 2. (NOT DONE) calibrate data with sky dips (f5 set to high)
0031   % not sure how to apply this -- but the data was taken.
0032 d_dip   = framecut(d_nonoise, bitsearch(d_nonoise.array.frame.features, 5, 'any'));
0033 
0034 % 3.  map data onto a grid (REST OF FUNCTION)
0035 indSrc  = bitsearch(d_nonoise.array.frame.features, 9, 'any');
0036 % interpolate it onto the size of data
0037 indSrc  = interp1(d_nonoise.array.frame.utc, indSrc, d_nonoise.antenna0.receiver.utc, 'nearest');
0038 indSrc(isnan(indSrc)) = 0;
0039 indSrc = logical(indSrc);
0040 %indSrc  = indSrc & ~indNoise;
0041 d_src   = framecut(d_nonoise, indSrc);
0042 
0043 [a, b, dataMap, dataRms, azGrid, elGrid] = sourceScanMap(d_src, elStepSizeDeg, 0);
0044 
0045 % 4.  Do whatever analysis we want.  At this point, we're just plotting it.
0046 figure(1)
0047 setwinsize(gcf, 575, 750);
0048 subplot(2,1,1)
0049 imagesc(azGrid, elGrid, -dataMap(:,:,1));
0050 colorbar('horizontal');
0051 xlabel('az offset');
0052 ylabel('el offset');
0053 title('Total Intensity 1');
0054 
0055 subplot(2,1,2)
0056 imagesc(azGrid, elGrid, -dataMap(:,:,6));
0057 colorbar('horizontal');
0058 xlabel('az offset');
0059 ylabel('el offset');
0060 title('Total Intensity 2');
0061 eval(sprintf('gtitle(''Raw Counts from Backend on %s'');', d_src.antenna0.tracker.source{1}));
0062 
0063 
0064 figure(2)
0065 setwinsize(gcf, 575, 750);
0066 subplot(2,1,1)
0067 a = dataMap(:,:,1)./min(min(dataMap(:,:,1)));
0068 imagesc(azGrid, elGrid, log10(a), [-0.5 0]);
0069 colorbar('horizontal');
0070 xlabel('az offset');
0071 ylabel('el offset');
0072 title('Total Intensity 1 (log plot)');
0073 
0074 subplot(2,1,2)
0075 a = dataMap(:,:,6)./min(min(dataMap(:,:,6)));
0076 imagesc(azGrid, elGrid, log10(a));
0077 colorbar('horizontal');
0078 xlabel('az offset');
0079 ylabel('el offset');
0080 title('Total Intensity 2 (log plot)');
0081 eval(sprintf('gtitle(''Raw Counts from Backend on %s (log plot)'');', d_src.antenna0.tracker.source{1}));
0082 
0083 
0084 keyboard;
0085 
0086 % now we have to draw a slice through it and map out the beam.
0087 [x1 y1] = find(-dataMap(:,:,1)==max(max(-dataMap(:,:,1))));
0088 [x6 y6] = find(-dataMap(:,:,6)==max(max(-dataMap(:,:,6))));
0089 
0090 
0091 midAz = median(x6);
0092 midEl = median(y6);
0093 
0094 azGrid2 = min(azGrid):0.05:max(azGrid);
0095 elGrid2 = min(elGrid):0.05:max(elGrid);
0096 d2 = interp2(azGrid', elGrid, -squeeze(dataMap(:,:,6))', azGrid2', elGrid2);
0097 
0098 [x y] = find(d2==max(d2(:)));
0099 
0100 
0101 elScanThroughMid = squeeze(d2(:,y));
0102 plot(elGrid2, elScanThroughMid);
0103 xlabel('Elevation angle');
0104 ylabel('Backend units');
0105 
0106 
0107 
0108 return;
0109 
0110

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