1 |
function []=insitu_cost(dirData,doComp,varargin); |
function []=insitu_cost(dirData,doComp,varargin); |
2 |
%[]=insitu_cost(dirData,listData,listVar,varargin); |
%[]=insitu_cost(dirData,listData,listVar,varargin); |
3 |
%object: computes or displays cost function statistics |
%object: computes or displays cost function statistics |
4 |
%input: dirData is the data main directory name |
%input: dirData is the data main directory name |
5 |
% doComp states whether to compute & save (1) or load & display (0) |
% doComp states whether to compute & save (1) or load & display (0) |
6 |
%optional must take the following form {'name',param1,param2,...} Active ones are |
%optional must take the following form {'name',param1,param2,...} Active ones are |
9 |
% {'listVar',var1,var2} where var1 and var2 are 'T' and 'S' |
% {'listVar',var1,var2} where var1 and var2 are 'T' and 'S' |
10 |
% {'years',year0,year1} to limit computation to [year0 year1] interval |
% {'years',year0,year1} to limit computation to [year0 year1] interval |
11 |
% {'subdirMat',subdirMat} where subdirMat is the output subdirectory ('mat/' by default) |
% {'subdirMat',subdirMat} where subdirMat is the output subdirectory ('mat/' by default) |
12 |
% {'suffMat',suffMat} is the mat file suffix ('all' by default) |
% {'suffMat',suffMat} is the mat file suffix ('all' by default) |
13 |
% {'subdirTex',subdirTex} where subdirTex is the tex directory ('tex/' by default) |
% {'subdirTex',subdirTex} where subdirTex is the tex directory ('tex/' by default) |
14 |
% {'addToTex',addToTex} states whether (1) or not (0 default) to |
% {'addToTex',addToTex} states whether (1) or not (0 default) to |
15 |
% augment an ongoing tex file (see write2tex.m, subdirTex) |
% augment an ongoing tex file (see write2tex.m, subdirTex) |
16 |
% |
% |
17 |
%example: insitu_cost('./',1,{'listData','argo_in*'}); |
%example: insitu_cost('./',1,{'listData','argo_in*'}); |
18 |
|
|
19 |
%load paths and grid: |
%load paths and grid: |
20 |
%-------------------- |
%-------------------- |
21 |
global mygrid; if isempty(mygrid); grid_load('GRID/',5,'compact'); end; |
global mygrid; if isempty(mygrid); grid_load('GRID/',5,'compact'); end; |
22 |
|
|
23 |
%set more optional paramaters to default values |
%set more optional paramaters to default values |
24 |
year0=1992; year1=2008; |
global myparms; year0=myparms.yearInAve(1); year1=myparms.yearInAve(2); |
25 |
|
%year0=1992; year1=2008; |
26 |
listData={'WOD09_XBT*','WOD09_CTD*','argo_in*','argo_at*','argo_pa*','seals*'}; |
listData={'WOD09_XBT*','WOD09_CTD*','argo_in*','argo_at*','argo_pa*','seals*'}; |
27 |
listVar={'T','S'}; |
listVar={'T','S'}; |
28 |
%shorter test case: listData={'argo_in*'}; listVar={'T'}; |
%shorter test case: listData={'argo_in*'}; listVar={'T'}; |
114 |
end; |
end; |
115 |
|
|
116 |
myCaption={'Cost function (top) for in situ profiles, as a function of depth and time. ',... |
myCaption={'Cost function (top) for in situ profiles, as a function of depth and time. ',... |
117 |
'Distribution of normalized misfits (bottom) as a function of latitude. For T (left) and S (right).'}; |
'Distribution of normalized misfits (bottom) as a function of latitude. For T (left) and S (right).'}; |
118 |
if addToTex; write2tex([dirData '/' subdirTex '/myPlots.tex'],2,myCaption,gcf); end; |
if addToTex; write2tex([dirData '/' subdirTex '/myPlots.tex'],2,myCaption,gcf); end; |
119 |
|
|
120 |
end; |
end; |