-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot2.m
237 lines (226 loc) · 7.93 KB
/
plot2.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if flag_plot == true
% Plots
figure()
dat = data.visible_area;
dat_label = "Visible Area/ km^2";
t = tiledlayout(1,1);
ax(1) = axes(t);
a = plot(ax(1), data.distance./data.simulation_unit, dat, "-r");
ax1.XColor = 'r';
ax1.YColor = 'r';
ax(2) = axes(t);
b = plot(ax(2), data.distance, dat, "--b");
ax(2).XAxisLocation = 'top';
ax(2).Color = 'none';
xlabel(ax(1),"Distance/ "+data.simulation_unit_label)
ylabel(ax(1),dat_label)
xlabel(ax(2),"Distance/ km")
ylabel(ax(2),dat_label)
legend([a,b],'au','km')
title("Visible Area v Distance")
if flag_save == true
saveas(gcf, "visible area v distance.png")
end
figure()
dat = data.intensity;
dat_label = "Total Intensity/ W";
t = tiledlayout(1,1);
ax(1) = axes(t);
a = plot(ax(1), data.distance./data.simulation_unit, dat, "-r");
ax1.XColor = 'r';
ax1.YColor = 'r';
ax(2) = axes(t);
b = plot(ax(2), data.distance, dat, "--b");
ax(2).XAxisLocation = 'top';
ax(2).Color = 'none';
xlabel(ax(1),"Distance/ "+data.simulation_unit_label)
ylabel(ax(1),dat_label)
xlabel(ax(2),"Distance/ km")
ylabel(ax(2),dat_label)
legend([a,b],'au','km')
title("Total Intensity v Distance")
if flag_save == true
saveas(gcf, "total intensity v distance.png")
end
figure()
dat = data.mean_intensity;
dat_label = "Mean Intensity/ W/m^2";
t = tiledlayout(1,1);
ax(1) = axes(t);
a = plot(ax(1), data.distance./data.simulation_unit, dat, "-r");
ax1.XColor = 'r';
ax1.YColor = 'r';
ax(2) = axes(t);
b = plot(ax(2), data.distance, dat, "--b");
ax(2).XAxisLocation = 'top';
ax(2).Color = 'none';
xlabel(ax(1),"Distance/ "+data.simulation_unit_label)
ylabel(ax(1),dat_label)
xlabel(ax(2),"Distance/ km")
ylabel(ax(2),dat_label)
legend([a,b],'au','km')
title("Mean Intensity v Distance")
if flag_save == true
saveas(gcf, "mean intensity v distance.png")
end
figure()
dat = data.max_viewing_angle;
dat_label = "Viewing Angle/ rad";
t = tiledlayout(1,1);
ax(1) = axes(t);
a = plot(ax(1), data.distance./data.simulation_unit, dat, "-r");
ax1.XColor = 'r';
ax1.YColor = 'r';
ax(2) = axes(t);
b = plot(ax(2), data.distance, dat, "--b");
ax(2).XAxisLocation = 'top';
ax(2).Color = 'none';
xlabel(ax(1),"Distance/ "+data.simulation_unit_label)
ylabel(ax(1),dat_label)
xlabel(ax(2),"Distance/ km")
ylabel(ax(2),dat_label)
legend([a,b],'au','km')
title("Max Viewing Angle v Distance")
if flag_save == true
saveas(gcf, "max viewing angle v distance.png")
end
figure()
dat = data.beta;
dat_label = "Beta";
t = tiledlayout(1,1);
ax(1) = axes(t);
a = plot(ax(1), data.distance./data.simulation_unit, dat./max(dat), "-r");
ax1.XColor = 'r';
ax1.YColor = 'r';
ax(2) = axes(t);
b = plot(ax(2), data.distance, dat./max(dat), "--b");
ax(2).XAxisLocation = 'top';
ax(2).Color = 'none';
xlabel(ax(1),"Distance/ "+data.simulation_unit_label)
ylabel(ax(1),dat_label)
xlabel(ax(2),"Distance/ km")
ylabel(ax(2),dat_label)
legend([a,b],'au','km')
title("Beta v Distance")
if flag_save == true
saveas(gcf,"beta v distance.png")
end
%%%%
figure()
dat = data.visible_area;
dat_label = "Visible Area/ km^2";
t = tiledlayout(1,1);
ax(1) = axes(t);
a = loglog(ax(1), data.distance./data.simulation_unit, dat, "-r");
ax1.XColor = 'r';
ax1.YColor = 'r';
ax(2) = axes(t);
b = loglog(ax(2), data.distance, dat, "--b");
ax(2).XAxisLocation = 'top';
ax(2).Color = 'none';
xlabel(ax(1),"Distance/ "+data.simulation_unit_label)
ylabel(ax(1),dat_label)
xlabel(ax(2),"Distance/ km")
ylabel(ax(2),dat_label)
legend([a,b],'au','km')
title("Visible Area v distance (log log plot)")
if flag_save == true
saveas(gcf,"visible area v distance loglog.png")
end
figure()
dat = data.intensity;
dat_label = "Total Intensity/ W";
t = tiledlayout(1,1);
ax(1) = axes(t);
a = loglog(ax(1), data.distance./data.simulation_unit, dat, "-r");
ax1.XColor = 'r';
ax1.YColor = 'r';
ax(2) = axes(t);
b = loglog(ax(2), data.distance, dat, "--b");
ax(2).XAxisLocation = 'top';
ax(2).Color = 'none';
xlabel(ax(1),"Distance/ "+data.simulation_unit_label)
ylabel(ax(1),dat_label)
xlabel(ax(2),"Distance/ km")
ylabel(ax(2),dat_label)
legend([a,b],'au','km')
title("Total Intensity v Distance (log log plot)")
if flag_save == true
saveas(gcf,"total intensity v distance loglog.png")
end
figure()
dat = data.mean_intensity;
dat_label = "Mean Intensity/ W/m^2";
t = tiledlayout(1,1);
ax(1) = axes(t);
a = loglog(ax(1), data.distance./data.simulation_unit, dat, "-r");
ax1.XColor = 'r';
ax1.YColor = 'r';
ax(2) = axes(t);
b = loglog(ax(2), data.distance, dat, "--b");
ax(2).XAxisLocation = 'top';
ax(2).Color = 'none';
xlabel(ax(1),"Distance/ "+data.simulation_unit_label)
ylabel(ax(1),dat_label)
xlabel(ax(2),"Distance/ km")
ylabel(ax(2),dat_label)
legend([a,b],'au','km')
title("Mean Intensity v Distance (log log plot)")
if flag_save == true
saveas(gcf,"mean intensity v distance loglog.png")
end
figure()
dat = data.max_viewing_angle;
dat_label = "Viewing Angle/ rad";
t = tiledlayout(1,1);
ax(1) = axes(t);
a = loglog(ax(1), data.distance./data.simulation_unit, dat, "-r");
ax1.XColor = 'r';
ax1.YColor = 'r';
ax(2) = axes(t);
b = loglog(ax(2), data.distance, dat, "--b");
ax(2).XAxisLocation = 'top';
ax(2).Color = 'none';
xlabel(ax(1),"Distance/ "+data.simulation_unit_label)
ylabel(ax(1),dat_label)
xlabel(ax(2),"Distance/ km")
ylabel(ax(2),dat_label)
legend([a,b],'au','km')
title("Max viewing angle v Distance from solar centre ")
if flag_save == true
saveas(gcf,"max viewing angle v distance loglog.png")
end
figure()
dat = data.beta;
dat_label = "Beta";
t = tiledlayout(1,1);
ax(1) = axes(t);
a = loglog(ax(1), data.distance./data.simulation_unit, dat./max(dat), "-r");
ax1.XColor = 'r';
ax1.YColor = 'r';
ax(2) = axes(t);
b = loglog(ax(2), data.distance, dat./max(dat), "--b");
ax(2).XAxisLocation = 'top';
ax(2).Color = 'none';
xlabel(ax(1),"Distance/ "+data.simulation_unit_label)
ylabel(ax(1),dat_label)
xlabel(ax(2),"Distance/ km")
ylabel(ax(2),dat_label)
legend([a,b],'au','km')
title("Beta v Distance from solar centre (log log plot)")
if flag_save == true
saveas(gcf,"beta v distance loglog.png")
end
figure()
plot(data.distance, data.visible_area, "r")
hold on
yyaxis right
plot(data.distance, data.intensity, "b")
plot(data.distance, (data.visible_area .* 6.3e13)./data.distance.^2, 'g')
if flag_wait == false
close all
end
toc
end
return