-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmake_rawsens_plot.m
102 lines (75 loc) · 2.34 KB
/
make_rawsens_plot.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
% make_rawsens_plot: called by handle_adxx_files or handle_ADJ_files
% - this version (_rawsens_) just plots sensitivity fields (not dJ fields)
% - at present, plots vertical sum for 3D cases
% - plots dJfield (units of [J])
% - grabs a frame for the animation
% - can now fix color axis for all plots
%
% to be added:
% - for 3D fields, also plot a zonal mean (or maybe a cut)
%
% -- depreciated - probably not needed anymore. Can probs delete file.
%
% default figure is hf1
%figure(hf1);
% handle 2D and 3D cases
switch ndim
case 2
% select field to plot
Fplot = adxx_now;
nzlev = 0;
% set color axis limits
set_cax_limits;
% make plot
m_map_gcmfaces(Fplot,myProj,...
{'myCmap',myCmap},...
{'myCaxis',myCax},...
{'doHold',1});
% add contour showing region of interest
if ~isempty(myMaskToPlot)
m_map_gcmfaces({'contour',myMaskC,'k'},4.1,{'doHold',1});
end
% format and print
format_and_print;
case 3
% calculate vertical sum for plot
% DRF not needed for vertical sum!
% Sum has units of [J]
Fplot = squeeze(nansum(adxx_now,3));
nzlev = 0;
% set color axis limits
set_cax_limits;
% make plot
m_map_gcmfaces(Fplot,myProj,...
{'myCmap',myCmap},...
{'myCaxis',myCax},...
{'doHold',1});
% add contour showing region of interest
if ~isempty(myMaskToPlot)
m_map_gcmfaces({'contour',myMaskC,'k'},4.1,{'doHold',1});
end
% format and print
format_and_print;
% plot selected vertical levels
for nzlev = 1:length(zlevs)
% vertical level progress
disp(strcat('---------- plotting vertical level=',int2str(nzlev)))
% select the level
Fplot = squeeze(adxx_now(:,:,zlevs(nzlev)));
% set color axis limits
set_cax_limits;
% make the plot
m_map_gcmfaces(Fplot,myProj,...
{'myCmap',myCmap},...
{'myCaxis',myCax},...
{'doHold',1});
% add contour showing region of interest
if ~isempty(myMaskToPlot)
m_map_gcmfaces({'contour',myMaskC,'k'},4.1,{'doHold',1});
end
% format axes and labels, print as selected
format_and_print;
end
otherwise
error('make_a_plot: ndim must be 2 or 3')
end