-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstd_bot.m
54 lines (47 loc) · 1.34 KB
/
std_bot.m
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
function [bot,prop,units] = std_bot(bot,prop,units)
% STD_BOT converts bottle data to standardized units of micromol/kg
%
% Usage: [b,p,u] = std_bot(bot,prop,units)
%
% Copywrite 1995 Paul E Robbins
% first check label strings for lower case
units = upper(units);
prop = upper(prop);
% check for strings in non standard format
for i = 1:size(units,1)
if strcmp(units(i,:),' DBARS')
units(i,:) = ' DBAR';
end
if strcmp(units(i,:),' PM/KG')
units(i,:) = 'PMOL/KG';
end
end
itheta = 0; isalt = 0;
% compute density
for i = 1:size(prop,1)
if strcmp(prop(i,:),' THETA')
itheta = i;
end
if strcmp(prop(i,:),'SALNTY')
isalt = i;
end
end
if itheta == 0 | isalt == 0
disp(['Unable to locate Theta and Salt for nutrient conversions'])
else
% check for units in non-standard units
for i = 1:size(units,1)
if strcmp(units(i,:),' ML/L')
xx = ox_units(bot(:,i),bot(:,isalt),bot(:,itheta));
bot(:,i) = xx;
units(i,:) = 'UMOL/KG';
disp([' Converted ',prop(i,:),' from ml/l to umol/kg'])
end
if strcmp(units(i,:),' UMOL/L') | strcmp(units(i,:),'UMOL/L ')
xx = nut_units(bot(:,i),bot(:,isalt));
bot(:,i) = xx;
units(i,:) = 'UMOL/KG';
disp([' Converted ',prop(i,:),' from umol/l to umol/kg'])
end
end
end