VERB_code_2.3
Figure_1.m
1 % clear all
2 % ploting. Loading - at the end of this file
3 
4 addpath('../Setup/Various_functions/');
5 
6 
7 % NOTE: It does not matter if you choose mixed or no-mixed term folders -
8 % both plots are the same.
9 path1 = '../Execute/';
10 
11 % for hiss
12 Kp = 4;
13 
14 % Hiss scale plasmasphere
15 BwInFile = 100;
16 BwForDxxKp = 30;
17 DxxKp = 4/(BwForDxxKp/BwInFile);
18 %HissScale = (BwForDxxKp/BwInFile)^2 * (Kp/DxxKp)^2
19 HissScale_pp = (Kp/DxxKp)^2;
20 HissMLT_pp = 0.6;
21 
22 %Chorus scale
23 BwInFile = 50;
24 BwForDxxKp = 50;
25 DxxKp = 4/(BwForDxxKp/BwInFile);
26 Bw2_0 = 2.0*10^(2.5 + 0.18 * DxxKp);
27 if (Kp <= 2.333)
28  Bw2 = 2.0*10^(0.73 + 0.91 * Kp);
29 end
30 if (Kp > 2.333)
31  Bw2 = 2.0*10^(2.5 + 0.18 * Kp);
32 end
33 ChorusScale = Bw2/Bw2_0;
34 ChotrusMLT = 0.25;
35 
36 %[L_2d, epc_2d, alpha_2d, Daa_chorus_day_2d, Dpp_chorus_day_2d, Dpa_chorus_day_2d] = load_plt([path1, 'DiffCoeff/FullCode_DaysideChorus_BavD_Matrix_L45.txt'], 'permute', 'squeeze');
37 %[L_2d, epc_2d, alpha_2d, Daa_chorus_night_2d, Dpp_chorus_night_2d, Dpa_chorus_night_2d] = load_plt([path1, 'DiffCoeff/FullCode_NightsideChorus_BavD_Matrix_L45.txt'], 'permute', 'squeeze');
38 %[L_2d, epc_2d, alpha_2d, Daa_hiss_pp_2d, Dpp_hiss_pp_2d, Dpa_hiss_pp_2d] = load_plt([path1, 'DiffCoeff/FullCode_PlasmasphericHiss_SmallWaveNormalAngle_BavD_Matrix_L45.txt'], 'permute', 'squeeze');
39 
40 % [L_2d, epc_2d, alpha_2d, Daa_chorus_day_2d, Dpp_chorus_day_2d, Dpa_chorus_day_2d] = load_plt([path1, 'DiffCoeff/DaysideChorus_OuterBelt_BavD_Matrix_L45_1keVto30MeV_Lietal2007_20091022.txt'], 'permute', 'squeeze');
41 
42 [L_2d, epc_2d, alpha_2d, Daa_chorus_day_2d] = load_plt([path1, 'DiffCoeff/Daa_chorus_day_Full_LPA.plt'], 'permute', 'squeeze');
43 [L_2d, epc_2d, alpha_2d, Dpp_chorus_day_2d] = load_plt([path1, 'DiffCoeff/Dpp_chorus_day_Full_LPA.plt'], 'permute', 'squeeze');
44 [L_2d, epc_2d, alpha_2d, Dpa_chorus_day_2d] = load_plt([path1, 'DiffCoeff/Dap_chorus_day_Full_LPA.plt'], 'permute', 'squeeze');
45 
46 % [L_2d, epc_2d, alpha_2d, Daa_chorus_night_2d, Dpp_chorus_night_2d, Dpa_chorus_night_2d] = load_plt([path1, 'DiffCoeff/NightsideChorus_OuterBelt_BavD_Matrix_L45_1keVto30MeV_Lietal2007_20091022.txt'], 'permute', 'squeeze');
47 
48 [L_2d, epc_2d, alpha_2d, Daa_chorus_night_2d] = load_plt([path1, 'DiffCoeff/Daa_chorus_night_Full_LPA.plt'], 'permute', 'squeeze');
49 [L_2d, epc_2d, alpha_2d, Dpp_chorus_night_2d] = load_plt([path1, 'DiffCoeff/Dpp_chorus_night_Full_LPA.plt'], 'permute', 'squeeze');
50 [L_2d, epc_2d, alpha_2d, Dpa_chorus_night_2d] = load_plt([path1, 'DiffCoeff/Dap_chorus_night_Full_LPA.plt'], 'permute', 'squeeze');
51 
52 % [L_2d, epc_2d, alpha_2d, Daa_hiss_pp_2d, Dpp_hiss_pp_2d, Dpa_hiss_pp_2d] = load_plt([path1, 'DiffCoeff/PlasmasphericHiss_SmallWaveNormalAngle_BavD_Matrix_L45_1keVto30MeV_Lietal2007_20091022.txt'], 'permute', 'squeeze');
53 
54 
55 [L_2d, epc_2d, alpha_2d, Dpa_hiss_pp_2d] = load_plt([path1, 'DiffCoeff/Dap_hiss_plume_FA_LPA.plt'], 'permute', 'squeeze');
56 [L_2d, epc_2d, alpha_2d, Daa_hiss_pp_2d] = load_plt([path1, 'DiffCoeff/Daa_hiss_plume_FA_LPA.plt'], 'permute', 'squeeze');
57 [L_2d, epc_2d, alpha_2d, Dpp_hiss_pp_2d] = load_plt([path1, 'DiffCoeff/Dpp_hiss_plume_FA_LPA.plt'], 'permute', 'squeeze');
58 
59 
60 alpha_2d.arr = alpha_2d.arr;%*pi/180;
61 epc_2d.arr = epc_2d.arr;%/1e3;
62 
63 units = 1;
64 c_min = -6;
65 c_max = 2;
66 n_color = 100;
67 
68 y_min = 1e-2;
69 y_max = 2e1;
70 
71 L_slice = 1;
72 
73 Daa_chorus_2d.arr = Daa_chorus_day_2d.arr + Daa_chorus_night_2d.arr;
74 Dpp_chorus_2d.arr = Dpp_chorus_day_2d.arr + Dpp_chorus_night_2d.arr;
75 Dpa_chorus_2d.arr = Dpa_chorus_day_2d.arr + Dpa_chorus_night_2d.arr;
76 
77 % MLT + Kp->4
78 Daa_chorus_2d.arr = Daa_chorus_2d.arr * ChorusScale * ChotrusMLT;
79 Dpp_chorus_2d.arr = Dpp_chorus_2d.arr * ChorusScale * ChotrusMLT;
80 Dpa_chorus_2d.arr = Dpa_chorus_2d.arr * ChorusScale * ChotrusMLT;
81 Daa_hiss_pp_2d.arr = Daa_hiss_pp_2d.arr * HissScale_pp * HissMLT_pp;
82 Dpp_hiss_pp_2d.arr = Dpp_hiss_pp_2d.arr * HissScale_pp * HissMLT_pp;
83 Dpa_hiss_pp_2d.arr = Dpa_hiss_pp_2d.arr * HissScale_pp * HissMLT_pp;
84 
85 %f2 = figure('Units', 'inches', 'Position', [0.5 0.5 8 6], ...
86 % 'DefaultAxesFontName', 'times new roman', 'DefaultAxesFontWeight', 'bold', 'DefaultAxesFontSize', 12,...
87 % 'PaperOrientation', 'portrait', 'PaperPositionMode', 'auto', 'DefaultLineLineWidth', 2);%, 'PaperPosition', [1 1 3.8 9]);%
88 %
89 %subplot1(2, 3, 'Max', [0.90 0.95], 'Min', [0.10 0.10]);
90 
91 %f2 = figure('Units', 'inches', 'Position', [0.5 0.5 4.5 5], ...
92 % 'DefaultAxesFontName', 'times new roman', 'DefaultAxesFontWeight', 'bold', 'DefaultAxesFontSize', 7, 'DefaultTextFontWeight', 'bold', 'DefaultTextFontSize', 7,...
93 % 'PaperOrientation', 'portrait', 'PaperPositionMode', 'auto', 'DefaultLineLineWidth', 2);%, 'PaperPosition', [1 1 3.8 9]);%
94 %subplot1(2, 2, 'Max', [0.85 0.95], 'Min', [0.10 0.10]);
95 
96 f2 = figure('Units', 'inches', 'Position', [0.5 0.5 8.5 5], ...
97  'DefaultAxesFontName', 'times new roman', 'DefaultAxesFontWeight', 'bold', 'DefaultAxesFontSize', 7, 'DefaultTextFontWeight', 'bold', 'DefaultTextFontSize', 7,...
98  'PaperOrientation', 'portrait', 'PaperPositionMode', 'auto', 'DefaultLineLineWidth', 2);%, 'PaperPosition', [1 1 3.8 9]);%
99 
100 %colormap('gray')
101 %color1 = 'black';
102 color1 = 'white';
103 
104 subplot1(2, 5, 'Max', [0.92 0.95], 'Min', [0.05 0.10]);
105 
106 subplot1(1);
107 Dxx = log10(Daa_chorus_2d.arr*units);
108 Dxx(isnan(Dxx)) = c_min;
109 Dxx(find(Dxx<c_min)) = c_min;
110 contourf(alpha_2d.arr*180/pi, epc_2d.arr, Dxx, n_color);
111 shading flat
112 caxis([c_min c_max])
113 axis tight
114 set(gca, 'yScale', 'log')
115 ylim([y_min y_max])
116 xlim([0 90])
117 text(min(xlim), min(ylim), {' (A) D_{\alpha \alpha}, ', ' Chorus '}, 'VerticalAlignment', 'bottom', 'HorizontalAlignment', 'left', 'FontWeight', 'bold', 'Color', 'black');
118 ylabel('Energy, MeV');
119 
120 %subplot1(3);
121 subplot1(6);
122 Dxx = log10(Dpp_chorus_2d.arr*units);
123 Dxx(isnan(Dxx)) = c_min;
124 Dxx(find(Dxx<c_min)) = c_min;
125 contourf(alpha_2d.arr*180/pi, epc_2d.arr, Dxx, n_color);
126 shading flat
127 caxis([c_min c_max])
128 axis tight
129 set(gca, 'yScale', 'log')
130 ylim([y_min y_max])
131 xlim([0 90])
132 text(min(xlim), min(ylim), {' (C) D_{pp}/p^2, ', ' Chorus '}, 'VerticalAlignment', 'bottom', 'HorizontalAlignment', 'left', 'FontWeight', 'bold', 'Color', 'black');
133 xlabel('Pitch angle, deg');
134 ylabel('Energy, MeV');
135 
136 subplot1(2);
137 Dxx = log10(Daa_hiss_pp_2d.arr*units);
138 Dxx(isnan(Dxx)) = c_min;
139 Dxx(find(Dxx<c_min)) = c_min;
140 contourf(alpha_2d.arr*180/pi, epc_2d.arr, Dxx, n_color);
141 shading flat
142 caxis([c_min c_max])
143 axis tight
144 set(gca, 'yScale', 'log')
145 ylim([y_min y_max])
146 xlim([0 90])
147 text(min(xlim), min(ylim), {' (B) D_{\alpha \alpha}, ', ' plasmaspheric hiss '}, 'VerticalAlignment', 'bottom', 'HorizontalAlignment', 'left', 'FontWeight', 'bold', 'Color', 'black');
148 text(max(xlim), 10^((min(log10(ylim)) + max(log10(ylim)))/2), 'log_{10}(day^{-1})', 'Rotation', 90, 'VerticalAlignment', 'top', 'HorizontalAlignment', 'center', 'FontWeight', 'bold');
149 ax_pos = get(gca, 'Position');
150 
151 %subplot1(4);
152 subplot1(7);
153 Dxx = log10(Dpp_hiss_pp_2d.arr*units);
154 Dxx(isnan(Dxx)) = c_min;
155 Dxx(find(Dxx<c_min)) = c_min;
156 contourf(alpha_2d.arr*180/pi, epc_2d.arr, Dxx, n_color);
157 shading flat
158 caxis([c_min c_max])
159 axis tight
160 set(gca, 'yScale', 'log')
161 ylim([y_min y_max])
162 xlim([0 90])
163 text(min(xlim), min(ylim), {' (D) D_{pp}/p^2, ', ' plasmaspheric hiss '}, 'VerticalAlignment', 'bottom', 'HorizontalAlignment', 'left', 'FontWeight', 'bold', 'Color', 'black');
164 xlabel('Pitch angle, deg');
165 
166 subplot1(2)
167 cl = colorbar('West');
168 cl_pos = get(cl, 'Position');
169 cl_x_pos = ax_pos(1) + ax_pos(3) + 0.035;%0.015; %0.925
170 %cl_x_pos = ax_pos2(1) + ax_pos2(3) + 0.035;%0.015; %0.925
171 set(cl, 'Position', [cl_x_pos, cl_pos(2), cl_pos(3), cl_pos(4)]);
172 %gca = axis(cl)
173 
174 %%%save_picture(gcf, [path1, 'Figures/Figure_1_1'], 'jpg', 'pdf', 'epsc', 'fig');
175 
176 
177 %f2 = figure('Units', 'inches', 'Position', [0.5 0.5 4.5 5], ...
178 % 'DefaultAxesFontName', 'times new roman', 'DefaultAxesFontWeight', 'bold', 'DefaultAxesFontSize', 7, 'DefaultTextFontWeight', 'bold', 'DefaultTextFontSize', 7,...
179 % 'PaperOrientation', 'portrait', 'PaperPositionMode', 'auto', 'DefaultLineLineWidth', 2);%, 'PaperPosition', [1 1 3.8 9]);%
180 
181 %subplot1(2, 2, 'Max', [0.85 0.95], 'Min', [0.10 0.10]);
182 
183 %subplot1(1);
184 subplot1(4);
185 
186 Dxx = log10(abs(Dpa_chorus_2d.arr*units));
187 Dxx(isnan(Dxx)) = c_min;
188 Dxx(find(Dxx<c_min)) = c_min;
189 contourf(alpha_2d.arr*180/pi, epc_2d.arr, Dxx, n_color);
190 shading flat
191 caxis([c_min c_max])
192 axis tight
193 set(gca, 'yScale', 'log')
194 ylim([y_min y_max])
195 xlim([0 90])
196 text(min(xlim), min(ylim), {' (E) |D_{p \alpha}/p|, ', ' Chorus '}, 'VerticalAlignment', 'bottom', 'HorizontalAlignment', 'left', 'FontWeight', 'bold', 'Color', 'black');
197 ax_pos2 = get(gca, 'Position');
198 text(max(xlim), 10^((min(log10(ylim)) + max(log10(ylim)))/2), 'log_{10}(day^{-1})', 'Rotation', 90, 'VerticalAlignment', 'top', 'HorizontalAlignment', 'center', 'FontWeight', 'bold');
199 ylabel('Energy, MeV');
200 
201 %subplot1(3);
202 subplot1(9);
203 Dxx = sign(Dpa_chorus_2d.arr)*2;
204 contourf(alpha_2d.arr*180/pi, epc_2d.arr, Dxx, 3);
205 %pcolor(alpha_2d.arr*180/pi, epc_2d.arr, Dxx);
206 shading flat
207 set(gca, 'yScale', 'log')
208 caxis([-1 1])
209 axis tight
210 ylim([y_min y_max])
211 xlim([0 90])
212 text(min(xlim), min(ylim), {' (G) sign(D_{p \alpha}), ', ' Chorus '}, 'VerticalAlignment', 'bottom', 'HorizontalAlignment', 'left', 'FontWeight', 'bold', 'Color', color1);
213 xlabel('Pitch angle, deg');
214 ax_pos3 = get(gca, 'Position');
215 text(max(xlim), 10^((min(log10(ylim)) + max(log10(ylim)))/2), 'sign', 'Rotation', 90, 'VerticalAlignment', 'top', 'HorizontalAlignment', 'center', 'FontWeight', 'bold');
216 ylabel('Energy, MeV');
217 
218 %subplot1(2);
219 subplot1(5);
220 Dxx = log10(abs(Dpa_hiss_pp_2d.arr*units));
221 Dxx(isnan(Dxx)) = c_min;
222 Dxx(find(Dxx<c_min)) = c_min;
223 contourf(alpha_2d.arr*180/pi, epc_2d.arr, Dxx, n_color);
224 shading flat
225 caxis([c_min c_max])
226 axis tight
227 set(gca, 'yScale', 'log')
228 ylim([y_min y_max])
229 xlim([0 90])
230 text(min(xlim), min(ylim), {' (F) |D_{p \alpha}/p|, ', ' plasmaspheric hiss '}, 'VerticalAlignment', 'bottom', 'HorizontalAlignment', 'left', 'FontWeight', 'bold', 'Color', 'black');
231 ax_pos2 = get(gca, 'Position');
232 text(max(xlim), 10^((min(log10(ylim)) + max(log10(ylim)))/2), 'log_{10}(day^{-1})', 'Rotation', 90, 'VerticalAlignment', 'top', 'HorizontalAlignment', 'center', 'FontWeight', 'bold');
233 
234 %subplot1(4);
235 subplot1(10);
236 Dxx = sign(Dpa_hiss_pp_2d.arr)*2;
237 contourf(alpha_2d.arr*180/pi, epc_2d.arr, Dxx, 3);
238 %pcolor(alpha_2d.arr*180/pi, epc_2d.arr, Dxx);
239 shading flat
240 set(gca, 'yScale', 'log')
241 caxis([-1 1])
242 axis tight
243 ylim([y_min y_max])
244 xlim([0 90])
245 text(min(xlim), min(ylim), {' (H) sign(D_{p \alpha}), ', ' plasmaspheric ', ' hiss '}, 'VerticalAlignment', 'bottom', 'HorizontalAlignment', 'left', 'FontWeight', 'bold', 'Color', color1);
246 xlabel('Pitch angle, deg');
247 ax_pos3 = get(gca, 'Position');
248 text(max(xlim), 10^((min(log10(ylim)) + max(log10(ylim)))/2), 'sign', 'Rotation', 90, 'VerticalAlignment', 'top', 'HorizontalAlignment', 'center', 'FontWeight', 'bold');
249 
250 %subplot1(2)
251 subplot1(5);
252 cl = colorbar('West');
253 cl_pos = get(cl, 'Position');
254 cl_x_pos = ax_pos2(1) + ax_pos2(3) + 0.035;%0.015; %0.925
255 %cl_x_pos = ax_pos2(1) + ax_pos2(3) + 0.035;%0.015; %0.925
256 set(cl, 'Position', [cl_x_pos, cl_pos(2), cl_pos(3), cl_pos(4)]);
257 %gca = axis(cl)
258 
259 %subplot1(4)
260 subplot1(10);
261 cl = colorbar('West');
262 cl_pos = get(cl, 'Position');
263 cl_x_pos = ax_pos3(1) + ax_pos3(3) + 0.035;%0.015; %0.925
264 %cl_x_pos = ax_pos2(1) + ax_pos2(3) + 0.035;%0.015; %0.925
265 set(cl, 'Position', [cl_x_pos, cl_pos(2), cl_pos(3), cl_pos(4)]);
266 %gca = axis(cl)
267 
268 %%% save_picture(gcf, [path1, 'Figures/Figure_1'], 'jpg', 'pdf', 'epsc');
269 
270 subplot1(8)
271 delete(gca)
272 subplot1(3)
273 delete(gca)
274 
275 set(gcf, 'renderer', 'painters')
276 
277 %save_picture(gcf, ['Figure_1_bw'], 'jpg', 'pdf', 'epsc');
278 %save_picture(gcf, ['Figure_1'], 'jpg', 'pdf', 'epsc');
279 
280 return
double max(double v1, double v2)
Return maximum.
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...
Definition: erf.cpp:103