%BB2F processing script.  
function [dat]=rd_BB2F(fnam)

%input filename of whole data
%BB2Ffile = [fnam];
%BB2Ffile = ['filtSW_bb2f.TXT'];

%loadfile = (['load ', BB2Ffile, ';']);
%loadfile = (['data = dlmread(''', BB2Ffile, ''', ''/t'', 0, 0);']);
%eval(loadfile);
%data = port1; %change file name to data
%load fnam data -ASCII;
%extract needed data into seperate columns
data=load(fnam);
redVSF = data(:,6);
blueVSF = data(:,4);
fl = data(:,7);
temp = data(:,8);
dat = [blueVSF, redVSF, fl,temp];
%apply WETLabs conversion from counts to units
%redVSF = (redVSF - 113.5667) * 2.948e-06;
%blueVSF = (blueVSF - 52.83333) * 2.199e-05;
%fl = (fl - 55.6) * 0.01713;

%apply WETLabs temperature correction
%redVSF = redVSF./(0.8638.*(temp/548.6)+0.1307);
%blueVSF = blueVSF./(-0.2659.*(temp/548.6)+1.2645);
%BB2Ffl = fl./(0.4333.*(temp/554.7)+0.568);

%convert VSF to bb total (see Boss & Pegau, 2001):
%redscat = redVSF *pi*1.1;
%bluescat = blueVSF *pi*1.1;

%combine red and blue scatter into one dataset
%dat = [redscat, bluescat, BB2Ffl];



