4 addpath(
'../Setup/Various_functions');
8 figure(
'Units',
'inches',
'Position', [1 1 8 6],...
9 'DefaultAxesFontName',
'times new roman',
'DefaultAxesFontWeight',
'bold',
'DefaultAxesFontSize', FontSize,...
10 'PaperOrientation',
'portrait',
'PaperPositionMode',
'auto',
'DefaultTextFontWeight',
'bold');
12 % change target_en_list
for more options
13 target_en_list = [0.5 1 2];
15 for i = 1:numel(target_en_list)
17 target_en = target_en_list(i);
20 Plot_file_name='Comparison_with_without_EMIC';
21 folder_name1='../Execute/
Output/';
22 %folder_name2='../Output_chorus_1MeV/';
23 %folder_name3='../Output_chorus_EMIC_1MeV/';
24 %folder_name4='../Output_hiss_sp_2MeV/';
42 text1=['E=' num2str(target_en) ' MeV'];
44 text3=' Chorus and EMIC ';
49 output_formats = [{
'epsc'}];%,{
'pdf'}];%[{'fig'}, {'ai'}, , ];
52 %figure(
'Units',
'inches',
'Position', [1 1 8 6],...
53 %
'DefaultAxesFontName',
'times new roman',
'DefaultAxesFontWeight',
'bold',
'DefaultAxesFontSize', FontSize,...
54 %
'PaperOrientation',
'portrait',
'PaperPositionMode',
'auto',
'DefaultTextFontWeight',
'bold');%,
'PaperPosition', [1 1 3.8 9]);%
55 % figure(
'Units',
'inches', ...
56 %
'DefaultAxesFontName',
'times new roman',
'DefaultAxesFontWeight',
'bold',
'DefaultAxesFontSize', FontSize,...
57 %
'PaperOrientation',
'portrait',
'PaperPositionMode',
'auto');%,
'PaperPosition', [1 1 3.8 9]);
'Position', [1 1 4 8],%
61 %--------------------------------------------------------------------------
63 % for col_num=2:nfolders
67 folder_name=folder_name1;
70 % folder_name=folder_name2;
73 % folder_name=folder_name3;
76 % folder_name=folder_name4;
80 dataFileName = [folder_name,'OutPSD.dat'];
81 gridFileName = [folder_name,'perp_grid.plt'];
82 oneDimDataFileName = [folder_name,'out1d.dat'];
83 zDxxFileName1 = [folder_name,'../DiffCoeff/Daa_chorus_night_FA.plt'];
84 DxxFileName2 = [folder_name,'../DiffCoeff/Daa_chorus_day_FA.plt'];
85 %DxxFileName3 = [folder_name,'Daa_EMIC_Plume.plt']
86 %DxxFileName =
'../Output/Daa_Chorus_Day.plt'
88 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
90 % Loading grid and data
91 [~,en,alpha, f_var1] = load_plt(DxxFileName1,
'squeeze');
92 [~,en,alpha, f_var2] = load_plt(DxxFileName2,
'squeeze');
93 %[alpha, f_var3] = load_plt(DxxFileName3,
'squeeze');
94 f_var.name =
'D_{\alpha\alpha}, days^{-1}';
96 [~,ind_target_en] = min(abs(en.arr(:,1) - target_en ));
98 %alpha.arr = alpha.arr*180/pi;
99 alpha.arr = squeeze( alpha.arr(ind_target_en,:)*180/pi );
102 f_var1.arr = squeeze(f_var1.arr(ind_target_en,:));
103 f_var2.arr = squeeze(f_var2.arr(ind_target_en,:));
106 % from now we are operating only with f_var and x_var
109 % subplot area position
112 %n_of_vertical_plots = 3;
113 %width = 1 - 2*h_sps;
114 %height = (1-(2+n_of_vertical_plots)*v_sps)/n_of_vertical_plots;
116 %pos1 = [h_sps, 1 - 1*(v_sps + height), width, height];
117 %pos2 = [h_sps, 1 - 2*(v_sps + height), width, height];
118 %pos3 = [h_sps, 1 - 3*(v_sps + height), width, height];
119 %--------------------------------------------------------------------------
121 %subplot('Position', pos1);
122 sb=subplot(3,nfolders,col_num);
123 %set(sb,
'ActivePositionProperty',
'outerposition' )
124 plot(x_var.arr, f_var1.arr, 'k', 'LineWidth', 2);
126 plot(x_var.arr, f_var2.arr, 'b', 'LineWidth', 2);
128 ylabel('Diffusion Coefficients days$^{-1}$')
129 xlabel('Pitch Angle')
130 %plot(x_var.arr, f_var3.arr, 'r', 'LineWidth', 2);
132 text(xtext_loc, ytext_loc, text_cur)
134 set(gca,
'yscale',
'log',
'xlim', [xmin1 xmax1],
'ylim', [ymin1 ymax1]);
138 %title(['Energy = ', num2str(epc.arr(1)), ' MeV']);
139 %set(gca, 'xtick', []);
141 %set(cl, 'Visible','off')
143 [L, epc, alpha] = load_plt(gridFileName, 'squeeze');
144 %alpha.arr = alpha.arr*180/pi;
145 alpha.arr = squeeze(alpha.arr(ind_target_en,:))*180/pi;
147 [f_var] = load_plt(dataFileName);
148 f_var.arr = squeeze(f_var.arr(:,ind_target_en,:));
154 %subplot('Position', pos2);
155 sb=subplot(3,nfolders,col_num+nfolders);
156 %set(sb,'ActivePositionProperty', 'outerposition' )
158 cmap = jet(size(f_var.arr,1));
159 % black for first color
160 cmap(1, :) = [0, 0, 0];
162 set(gca, 'ColorOrder', cmap, 'NextPlot', 'replacechildren', 'Box', 'on');
163 plot(x_var.arr, f_var.arr', 'LineWidth', 1);
164 ylabel('Phase Space Density')
165 xlabel('Pitch Angle')
167 set(gca, 'yscale', 'log', 'xlim', [xmin2 xmax2], 'ylim', [ymin2 ymax2]);
172 %set(gca, 'xtick', []);
173 % loading various 1d data
174 [time, Kp, Boundary_fluxes, Lpp, Bw] = load_plt(oneDimDataFileName, 'squeeze');
175 caxis([0
max(time.arr)]);
176 if (col_num==nfolders)
177 % set(sb,'ActivePositionProperty', 'outerposition' )
179 set(cl,'Position', [0.918,0.429,0.018 0.177])%('Position', [(pos2(1)+pos2(3)+1-cbar)/2, pos2(2), cbar/2, pos2(4)]);
185 % if (col_num~=nfolders)
186 % set(cl, 'Visible','off')
190 %subplot('Position', pos3);
191 sb=subplot(3,nfolders,col_num+2*nfolders);
192 %set(sb,'ActivePositionProperty', 'outerposition' )
193 it = (length(time.arr)-1);
194 dt = time.arr(it+1) - time.arr(it);
195 % decay.arr=zeros(time.size1,f_var.size1);
196 % for it=1:time.size1-1
197 % decay.arr(it,:)= (f_var.arr(it+1, :) + f_var.arr(it, :)).*dt./(f_var.arr(it, :) - f_var.arr(it+1, :))./2;
199 decay.arr = (f_var.arr(it+1, :) + f_var.arr(it, :)).*dt./(f_var.arr(it, :) - f_var.arr(it+1, :))./2;
200 % cmap = jet(size(f_var.arr,1));
201 % % black for first color
202 % cmap(1, :) = [0, 0, 0];
204 set(gca, 'yscale', 'linear','ColorOrder', cmap, 'NextPlot', 'replacechildren', 'Box', 'on');
205 plot(alpha.arr, decay.arr,'k', 'LineWidth', 2);
206 set(gca, 'xlim', [xmin3 xmax3], 'ylim', [ymin3 ymax3]);
207 ylabel('Decay time, days');
210 %caxis([0
max(time.arr)]);
211 %colorbar%('Position', [(pos2(1)+pos2(3)+1-cbar)/2, pos2(2), cbar/2, pos2(4)]);
213 %set(cl, 'Visible','off')
217 for it = 1:
max(size(output_formats))
218 % saveas(
gcf, [Plot_file_name, '.', output_formats{it}], output_formats{it});
219 eval([
'print -d', output_formats{it},
' ', Plot_file_name,
'.', output_formats{it}]);
222 %print -r2048 -dpdf test.pdf
double max(double v1, double v2)
Return maximum.
functions for write log and support files. Functions are defined in Output.h and descripted in Output...
void gcf(double *gammcf, double a, double x, double *gln)
Returns the incomplete gamma function Q(a, x) evaluated by its continued fraction representation as g...
Parameters_structure parameters
Parameters structure, with all parameters from the parameters.ini file. The default parameters define...