Home > Angelas_Raster_Code > RADEC_contour.m

RADEC_contour

PURPOSE ^

Make_RaDec_contour maps

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

Make_RaDec_contour maps

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %Make_RaDec_contour maps
0002 
0003 RADEC_contour(dgood_file)
0004 % %% End the function here - stuff below done elsewhere - only need _dgood%%
0005 % % % % %  %%
0006 % % % %  % Now make contour maps if you wish
0007 %  if (do_contour==1)
0008      n=0
0009      % Find start and end points of each raster
0010      [s e] = findStartStop(dgood.index.radio_point_scan.fast);
0011      
0012 %      %Identify the maximum of I,Q,U,V to use as a normalization for each raster
0013 %
0014 %      points = (dgood.index.radio_point_scan.fast==1 | dgood.index.beammap.fast==1);
0015 %
0016 %      contour_max(1) = max(dgood.antenna0.receiver.data(points,1));
0017 %      contour_max(2) = max(dgood.antenna0.receiver.data(points,2));
0018 %      contour_max(3) = max(dgood.antenna0.receiver.data(points,3));
0019 %      contour_max(4) = max(dgood.antenna0.receiver.data(points,4));
0020 %
0021      for m= 1:length(s)
0022          n = n+1;
0023          ind = zeros(size(dgood.index.radio_point_scan.fast));
0024          ind(s(m):e(m)) = 1;
0025          ind = logical(ind);
0026          dcut  = framecut(dgood, ind);
0027          azApp = interp1(dcut.antenna0.tracker.utc, ...
0028              dcut.antenna0.tracker.horiz_topo(:,1), dcut.antenna0.receiver.utc);
0029          azOffSave = azApp - dcut.antenna0.servo.apparent(:,1);
0030          azOffSave = -azOffSave;
0031          azOffSave = azOffSave.*cos(dcut.antenna0.servo.el*pi/180);% Scale azimuth by cos(elevation)???CHECK
0032          
0033          elApp = interp1(dcut.antenna0.tracker.utc, ...
0034              dcut.antenna0.tracker.horiz_topo(:,2), dcut.antenna0.receiver.utc);
0035          elOffSave = elApp - dcut.antenna0.servo.apparent(:,2);
0036          elOffSave = -elOffSave;
0037          angle = sqrt(elOffSave.^2 + azOffSave.^2);
0038          
0039          %Define a grid in degrees
0040          ti=-10:cell_size:10;
0041          
0042          % Make sure we ignore NaNs
0043          a = (isnan(azOffSave) | isnan(elOffSave));
0044          
0045          for (chan=1) % only plot the I channel data for speed
0046              
0047              % Grid the data
0048              [XI,YI]=meshgrid(ti,ti);
0049              ZI = griddata(azOffSave(~a),elOffSave(~a),dcut.antenna0.receiver.data(~a,chan),XI,YI);
0050              
0051              % Grab the maximum
0052              [num idx] = max(ZI(:));
0053              [nx ny] = ind2sub(size(ZI),idx);
0054              max_ZI(m,1) = ZI(nx,ny); % Max value
0055              max_ZI(m,2) = nx; % X-pos of max
0056              max_ZI(m,3) = ny; % Y-pos of max
0057              
0058              %Check if there are multiple maxima
0059              [num] = max(ZI(:));
0060              [nxs nys] = ind2sub(size(ZI),find(ZI==num));
0061              max_ZI(m,4) =length(nxs);
0062              
0063 %              %Fit a gaussian to each one if you want
0064 %              if(chan==1)
0065 %              if(fit_gauss)
0066 %                 [sf gof t] = gauss2D_fit_act(XI,YI,ZI);
0067 %                 gfit{m} = sf;
0068 %                 % If you want to plot the fit
0069 %                 %plot(gfit{5},[XI(:),YI(:)],GoodI_c(:))
0070 %                 clear sf gof t
0071 %              end
0072 %              end
0073              
0074              % Plot mini contour maps on 3x3 grid on each page
0075              fig_no = ceil(m/16);
0076              subplot_no = m-(fig_no-1)*16;
0077              
0078              %subplot(nfigs_x,nfigs_y,n);
0079              %Make contours based on the max_value in the data set for I,Q,U,V
0080              VI = [1:-0.1:0]*contour_max(chan);
0081              
0082              figure(fig_no+2);
0083              subplot(4,4,subplot_no)
0084              contour(XI,YI,ZI,VI);
0085              axis square;
0086              grid on;
0087              xlabel('Az Offset,deg');
0088              ylabel('El Offset,deg');
0089              title(num2str(m));
0090           
0091          end
0092      end
0093  
0094

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