% This function find correction parameters for salinity for a data file x98*****.dat

function para = find_para(fname,var)

if (strcmp(var,'sal'))
  load '/home/xuri/auv/data-original/correct_sl_lin.dat'
  paras = correct_sl_lin;
elseif (strcmp(var,'flu'))
  load '/home/xuri/auv/data-original/correct_fl_met3.dat'
  paras = correct_fl_met3;
elseif (strcmp(var,'bac'))
  load '/home/xuri/auv/data-original/correct_bac_met3.dat'
  paras = correct_bac_met3;
end
 
fn = paras(:,1);

r = find(fname == fn);

if (isempty(r))
  para = 0;
else
  para = paras(r,2:4);
end

return
   
