0001
0002
0003
0004
0005
0006
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
0016
0017
0018 temppath = '/sim_beams/';
0019
0020 [home,installeddir] = where_am_i();
0021 polpath= [home,'/',installeddir,'/',temppath];
0022
0023
0024 for f=1:ifreqs
0025 freq(f)
0026
0027
0028 simfile =([polpath,'with cryo cone prim and sec tunnel absorb subrefl no hole 19cuts lin pol 85dB incl primary2_4.5GHz.cut']);
0029
0030
0031
0032
0033 start_theta = dlmread(simfile,'',[1 0 1 0]);
0034 theta_step = dlmread(simfile,'',[1 1 1 1]);
0035 no_steps = dlmread(simfile,'',[1 2 1 2]);
0036 sim_angles = linspace(start_theta, -1*start_theta, no_steps);
0037
0038
0039
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);
0047 sim_data{i} = dlmread(simfile,'',data_position );
0048 end
0049
0050
0051
0052
0053
0054
0055
0056
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
0067
0068
0069
0070
0071
0072 Phi45 = find(phi == 45);
0073
0074 cbass_real_Phi45{f} = sim_data{Phi45}(:,3);
0075 cbass_imag_Phi45{f} = sim_data{Phi45}(:,4);
0076
0077
0078
0079
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
0090
0091 figure(1)
0092
0093
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
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