Skip to content

Commit 5580f87

Browse files
committed
Merge branch 'main' of github.com:NOAA-PMEL/BGC_Argo_Mat_Toolbox into full_argo
2 parents 312a5f1 + e55cf51 commit 5580f87

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

auxil/depth_interp.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@
8787
try
8888
assert(strcmp(raw, 'no'));
8989
X = Data.PRES_ADJUSTED;
90+
good_vals = sum(isfinite(X));
91+
% a somewhat arbitrary criterion: at least half of the profiles
92+
% must have valid adjusted pressure values, or switch to
93+
% raw pressure
94+
assert(sum(good_vals) > 0.5 * length(good_vals));
9095
catch
9196
X = Data.PRES;
9297
end

auxil/plot_profiles.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@
280280
try
281281
assert(strcmp(raw, 'no')) % use PRES if raw values are used
282282
PRES = Data.(floats{f}).PRES_ADJUSTED;
283+
good_vals = sum(isfinite(PRES));
284+
% a somewhat arbitrary criterion: at least half of the profiles
285+
% must have valid adjusted pressure values, or switch to
286+
% raw pressure
287+
assert(sum(good_vals) > 0.5 * length(good_vals));
283288
catch
284289
PRES = Data.(floats{f}).PRES;
285290
end

auxil/plot_sections.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ function plot_sections(Data, Mdata, variables, nvars, plot_isopyc, ...
125125

126126
% unless 'raw' is specified, plot adjusted data
127127
if strncmpi(raw,'y',1)
128-
title_add = ' [raw values]';
128+
[title_added{1:nvars}] = deal(' [raw values]');
129129
else
130-
title_add = '';
130+
[title_added{1:nvars}] = deal(''); % default; may change later
131131
for v = 1:nvars
132132
% if all floats have adjusted values available for a variable,
133133
% they will be used instead of raw values
@@ -142,7 +142,7 @@ function plot_sections(Data, Mdata, variables, nvars, plot_isopyc, ...
142142
warning(['adjusted values for %s for float %s are not available,',...
143143
' showing raw value profiles instead'], ...
144144
variables{v}, floats{f});
145-
title_add = ' [raw values]';
145+
title_added{v} = ' [raw values]';
146146
end
147147
end
148148
if has_adj == nfloats
@@ -208,8 +208,8 @@ function plot_sections(Data, Mdata, variables, nvars, plot_isopyc, ...
208208
ylim(depth);
209209
end
210210
title(sprintf('Float %d: %s %s%s', ...
211-
Mdata.(float_ids{f}).WMO_NUMBER, long_name, units, title_add),...
212-
'FontSize',14);
211+
Mdata.(float_ids{f}).WMO_NUMBER, long_name, units, ...
212+
title_added{v}), 'FontSize', 14);
213213
ylabel('Pressure (dbar)');
214214
set(gca,'Ydir','reverse');
215215
colorbar;

auxil/try_download.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
catch
5252
if Settings.verbose
5353
fprintf('failure!\n');
54-
if exist([dest_path, '.html'], 'file')
55-
delete([dest_path, '.html']);
56-
end
54+
end
55+
if exist([dest_path, '.html'], 'file')
56+
delete([dest_path, '.html']);
5757
end
5858
if h == length(Settings.hosts)
5959
if exist(dest_path, 'file') ~= 2

0 commit comments

Comments
 (0)