1 %addpath(
'./Various_functions')
6 save_pictures = SAVEFIG;
11 picture_name =
'Figure_12a';
13 picture_name =
'Figure_12a';
15 picture_name =
'Figure_12a';
17 picture_name =
'Figure_12a';
20 %folder_name1=['../Execute/Output_', FIGURE, '/'];
23 %{'../Execute/previous_Output/'},
24 {['../Execute/Output_12', FIGURE, '/']}
25 %{'I:\YSSVNL_SVN\paper\Subbotin and Shprits 2009 Three-dimensional modeling of the radiation belts using the VERB code\Calculations\2009-06-27 3D paper recalculation\Fixed_parameters\Block and Split\Split\0.1\Output\'}
29 %output_formats = [{'fig'}, {'epsc'}, {'pdf'}];
30 output_formats = [{'png'}];
40 path_file = path_file_arr{1};
42 gridFileName = [path_file, 'perp_grid.plt'];
43 % gridFileName = [path_file, 'rad_grid.plt'];
45 oneDimDataFileName = [path_file, 'out1d.dat'];
47 if (gridFileName(length(gridFileName)-3:length(gridFileName)) ==
'.dat')
48 [alpha, epc, L, pc] = load_plt(gridFileName,
'squeeze',
'permute');
50 [L, epc, alpha, pc] = load_plt(gridFileName,
'squeeze',
'permute');
52 [time, Kp, Bf, Lpp] = load_plt(oneDimDataFileName);
55 for i = 1:length(path_file_arr)
56 path_file = path_file_arr{i};
58 % compressions: Indeo5
60 mov = avifile([path_file, movie_name,
'.avi'],
'fps', 10,
'quality', 0,
'compression',
'none');
63 f1 = figure(
'Units',
'inches',
'Position', [0.5 0.5 12 5], ...
64 'DefaultAxesFontName',
'times new roman',
'DefaultAxesFontWeight',
'bold',
'DefaultAxesFontSize', 12,
'DefaultTextFontWeight',
'bold',
'DefaultTextFontSize', 12,...
65 'PaperOrientation',
'portrait',
'PaperPositionMode',
'auto',
'DefaultLineLineWidth', 2);%,
'PaperPosition', [1 1 3.8 9]);%
67 dataFileName = [path_file, 'OutPSD.dat'];
68 %dataFileName = [path_file, 'OutPSD_rad.dat'];
70 PSD = load_plt(dataFileName,
'permute',
'nosqueeze',
'skip_zones', 1,
'n_zones', 999);%
74 [val, L_slice] = min(abs(L.arr(:,1,1) - target_L));
76 if (length(size(alpha.arr)) == 3)
77 alpha_2d = squeeze(alpha.arr(L_slice,:,:));
78 energy_2d = squeeze(epc.arr(L_slice,:,:));
84 set(
gcf,
'Name', path_file);
86 % comment/uncomment loop
if you need just one pitcture
87 time_slice = length(
PSD.time);
89 if(strcmp(FIGURE,
'a'))
92 time_slice_arr = length(
PSD.time);
95 for time_slice = time_slice_arr% 1:length(
PSD.time)%
98 set(gca,
'nextplot',
'replacechildren');
100 PSD_2d = squeeze(
PSD.
arr(time_slice,L_slice,:,:));
102 % PSD_min = 10^(log10(
max(
max(PSD_2d))) - 2);
103 % PSD_2d(PSD_2d<PSD_min)=PSD_min;
105 log_abs_PSD = log10(abs(PSD_2d));
106 log_abs_PSD(isinf(log_abs_PSD)) = 0;
107 log_abs_PSD(find(log_abs_PSD>c_max))=c_max;
108 log_abs_PSD(find(log_abs_PSD<c_min))=c_min;
110 contourf(alpha_2d, energy_2d, log_abs_PSD, n_colors);
111 set(gca,
'yscale',
'log');
114 caxis([c_min c_max]);
117 text(
max(xlim), 10^((min(log10(ylim)) +
max(log10(ylim)))/2),
'log_{10}(|PSD|, 3 \cdot 10^{-8} c/MeV/cm^3)',
'Rotation', 90,
'VerticalAlignment',
'top',
'HorizontalAlignment',
'center',
'FontWeight',
'bold');
118 text(min(xlim),
max(ylim), [
'Time=', num2str(
PSD.time(time_slice)),
', days'],
'VerticalAlignment',
'top',
'HorizontalAlignment',
'left',
'FontWeight',
'bold',
'Color',
'white');
120 xlabel(
'Pitch angle, deg')
121 ylabel('Energy, MeV')
124 set(gca,'nextplot','replacechildren');
126 %contourf(alpha_2d, energy_2d, sign(PSD_2d));
127 pcolor(alpha_2d, energy_2d, sign(PSD_2d));
129 set(gca, 'yScale', 'log')
132 xlabel('Pitch angle, deg');
133 ylabel('Energy, MeV');
134 text(
max(xlim), 10^((min(log10(ylim)) +
max(log10(ylim)))/2), 'sign(
PSD)', 'Rotation', 90, 'VerticalAlignment', 'top', 'HorizontalAlignment', 'center', 'FontWeight', 'bold');
137 mov = addframe(mov, getframe(f1)); end;
139 %if (save_pictures) save_picture(
gcf, [path_file, picture_name, '=', num2str(PSD.time(time_slice))], 'jpg', 'pdf', 'eps'); end;
141 save_picture(gcf, ['../Figures/', picture_name, '=', num2str(PSD.time(time_slice))], 'png');
142 end; % ../Figures... add FIGURE to the picture_name
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...
Matrix3D< double > arr
array of PSD values
Phase Space Density class.
Parameters_structure parameters
Parameters structure, with all parameters from the parameters.ini file. The default parameters define...