| 1 |
|
| 2 |
doPart1=0; |
| 3 |
doDisplay=1; |
| 4 |
doPlatformCheck=1; |
| 5 |
|
| 6 |
if doPart1; |
| 7 |
|
| 8 |
%load paths and grid: |
| 9 |
%-------------------- |
| 10 |
gcmfaces_global; grid_load; |
| 11 |
|
| 12 |
%load data set: |
| 13 |
%-------------- |
| 14 |
|
| 15 |
dirData='/Users/gforget/mywork/projects_inprogress/ecco_v4/costs/insitu/nc/'; |
| 16 |
% dirData='/Users/gforget/mywork/projects_inprogress/ecco_v4/costs/insitu/iter3/'; |
| 17 |
% fileData='seals_MITprof_latest.nc'; |
| 18 |
% fileData='argo_pacific_MITprof_latest.nc'; |
| 19 |
fileData='argo_atlantic_MITprof_latest.nc'; |
| 20 |
% fileData='argo_indian_MITprof_latest.nc'; |
| 21 |
|
| 22 |
|
| 23 |
MITprof=MITprof_load([dirData fileData]); |
| 24 |
|
| 25 |
%assign nameData: |
| 26 |
%---------------- |
| 27 |
|
| 28 |
ii=strfind(fileData,'_MITprof_latest.nc'); |
| 29 |
if ~isempty(ii); |
| 30 |
nameData=fileData(1:ii-1); |
| 31 |
else; |
| 32 |
ii=strfind(fileData,'_MITprof.nc'); |
| 33 |
if ~isempty(ii); |
| 34 |
nameData=fileData(1:ii-1); |
| 35 |
else; |
| 36 |
ii=strfind(fileData,'.nc'); |
| 37 |
nameData=fileData(1:ii-1); |
| 38 |
end; |
| 39 |
end; |
| 40 |
|
| 41 |
eval(['MITprof_' nameData '=MITprof;']); |
| 42 |
|
| 43 |
%get platforms list: |
| 44 |
%------------------- |
| 45 |
|
| 46 |
prof_descrInd={}; prof_countInd=[]; |
| 47 |
prof_lonInd=[]; prof_latInd=[]; prof_dateInd=[]; |
| 48 |
|
| 49 |
npInd=0; |
| 50 |
for pp=1:MITprof.np; |
| 51 |
test0=isempty(find(strcmp(prof_descrInd,MITprof.prof_descr{pp}))); |
| 52 |
if test0; |
| 53 |
%MITprof.prof_descr{pp} |
| 54 |
npInd=npInd+1; prof_descrInd{npInd}=MITprof.prof_descr{pp}; |
| 55 |
test1=find(strcmp(prof_descrInd{npInd},MITprof.prof_descr)); |
| 56 |
prof_countInd=[prof_countInd length(test1)]; |
| 57 |
prof_lonInd=[prof_lonInd median(MITprof.prof_lon(test1))]; |
| 58 |
prof_latInd=[prof_latInd median(MITprof.prof_lat(test1))]; |
| 59 |
prof_dateInd=[prof_dateInd median(MITprof.prof_date(test1))]; |
| 60 |
end; |
| 61 |
end; |
| 62 |
|
| 63 |
[prof_countInd,ii]=sort(prof_countInd,'descend'); |
| 64 |
prof_descrInd=prof_descrInd(ii); prof_lonInd=prof_lonInd(ii); |
| 65 |
prof_latInd=prof_latInd(ii); prof_dateInd=prof_dateInd(ii); |
| 66 |
|
| 67 |
%store stats to structure: |
| 68 |
%------------------------- |
| 69 |
|
| 70 |
eval(['platform_stats_' nameData '.prof_descrInd=prof_descrInd;']); |
| 71 |
eval(['platform_stats_' nameData '.prof_countInd=prof_countInd;']); |
| 72 |
eval(['platform_stats_' nameData '.prof_lonInd=prof_lonInd;']); |
| 73 |
eval(['platform_stats_' nameData '.prof_latInd=prof_latInd;']); |
| 74 |
eval(['platform_stats_' nameData '.prof_dateInd=prof_dateInd;']); |
| 75 |
|
| 76 |
end; |
| 77 |
|
| 78 |
%display all platforms tracks: |
| 79 |
%----------------------------- |
| 80 |
|
| 81 |
if doDisplay>1; |
| 82 |
cols='krymbw'; |
| 83 |
|
| 84 |
figure; set(gcf,'Units','Normalized','Position',[0.1 0.3 0.4 0.6]); |
| 85 |
[X,Y,FLD]=convert2pcol(mygrid.XC,mygrid.YC,mygrid.mskC); pcolor(X,Y,FLD); |
| 86 |
axis([-180 180 -90 90]); shading flat; xlabel('longitude'); ylabel('latitude'); |
| 87 |
|
| 88 |
for ppInd=1:npInd; |
| 89 |
ii=circshift([1:length(cols)],[0 ppInd-1]); ii=ii(1); cc=cols(ii); |
| 90 |
jj=find(strcmp(MITprof.prof_descr,prof_descrInd{ppInd})); |
| 91 |
if length(jj)>20; |
| 92 |
hold on; plot(MITprof.prof_lon(jj),MITprof.prof_lat(jj),[cc '.']); |
| 93 |
title(prof_descrInd{ppInd}); pause(0.01); |
| 94 |
end; |
| 95 |
end; |
| 96 |
end;%if doDisplay>0; |
| 97 |
|
| 98 |
%refined analysis of a platform's data: |
| 99 |
%-------------------------------------- |
| 100 |
|
| 101 |
if doPlatformCheck; |
| 102 |
for ii=51:250:2290; |
| 103 |
MITprofSub=MITprof_subset(MITprof,'descr',prof_descrInd{ii}); |
| 104 |
if doDisplay>0; |
| 105 |
% figure; set(gcf,'Units','Normalized','Position',[0.1 0.1 0.8 0.8]); |
| 106 |
figure; set(gcf,'Units','Normalized','Position',[-0.45 0.1 0.4 0.8]); |
| 107 |
subplot(3,1,1); |
| 108 |
[X,Y,FLD]=convert2pcol(mygrid.XC,mygrid.YC,mygrid.mskC); pcolor(X,Y,FLD); |
| 109 |
axis([-180 180 -90 90]); shading flat; xlabel('longitude'); ylabel('latitude'); |
| 110 |
hold on; plot(MITprofSub.prof_lon,MITprofSub.prof_lat,'k.'); |
| 111 |
ccT=prctile(MITprofSub.prof_T(:),[5 95]); ccS=prctile(MITprofSub.prof_S(:),[5 95]); if isnan(ccS(1)); ccS=[34 36]; end; |
| 112 |
subplot(3,2,3); imagescnan(MITprofSub.prof_T'); caxis(ccT); colorbar; title('T obs'); |
| 113 |
subplot(3,2,4); imagescnan(MITprofSub.prof_S'); caxis(ccS); colorbar; title('S obs'); |
| 114 |
subplot(3,2,5); imagescnan(MITprofSub.prof_Testim'); caxis(ccT); colorbar; title('T estim'); |
| 115 |
subplot(3,2,6); imagescnan(MITprofSub.prof_Sestim'); caxis(ccS); colorbar; title('S estim'); |
| 116 |
%pause; |
| 117 |
end; |
| 118 |
|
| 119 |
MITprofSub=MITprof_subset(MITprofSub,'depth',[50 150]); |
| 120 |
misfT=(MITprofSub.prof_T-MITprofSub.prof_Testim).*sqrt(MITprofSub.prof_Tweight); misfT=misfT(find(~isnan(misfT)&misfT~=0)); |
| 121 |
misfS=(MITprofSub.prof_S-MITprofSub.prof_Sestim).*sqrt(MITprofSub.prof_Sweight); misfS=misfS(find(~isnan(misfS)&misfS~=0)); |
| 122 |
if doDisplay>0; |
| 123 |
% figure; set(gcf,'Units','Normalized','Position',[0.1 0.1 0.8 0.8]); |
| 124 |
figure; set(gcf,'Units','Normalized','Position',[-0.45 0.1 0.4 0.8]); |
| 125 |
subplot(2,2,1); |
| 126 |
[X,Y,FLD]=convert2pcol(mygrid.XC,mygrid.YC,mygrid.mskC); pcolor(X,Y,FLD); |
| 127 |
axis([-180 180 -90 90]); shading flat; xlabel('longitude'); ylabel('latitude'); |
| 128 |
hold on; plot(MITprofSub.prof_lon,MITprofSub.prof_lat,'k.'); |
| 129 |
subplot(2,2,2); |
| 130 |
plot(MITprofSub.prof_T,MITprofSub.prof_S,'bx'); hold on; xlabel('T'); ylabel('S'); |
| 131 |
plot(MITprofSub.prof_Testim,MITprofSub.prof_Sestim,'rx'); title('blue: obs red: estim'); |
| 132 |
subplot(2,2,3); hist(misfT(find(~isnan(misfT))),[-8:0.25:8]); |
| 133 |
aa=axis; aa(1:2)=[-1 1]*10; axis(aa); title('T normalized misfit'); |
| 134 |
subplot(2,2,4); hist(misfS(find(~isnan(misfS))),[-8:0.25:8]); |
| 135 |
aa=axis; aa(1:2)=[-1 1]*10; axis(aa); title('S normalized misfit'); |
| 136 |
%pause; |
| 137 |
end; |
| 138 |
|
| 139 |
% close; close; |
| 140 |
|
| 141 |
end; |
| 142 |
end;%if doPlatformCheck; |
| 143 |
|
| 144 |
|