Home > robbins > std_bot.m

std_bot

PURPOSE ^

STD_BOT converts bottle data to standardized units of micromol/kg

SYNOPSIS ^

function [bot,prop,units] = std_bot(bot,prop,units)

DESCRIPTION ^

 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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [bot,prop,units]  = std_bot(bot,prop,units)
0002 
0003 % STD_BOT converts bottle data to standardized units of micromol/kg
0004 %
0005 %  Usage: [b,p,u]  = std_bot(bot,prop,units)
0006 %
0007 % Copywrite 1995  Paul E Robbins
0008 
0009 % first check label strings for lower case
0010 units = upper(units);
0011 prop = upper(prop);
0012 
0013 % check for strings in non standard format
0014 for i = 1:size(units,1)
0015   if strcmp(units(i,:),'  DBARS')
0016      units(i,:) = '   DBAR';
0017   end    
0018   if strcmp(units(i,:),'  PM/KG')
0019      units(i,:) = 'PMOL/KG';
0020   end    
0021 end
0022 
0023 itheta = 0; isalt = 0; 
0024 % compute density
0025 for i = 1:size(prop,1)
0026   if strcmp(prop(i,:),' THETA')
0027     itheta = i;
0028   end
0029   if strcmp(prop(i,:),'SALNTY')
0030     isalt = i;
0031   end
0032 end    
0033 
0034 if itheta == 0 | isalt == 0
0035   disp(['Unable to locate Theta and Salt for nutrient conversions'])
0036 else
0037   % check for units in non-standard units
0038   for i = 1:size(units,1)
0039     if strcmp(units(i,:),'   ML/L')
0040       xx = ox_units(bot(:,i),bot(:,isalt),bot(:,itheta));
0041       bot(:,i) = xx;
0042       units(i,:) = 'UMOL/KG';
0043       disp(['  Converted ',prop(i,:),' from ml/l to umol/kg'])
0044     end        
0045     if strcmp(units(i,:),' UMOL/L') | strcmp(units(i,:),'UMOL/L ')
0046       xx = nut_units(bot(:,i),bot(:,isalt));
0047       bot(:,i) = xx;
0048       units(i,:) = 'UMOL/KG';
0049       disp(['  Converted ',prop(i,:),' from umol/l to umol/kg'])
0050     end        
0051   end
0052 end
0053 
0054

Generated on Wed 30-Nov-2005 15:40:09 by m2html © 2003