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