3 |
michaesp |
1 |
|
|
|
2 |
folder ='/lhome/sprenger/PV_Inversion_Tool/';
|
|
|
3 |
filename='Z1_20060115_18';
|
|
|
4 |
|
|
|
5 |
% --------------------------------------------------------------------------
|
|
|
6 |
% Plot qgPV anomaly (horizontal sections)
|
|
|
7 |
% --------------------------------------------------------------------------
|
|
|
8 |
|
|
|
9 |
% Base directory and filename
|
|
|
10 |
base = '/net/rossby/lhome/sprenger/PV_Inversion_Tool/';
|
|
|
11 |
folder = base;
|
|
|
12 |
filename = 'Z1_20060115_18';
|
|
|
13 |
disp([folder filename])
|
|
|
14 |
|
|
|
15 |
% First image (otherwise first image is not correctly written)
|
|
|
16 |
figname = [base '/test.eps'];
|
|
|
17 |
close;
|
|
|
18 |
fh=figure('Units','pixels','Position',[100 100 900 900])
|
|
|
19 |
set(gcf, 'PaperPosition', [2 1 15 10]);
|
|
|
20 |
print('-depsc2','-r0',figname);
|
|
|
21 |
|
|
|
22 |
% Load variables from file (on model levels)
|
|
|
23 |
m_pv = cdf_loadV(folder,filename,'QGPV_ANOM');
|
|
|
24 |
|
|
|
25 |
% Loop over all levels
|
|
|
26 |
for ilev=1:m_pv.nz
|
|
|
27 |
|
|
|
28 |
% Create a new figure
|
|
|
29 |
close;
|
|
|
30 |
fh=figure('Units','pixels','Position',[100 100 900 900])
|
|
|
31 |
|
|
|
32 |
% Set the geographical projection
|
|
|
33 |
m_proj('Equidistant Cylindrical','long',[m_pv.lonmin m_pv.lonmax],'lat',[m_pv.latmin m_pv.latmax]);
|
|
|
34 |
|
|
|
35 |
% Scale the plotting field for color map
|
|
|
36 |
fld=1e6*squeeze(m_pv.var(ilev,:,:));
|
|
|
37 |
c_map = scale_col(0:50:600,fld);
|
|
|
38 |
|
|
|
39 |
% Plot PV
|
|
|
40 |
lat=m_pv.ymin + (0:m_pv.ny-1) * m_pv.dy;
|
|
|
41 |
lon=m_pv.xmin + (0:m_pv.nx-1) * m_pv.dx;
|
|
|
42 |
[C,h]=m_contourf(lon,lat,c_map.data,c_map.xtick);
|
|
|
43 |
for icnt = 1: length(h)
|
|
|
44 |
set( h(icnt), 'EdgeColor', 'none' )
|
|
|
45 |
end
|
|
|
46 |
|
|
|
47 |
% Add color bar
|
|
|
48 |
colormap('default');
|
|
|
49 |
ctb(['/home/sprenger/ECFC_STE_Forecast/ctb_isen'],c_map.xtick,1);
|
|
|
50 |
caxis(c_map.caxis);
|
|
|
51 |
q=colorbar('hori');
|
|
|
52 |
set(q,'xtick',c_map.xtick,'XTickLabel',c_map.label);
|
|
|
53 |
|
|
|
54 |
% Add the grid and the coast lines to the plot
|
|
|
55 |
m_grid;
|
|
|
56 |
m_coast('linewidth',1,'color','k');
|
|
|
57 |
title(num2str(m_pv.aklay(ilev)));
|
|
|
58 |
|
|
|
59 |
% Save figure
|
|
|
60 |
pre='';
|
|
|
61 |
if ( m_pv.aklay(ilev) < 10 )
|
|
|
62 |
pre='0';
|
|
|
63 |
end
|
|
|
64 |
if ( m_pv.aklay(ilev) < 100 )
|
|
|
65 |
pre=[pre '0' ];
|
|
|
66 |
end
|
|
|
67 |
if ( m_pv.aklay(ilev) < 1000 )
|
|
|
68 |
pre=[pre '0' ];
|
|
|
69 |
end
|
|
|
70 |
if ( m_pv.aklay(ilev) < 10000 )
|
|
|
71 |
pre=[pre '0' ];
|
|
|
72 |
end
|
|
|
73 |
|
|
|
74 |
figname = [ base '/qg_2d_' filename '_' pre num2str(m_pv.aklay(ilev)) '.eps' ];
|
|
|
75 |
set(gcf, 'PaperPosition', [2 1 15 10]);
|
|
|
76 |
print('-depsc2','-r0',figname);
|
|
|
77 |
|
|
|
78 |
% End loop over all levels
|
|
|
79 |
end
|
|
|
80 |
|
|
|
81 |
|