-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathargo_ecuador_perfiles.m
More file actions
199 lines (159 loc) · 5.59 KB
/
argo_ecuador_perfiles.m
File metadata and controls
199 lines (159 loc) · 5.59 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
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
clear all
close all
clc
path01='D:\CIO\Kelvin-cromwell\float_demo\float_20210215\perfiles';
hdir=dir(fullfile(path01,'20*'));
%flotadores con data fuera del rango de salinidad
% hdir(5)=[];
%
iter=0;
%Loop
for ifloat=1:1:size(hdir,1)
fname=hdir(ifloat).name;
load(fname)
P=depth;
T=temperature;
S=salinity;
L=loni;
data=cat(2,round(P(:,1)),round(T(:,1),2),round(S(:,1),2),repmat(L(1,1),[size(T(:,1),1) 1]));
%iter=iter+1;
i=0;
for iz=4:1:300
i=i+1;
indx=find(data(:,1)==iz);
if length(indx)>1 indx=indx(1,1); end
if ~isempty(indx)
temp(i,ifloat)=data(indx,2);
sal(i,ifloat)=data(indx,3);
pres(i,ifloat)=data(indx,1);
lon(i,ifloat)=data(indx,4);
else
temp(i,ifloat)=NaN;
sal(i,ifloat)=NaN;
pres(i,ifloat)=NaN;
lon(i,ifloat)=NaN;
end
end
end
%Create a j=0,
%lon(lon<0)=lon(lon<0)+360;
lono=nanmean(lon,1);
% nonan_logical=isnan(lon);
% nonan_select=sum(nonan_logical,2);
%
% %%no error nonan_select
% only_zero=find(nonan_select==2);
% no_error=only_zero(1,1);
%%order lon
%[lonb,Indx]=sort(lon(no_error,:),2);
[lonb,Indx]=sort(lono,2);
lon2=lon(:,Indx);
temp2=temp(:,Indx);
sal2=round(sal(:,Indx),2);
pres2=pres(:,Indx);
salinity_range=[-99 30];
sal2(sal2>=salinity_range(1) & sal2<=salinity_range(2))=NaN;
[xi,di]=meshgrid(1:1:size(hdir,1),1:1:size(pres2,1));
temp3=griddata(xi(~isnan(temp2)),di(~isnan(temp2)),temp2(~isnan(temp2)),xi,di);
sal3=griddata(xi(~isnan(sal2)),di(~isnan(sal2)),sal2(~isnan(sal2)),xi,di);
pres3=griddata(xi(~isnan(pres2)),di(~isnan(pres2)),pres2(~isnan(pres2)),xi,di);
pr=0;
pt = theta(sal3,temp3,pres3,pr);
sigma3=sigmat(pt,sal3);
%% graficos
figure
P=get(gcf,'position');
P(3)=P(3)*4;
P(4)=P(4)*1;
set(gcf,'position',P);
set(gcf,'PaperPositionMode','auto');
[C,h]=contourf(lonb,-pres3(:,1),temp3,30,'k:');h.LevelList=round(h.LevelList);
colormap(jet);title('Temperatura Subsuperficial 150E-85W','Fontsize',13)
clabel(C,h); colorbar; caxis([11 31]);
hold on
[C,h]=contour(lonb,-pres3(:,1),sal3,[35.6:0.2:36.5],'m--','linewidth',2);
%clabel(C,h);
hold on
set(gca,'ytick',[-300:20:0],'yticklabel',[-300:20:0],'ylim',[-300 -4]);
set(gca,'xtick',[150:5:275],'xticklabel',[[150:5:180] [-175:5:-85]],'xlim',[150 275]);
xlabel('Longitud'); ylabel('Profundidad');
text(245,-270,'Fuente: ARGO','color','white','fontweight','bold');
text(245,-280,'Procesamiento: CIO-Challenger','color','white','fontweight','bold');
saveas(gcf,'Temperatura Subsuperficial 150E-85W.jpg','jpg');
%% graficos 2
figure
P=get(gcf,'position');
P(3)=P(3)*2;
P(4)=P(4)*2.5;
set(gcf,'position',P);
set(gcf,'PaperPositionMode','auto');
subplot(3,1,2)
[C,h]=contourf(lonb,-pres3(:,1),sal3,[33:.1:36],'k:');h.LevelList=round(h.LevelList,1);
colormap(parula);title('Salinidad Subsuperficial 150E-85W');
c=colorbar;
c.Label.String='Salinidad (ups)'; v=[34.8,35,35.5];
clabel(C,h,v);
caxis([34 36]);
set(gca,'ytick',[-300:50:0],'yticklabel',[-300:50:0],'ylim',[-300 -4]);
set(gca,'xtick',[150:5:275],'xticklabel',[[150:5:180] [-175:5:-85]],'xlim',[150 275]);
xlabel('Longitud'); ylabel('Profundidad');
t=text(153,-25,'B','fontsize',15,'color','w');
% saveas(gcf,'Salinidad Subsuperficial 150E-90W.jpg','jpg');
subplot(3,1,1)
[C,h]=contourf(lonb,-pres3(:,1),sigma3,[20:0.5:30],':');h.LevelList=round(h.LevelList,1);
colormap(parula);title('Sigma-theta Subsuperficial 150E-85W');
clabel(C,h); caxis([21 27.5]);
c=colorbar;
c.Label.String='Sigma-theta';
%c.LineWidth=3;
hold on
set(gca,'ytick',[-300:50:0],'yticklabel',[-300:50:0],'ylim',[-300 -4]);
set(gca,'xtick',[150:5:275],'xticklabel',[[150:5:180] [-175:5:-85]],'xlim',[150 275]);
xlabel('Longitud'); ylabel('Profundidad');
t=text(153,-25,'A','fontsize',15,'color','w');
% saveas(gcf,'Sigma-theta Subsuperficial 150E-90W.jpg','jpg');
[loni,presi]=meshgrid(lonb,pres3(:,1));
subplot(3,1,3)
pcolor(lonb,sigma3,sal3);
hold on
[C,h]=contour(loni,sigma3,sal3,[35.5 36],'r--');
clabel(C,h);
hold on
[c,h]=contour(loni,sigma3,pres3,'k:');
clabel(c,h);
shading flat; colorbar;
caxis([34 36]);
hold on
set(gca,'ytick',[21:0.5:26.5],'yticklabel',[21:0.5:26.5],'ylim',[21 26.5]);
set(gca,'xtick',[150:5:275],'xticklabel',[[150:5:180] [-175:5:-85]],'xlim',[150 275]);
xlabel('Longitud'); ylabel('Sigma-theta');
title('Salinidad vs Sigma-theta Subsuperficial 150E-85W');
text(153,21.5,'C','fontsize',15,'color','w');
text(152.5,25.5,'Fuente: ARGO','color','white','fontweight','bold');
text(152.5,26,'Procesamiento: CIO-Challenger','color','white','fontweight','bold');
c=colorbar;
c.Label.String='Salinidad (ups)';
set(gca, 'YDir','reverse')
print('Salinidad vs Sigma-theta Subsuperficial 150E-85W.png','-dpng','-r500');
%saveas(gcf,'Salinidad vs Sigma-theta Subsuperficial 150E-90W.jpg','jpg');
%% graficos 3
figure
P=get(gcf,'position');
P(3)=P(3)*2.5;
P(4)=P(4)*0.7;
set(gcf,'position',P);
set(gcf,'PaperPositionMode','auto');
pcolor(lonb,sigma3,temp3);
hold on
% [C,h]=contour(loni,sigma3,temp3,[20 20],'r--');
% clabel(C,h);
% hold on
[c,h]=contour(loni,sigma3,pres3,'k:');
clabel(c,h);
shading flat; colormap jet; colorbar;
caxis([14 31]);
hold on
%set(gca,'ytick',[21:0.5:26.5],'yticklabel',[21:0.5:26.5],'ylim',[21 26.5]);
set(gca,'xtick',[150:5:270],'xticklabel',[[150:5:180] [-175:5:-90]],'xlim',[150 270]);
xlabel('Longitud'); ylabel('Sigma-theta');
title('Temperatura vs Sigma-theta Subsuperficial 150E-90W');