Home > cbassSouthFunctions > ACTFunctions > HartRAO_Beam > plot_hartRaoHorn.m

plot_hartRaoHorn

PURPOSE ^

Script to make Figure 1 in the optics paper

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Script to make Figure 1 in the optics paper
 You need to run 2 times for the south and north receiver.
 Will plot co-polare and cros-polar plots for each

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Script to make Figure 1 in the optics paper
0002 % You need to run 2 times for the south and north receiver.
0003 % Will plot co-polare and cros-polar plots for each
0004 
0005 % Data from Christian is in the form
0006 % Line 1: Field data in cuts
0007 % Line 2: minTheta Theta_step n_points phi_angle 3 1 2
0008 clear;
0009 close all;
0010 % Number of frequencies and there defintion
0011 n_cuts = 3
0012 ifreqs = 1;
0013 freqs = {'4.5'};
0014 weights = ones(1,ifreqs);
0015 alpha = 1;
0016 freq = [4.5];
0017 weights = weights .*freq(1:ifreqs).^alpha;
0018 
0019 %path = '/Volumes/Data/CBASS/cbass_analysis_Jan2011/cbass_analysis/angela/cbass_MayJun2011/sim_beams/paper_figs/fig4/';
0020 path = './'
0021 % Now read in each frequecny file and get the relevant data
0022 for f=1:ifreqs
0023     freq(f)
0024    % use cut 1 col 1,2 for E-field
0025    % use cut 3 col 1,2 for H-fiels
0026    % use cut 2 col 3, for cross_pol
0027     simfile =([path,'horn_pattern_5.0GHz.cut']) % use
0028     
0029     % First set up the Theta Angles samples
0030 
0031 start_theta = dlmread(simfile,'',[1 0 1 0]); % degrees
0032 theta_step  = dlmread(simfile,'',[1 1 1 1]); % degrees
0033 no_steps    = dlmread(simfile,'',[1 2 1 2]); % degrees
0034 sim_angles  =  linspace(start_theta, (theta_step*no_steps)+start_theta, no_steps);
0035 
0036 
0037 % Now read in each phi cut
0038 
0039 for i=1:n_cuts
0040 phi_position  = [ (1 + (i-1)*(no_steps+2)) 3  (1 + (i-1)*(no_steps+2)) 3  ] ;
0041 data_start = 1+((1 + (i-1)*(no_steps+2))) ;
0042 data_stop = data_start + no_steps - 1;
0043 data_position = [data_start 0 data_stop 3];
0044 phi(i) = dlmread(simfile,'', phi_position); % degrees
0045 sim_data{i} = dlmread(simfile,'',data_position ); % 4 cols: co-polar (Re Im)  x-pol(Re Im)
0046 end
0047 
0048 
0049 % Do the co-polar and cross-polare cuts
0050 
0051 
0052     power_E{f} = ((sim_data{1}(:,1)).^2 + (sim_data{1}(:,2)).^2);
0053     power_H{f} = ((sim_data{3}(:,1)).^2 + (sim_data{3}(:,2)).^2);
0054     power_XP{f} = ((sim_data{2}(:,3)).^2 + (sim_data{2}(:,4)).^2);
0055 
0056 % Calulate powers for real and imaginary, then take average of ZP and P for
0057 % each frequency
0058 
0059 %power_CoP{f} = (cbass_real_zeroPhi{f}.^2 + cbass_imag_zeroPhi{f}.^2);
0060 %power_XP{f} = (cbass_real_zeroPhi{f}.^2 + cbass_imag_zeroPhi{f}.^2);
0061 
0062 % Plot the beams
0063 % Far-out beam 0--> 180 deg
0064 %figure
0065 %E-field
0066 plot(sim_angles, 10.*log10(power_E{f}./1.0),'b')
0067 hold on
0068 %H-field
0069 plot(sim_angles, 10.*log10(power_H{f}./1.0),'r')
0070 %Cross-Pol
0071 plot(sim_angles, 10.*log10(power_XP{f}./1.0),'g')
0072 xlim([-80 80])
0073 ylim([-50 20])
0074 xlabel('Degrees','Fontsize',24,'Fontname','Helvetica')
0075 ylabel('dBi','Fontsize',24,'Fontname','Helvetica')
0076 grid on
0077 end
0078 
0079 
0080

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