-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnull_input_example.m
More file actions
137 lines (121 loc) · 3.19 KB
/
null_input_example.m
File metadata and controls
137 lines (121 loc) · 3.19 KB
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
% direc = '\\Dartfs-hpc\rc\lab\L\LynchK\public_html\Gemini3D\aurora_bent_03\';
% direc = '\\Dartfs-hpc\rc\lab\L\LynchK\public_html\Gemini3D\aurora_null_02\';
direc = '\\Dartfs-hpc\rc\lab\L\LynchK\public_html\Gemini3D\evans_comparison_evans-2keV-800eV';
dat = gemini3d.read.frame(direc,'time',datetime(2015,2,1,0,0,36000));
xg = gemini3d.read.grid(direc);
%%
[X2,X3] = ndgrid(xg.x2(3:end-2)/1e3,xg.x3(3:end-2)/1e3);
%%
[~,precip_fn,~] = fileparts(dat.filename);
precip = dir(fullfile(direc,'*particles',[char(precip_fn),'.*']));
if isempty(precip)
precip = dir(fullfile(direc,'*','*particles',[char(precip_fn),'.*']));
end
Q = h5read(fullfile(precip.folder,precip.name),'/Qp')/1e3; % Q defaults with mW/m^2 units
E0 = h5read(fullfile(precip.folder,precip.name),'/E0p'); % eV
jpar = -squeeze(dat.J1(end,:,:));
%%
clm.U = 'L19';
clm.c = 'L17';
clm.j = 'D1A';
units.U = 'mW/m^2';
units.c = 'keV';
units.j = 'uA/m^2';
clb_fmt = '%+ 2.0f';
% clb_fmt = '%+ 4.2f';
clb_exp = 0;
% ftn = 'Consolas';
ftn = 'Arial';
fts = 18;
% ar = [1,10,1];
ar = [(1+sqrt(5))/2,1,1];
reset(0)
set(0,'defaultFigurePaperUnits','inches')
set(0,'defaultTiledlayoutPadding','tight')
set(0,'defaultTiledlayoutTileSpacing','tight')
setall(0,'FontName',ftn)
setall(0,'FontSize',fts)
setall(0,'Multiplier',1)
set(0,'defaultAxesFontSizeMode','manual')
set(0,'defaultSurfaceEdgeColor','flat')
figure
set(gcf,'PaperPosition',[0,0,5,6])
tlo = tiledlayout(3,1);
nexttile
pcolor(X2,X3,Q*1e3)
% title('Precip. Energy Flux')
xlabel('')
ylabel('North [km]')
% yticks([])
colormap(gca,colorcet(clm.U))
clb = colorbar;
clb.Label.String = ['Q_0 (',units.U,')'];
clim([-0.2,3.2])
clb.Ruler.TickLabelFormat = clb_fmt;
clb.Ruler.Exponent = clb_exp;
Qlims = get(clb,'Limits');
pbaspect(ar)
nexttile
pcolor(X2,X3,E0/1e3)
% title('Char. Energy')
xlabel('')
ylabel('North [km]')
% yticks([])
colormap(gca,colorcet(clm.c))
clb = colorbar;
clb.Label.String = ['E_0 (',units.c,')'];
clim([-0.2,3.2])
clb.Ruler.TickLabelFormat = clb_fmt;
clb.Ruler.Exponent = clb_exp;
E0lims = get(clb,'Limits');
pbaspect(ar)
nexttile
pcolor(X2,X3,jpar*1e6)
% title('FAC')
xlabel('East [km]')
ylabel('North [km]')
% yticks([])
colormap(gca,colorcet(clm.j))
clb = colorbar;
clb.Label.String = ['j_{||} (',units.j,')'];
clb.Ruler.TickLabelFormat = clb_fmt;
clb.Ruler.Exponent = clb_exp;
clim([-2.1,2.1])
jlims = get(clb,'Limits');
pbaspect(ar)
saveas(gcf,'../CEDAR 2023/figures/evans-input-example.png')
close all
%%
ar = [1,3,1];
figure
set(gcf,'PaperPosition',[0,0,1,4])
tlo = tiledlayout(3,1);
nexttile
plot(Q(end/4,:)*1e3,X3(end/2,:),'k')
ylabel('North [km]')
xlim(Qlims+[-1,1]*max(Qlims)/3)
pbaspect(ar)
nexttile
plot(E0(end/4,:)/1e3,X3(end/2,:),'b')
ylabel('North [km]')
xlim(E0lims+[-1,1]*max(E0lims)/3)
pbaspect(ar)
nexttile
plot(jpar(end/4,:)*1e6,X3(end/2,:),'r')
xlabel(' a')
ylabel('North [km]')
xlim(jlims+[-1,1]*max(jlims)/3)
pbaspect(ar)
saveas(gcf,'../FINESST/bent_input_example_b.png')
close all
function setall(obj,property_suffix,val)
property_suffix = char(property_suffix);
l = length(property_suffix);
properties = fieldnames(get(obj,'factory'));
for n = 1:numel(properties)
p = properties{n};
if strcmp(p(end-l+1:end),property_suffix)
set(obj,['default',p(8:end)],val)
end
end
end