Home > sim_beams > plot_cbass_beam_profiles.m

plot_cbass_beam_profiles

PURPOSE ^

Script to plot cbass co-pol and x-pol beams

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Script to plot cbass co-pol and x-pol beams
 Data from Christian is in the form:
 Line 1: Field data in cuts
 Line 2: minTheta Theta_step n_points phi_angle 3 1 2

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Script to plot cbass co-pol and x-pol beams
0002 % Data from Christian is in the form:
0003 % Line 1: Field data in cuts
0004 % Line 2: minTheta Theta_step n_points phi_angle 3 1 2
0005 
0006 % Number of frequencies and there defintion
0007 n_cuts = 19;
0008 ifreqs = 1;
0009 freqs = {'4.5'};
0010 weights = ones(1,ifreqs); %
0011 alpha = 1;
0012 freq = [4.5];
0013 weights = weights .*freq(1:ifreqs).^alpha;
0014 
0015 %path = '/Volumes/Data/CBASS/cbass_analysis_Jan2011/cbass_analysis/angela/cbass_MayJun2011/sim_beams/paper_figs/';
0016 %path = '/Volumes/Data2/cbass_lion/majoc-osx/cbass_analysis/angela_cbass/angela_beam/sim_beams/paper_figs/fig6/'
0017 %temppath = '/angela_cbass/angela_beam/sim_beams/paper_figs/fig6/'
0018 temppath = '/sim_beams/';
0019 
0020 [home,installeddir] = where_am_i();
0021 polpath= [home,'/',installeddir,'/',temppath];
0022 
0023 % Now read in each frequecny file and get the relevant data
0024 for f=1:ifreqs
0025     freq(f)
0026     % Figure 6 - uses these three files combine cuts 1 and 9
0027     %simfile =([path',with cryo cone sec tunnel absorb subrefl no hole 19cuts lin pol 85dB 4.5GHz.cut']);
0028     simfile =([polpath,'with cryo cone prim and sec tunnel absorb subrefl no hole 19cuts lin pol 85dB incl primary2_4.5GHz.cut']);     
0029     %simfile =([path,'with cryo cone absorb subrefl no hole 19cuts lin pol 85dB 4.5GHz.cut'])
0030 
0031 % First set up the Theta Angles samples
0032 
0033 start_theta = dlmread(simfile,'',[1 0 1 0]); % degrees
0034 theta_step  = dlmread(simfile,'',[1 1 1 1]); % degrees
0035 no_steps    = dlmread(simfile,'',[1 2 1 2]); % degrees
0036 sim_angles  =  linspace(start_theta, -1*start_theta, no_steps);
0037 
0038 
0039 % Now read in each phi cut
0040 
0041 for i=1:n_cuts
0042 phi_position  = [ (1 + (i-1)*(no_steps+2)) 3  (1 + (i-1)*(no_steps+2)) 3  ] ;
0043 data_start = 1+((1 + (i-1)*(no_steps+2))) ;
0044 data_stop = data_start + no_steps - 1;
0045 data_position = [data_start 0 data_stop 3];
0046 phi(i) = dlmread(simfile,'', phi_position); % degrees
0047 sim_data{i} = dlmread(simfile,'',data_position ); % 4 cols: co-polar (Re Im)  x-pol(Re Im)
0048 end
0049 
0050 % For the beam patterns we want to combine data from the 0deg and 90deg phi
0051 % cuts
0052 % Take mean of :
0053 %     zeroPhi_coPol = (Re^2 + Im^2)
0054 %     90Phi_coPol   = (Re^2 + Im^2)
0055 %
0056 % To get what CBASS measures:  0.5*(Ex^2 + Ey^2)
0057 
0058 zeroPhi = find(phi == 0);
0059 Phi90 = find(phi == 90);
0060 
0061 cbass_real_zeroPhi{f} = sim_data{zeroPhi}(:,1);
0062 cbass_imag_zeroPhi{f} = sim_data{zeroPhi}(:,2);
0063 cbass_real_Phi90{f}   = sim_data{Phi90}(:,1);
0064 cbass_imag_Phi90{f}   = sim_data{Phi90}(:,2);
0065 
0066 % For the x-pol beam patterns we just want data from the 45deg cut
0067 % Take  :
0068 %
0069 %     45Phi_xPol   = (Re^2 + Im^2)
0070 %
0071 
0072 Phi45 = find(phi == 45);
0073 
0074 cbass_real_Phi45{f}   = sim_data{Phi45}(:,3); % second pair of columns is the xpol
0075 cbass_imag_Phi45{f}   = sim_data{Phi45}(:,4);
0076 
0077 
0078 % Calulate powers for real and imaginary, then take average of ZP and P for
0079 % each frequency
0080 
0081 power_ZP{f} = (cbass_real_zeroPhi{f}.^2 + cbass_imag_zeroPhi{f}.^2);
0082 power_Pco{f} = (cbass_real_Phi90{f}.^2 + cbass_imag_Phi90{f}.^2);
0083 power_Px{f} = (cbass_real_Phi45{f}.^2 + cbass_imag_Phi45{f}.^2);
0084 
0085 sim_beam_cell_xpol{f} = ((power_Px{f}));
0086 
0087 sim_beam_cell_copol{f} = ((power_ZP{f} + power_Pco{f})./2);
0088 
0089 % Plot the beams
0090 % Far-out beam 0--> 180 deg
0091 figure(1)
0092 
0093 % Plot co-pol beam
0094 subplot(2,1,1)
0095 plot(sim_angles, 10.*log10(sim_beam_cell_copol{f}./1.0))
0096 hold all
0097 xlim([min(sim_angles) max(sim_angles)])
0098 ylim([-50 50])
0099 xlabel('Degrees','Fontsize',24,'Fontname','Helvetica')
0100 ylabel('dBi','Fontsize',24,'Fontname','Helvetica')
0101 title('Simulated co-pol beam')
0102 
0103 % Plot xpol beam
0104 subplot(2,1,2) 
0105 plot(sim_angles, 10.*log10(sim_beam_cell_xpol{f}./1.0))
0106 hold all
0107 xlim([min(sim_angles) max(sim_angles)])
0108 ylim([-2 2])
0109 xlabel('Degrees','Fontsize',24,'Fontname','Helvetica')
0110 ylabel('dBi','Fontsize',24,'Fontname','Helvetica')
0111 title('Simulated x-pol beam')
0112 end
0113 
0114 
0115

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