-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplt_FV_subset_vect_g.m
More file actions
153 lines (136 loc) · 5.48 KB
/
Copy pathplt_FV_subset_vect_g.m
File metadata and controls
153 lines (136 loc) · 5.48 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
%function[]=plt_FV_subset_vect_g();
%(c) dmitry.aleynik@sams.ac.uk 2017.09.01 &
% __o_O__¬ FASTNEt &
% /_____/ ~~~~~~<@})))< ~ ~ ~~~~~ ~~~ SAMS Glider mission 4, Malin Shelf &
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
this_dir=pwd; DRV=this_dir(1:1);
path_fig='../fig_plt/';
path_mat='../mat/';
[status,message,messageid]=mkdir(path_fig); clear status message messageid
Tb=datenum('2017-09-06 08:00:00',31); % dye release 1kg rodamin
Te=datenum('2017-09-07 16:00:00',31);
addpath M:/Mar_Phys/matlab/m_map/
addpath M:/Mar_Phys/matlab/seawater/
addpath M:/Mar_Phys/matlab/general/
% load('A_Grid.mat','-mat'); xv=G.xv; yv=G.yv; % x,y limits
%% =========
%% horizontal map:
xvec=xv(2)-0.6/60; yvec=yv(2)-0.6/60;
scalev = 0.5; % arrow scale
scale = 5.0;
rlat=mean(yv);
if 1,...
figure(6); clf
set(gcf,'position',[50 50 580 580]);
colormap jet;
iz=1; it=1;
clear x y xx yy ug vg Uq Vq UVq go u v uv vp goa ;
% skip ploting magnitude uv map (subset with sps )
if 0,...
caxf=[-4.0 4.0]; cunit='m\cdots^{-1}';
Uq=squeeze(FV.u(it,iz,:,:)); cvar ='u'; caxf=[-4.0 4.0];
Vq=squeeze(FV.v(it,iz,:,:)); cvar ='v'; caxf=[-4.0 4.0];
UVq=sqrt(Uq.^2+Vq.^2); cvar ='V'; caxf=[0.0 3.0];
Umx=max(max(abs(UVq(isfinite(UVq)))));
pcolor(FV.x,FV.y,UVq); hold on; shading interp ;
caxis([caxf]);
cbar2=colorbar('location','west');
set(cbar2,'position',[ 0.80 0.33 0.013 0.35]); % [ 0.053 0.18 0.02 0.56]);
set(get(cbar2,'title'),'string',[' ' cvar ',' cunit]);
colormap jet;
clv =[-4:0.1:4];
clv05=[-4:0.5:4];
% hmpf = contourf(FV.x,FV.y,UVq,[clv ] ); hold on;
[hmc, hmp ] = contour( FV.x,FV.y,UVq,[clv05],'-k'); hold on;
% clabel(hmc,[-4:1:4],'LabelSpacing',250);
end;
%% ==============================
clear Uq Vq UVq ig jg go
sps=4; % sps=1; % skipping points
ig=[1:sps:nx];
jg=[1:sps:ny];
caxf=[-4.0 4.0]; cvar ='u'; cunit='m\cdots^{-1}';
Uq=squeeze(FV.u(it,iz,ig,jg));
Vq=squeeze(FV.v(it,iz,ig,jg)); cvar ='v';
UVq=sqrt(Uq.^2+Vq.^2); cvar ='V'; caxf=[0.0 3.0];
Umx=max(max(abs(UVq(isfinite(UVq)))));
masks = squeeze(FV.mask(ig,jg));
x=squeeze(FV.x(ig,jg));
y=squeeze(FV.y(ig,jg));
go=[]; go=find(masks >0);
xx=squeeze(x(go)) ;
yy=squeeze(y(go)) ;
u=squeeze(Uq(go)) ;
v=squeeze(Vq(go)) ;
uv=squeeze(UVq(go)) ;
u(abs(u)>5)=NaN; v(abs(v)>5)=NaN;
clv=[-4 : 0.2 : 4 ];
nk=length(xx);
xx(nk+1)=xvec; yy(nk+1)=yvec;
xx(nk+2)=xvec; yy(nk+2)=yvec;
u(nk+1)=scalev; v(nk+1)=0;
u(nk+2)=0; v(nk+2)=scalev;
vp=v*cosd(rlat); % adjustment for plotting vectors
set(gca,'xlim',[xv]);set(gca,'ylim',[yv]);
quiverc(xx,yy,u,vp,scale); hold on;
caxis(caxf);
% set(gcf, 'InvertHardCopy', 'off')
hts=text(xvec(1)-0.00045 , yvec(1)-0.00075, [num2str(scalev) ' ms^{-1}'],'FontSize',9); hold on;
%% create Vectors' colorbar & ticks , that is not very accurate - only for plotting
c=[0: 0.5: max(caxf)];
cbar=colorbar('location','EastOutside','XTickLabel',c);
cbposi = [0.6895 0.048 0.28 0.015];
cbposi = [ 0.92 0.20 0.013 0.65];
set(cbar,'position',cbposi);
% ct=cbar.Ticks; cbtl=cbar.TickLabels;
if cbar.Limits(end)<10,
cbar.Ticks=[0:0.5:cbar.Limits(end)];
else
cbar.Ticks=[0:10:cbar.Limits(end)];
cbar.TickLabels=c;
end%% -----------------------
colormap jet;
% freezeColors;
set(gca,'xlim',[xv]);set(gca,'ylim',[yv]);
plot(G.ncst(:,1),G.ncst(:,2),'.k-','markersize',0.5); hold on;
set(gca,'ylim',[yv(1)+0.00015 yv(2)-0.00015]);
set(gca,'xlim',[xv(1)+0.00015 xv(2)-0.00015]);
box on;
title([ 'FV-grid ' cvar ', ' cunit ', iz=' num2str(iz) ', ' cb]);
ylabel('^oN');
xlabel('^oW');
set(gca,'TickDir','out'); %in
set(gca,'YMinorTick','on','XMinorTick','on');
% try plot(O.lon,O.lat,'rp','markersize',5);hold on; end;% elevation site
% try plot(O.Tlon,O.Tlat,'r-.'); hold on; end; % transect line
%% do_gmap='N';
do_gmap='Y';
if do_gmap=='Y',...
mtype={'roadmap','satelite','terrain', 'hybrid'}; gk=3;
APIKey='AIzaSyC55hr1J9e8y1LpbjTSUaogudBKRc_X4uo';
api_key=APIKey; apiKey=APIKey;
scale=2;
mtype_g = char(mtype(gk));
clear hg %[lonVec3 latVec3 imag3]
plot(xv,yv,'w.'); hold on;
hg= plot_google_map( ... % 'height',ny,'width',nx,... 'height',640,'width',640,...
'maptype',mtype_g,...
'alpha',0.85 ,... % (0-1) Transparency level of the map (0 is fully transp)
'refresh',1,...
'autoAxis',0,...
'showLabels',0,...
'language','',...
'marker','yellowA');
set(gca,'ylim',[yv(1)+0.00015 yv(2)-0.00015]);
set(gca,'xlim',[xv(1)+0.00015 xv(2)-0.00015]);
hg.AlphaData=0.88;
end
daspect4 =[1 cosd(mean(yv)) 1];
set(gca,'dataaspectratio',daspect4);
set(gcf,'PaperPositionMode','auto');
set(gcf,'color','w'); % 'none')
orient portrait ;
fig_names6 =([path_fig 'FV_Vect_grd_' cvar 'iz' num2str(iz) '_' cb ]);
if do_gmap=='Y', fig_names6= [fig_names6 'g']; end
print(['-f'],'-dpng','-loose','-r300',[fig_names6 '.png']);
end