function [T_Ad,adcSamp_ID]=adcproc

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% This section sets up where to look and for what files.
PATH=('\thesis\astar\');
adcFILE=('eqpac0801B.csv');

%other stuff one might change, so I keep it at the top.
nb=(5); %the number of blanks

%end of user specified variables.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  Process the clevland spec files
%%%%%%%%%%%%%%%%%%%%%%%%%%%

%open the Clevland files for reading
adcfid=fopen([PATH,adcFILE]);     %the () enclose a function, or an array. General puropose brackets

%%%%%%%%%%%%%%%%%%%%%%
%now Total Ad.
%I just copy the above, and run again with some changes to preseve the data I want to keep.


adcSamp_ID=fgetl(adcfid);        %store the first line, its got info I may need
adcHeader=fgetl(adcfid);         %what the hell, store this one too.

c=1;                             %re-initialize some vars that I need to do tests and counts.
xit=1;

%load in the data
while xit==1
  strbuf = fgetl(adcfid);
  if strbuf(1:3)==('350');               % hey! there be other crap in the file after the data!
    xit=2;                          % so test strbuf to see if its an empty line, if so end.
    disp(['exit ad_clevland loop on row number : ',num2str(c)])
  else                              % its not empty, so there must still be data there
    adcdata(c,:)= str2num(strbuf);  %put all (:) the numbers (col's) from strbuf in row 'c' 
  end
  c=c+1; 
end

% average the blanks.
adc_blank=adcdata(:,2:2:(2*nb));    %every other row from the second to the (2 * number of blanks) row.
adc_blank=mean(adc_blank,2);        %mean in the horizontal direction.. or median(ap_blank,2)..

[o,p]=size(adcdata);                %how many rows and cols?
adcABS=adcdata(:,((2*nb)+2):2:p);

%subtract blank from absoute values.
for j=1:o
  adcCOR(j,:)=adcABS(j,:)-adc_blank(j,1); 
end

%find 750nm
k=near(adcdata(:,1),750,1);          %its not exactly 750 so I use "near" instead of "find"
nm750=adcCOR(k,:);                   % So now I have a ROW of 750nm data

%normalize it all to 750
for ii=1:length(nm750)
  Odd(:,ii)=adcCOR(:,ii)-nm750(ii);
end                                  % 

%now its all loaded and corrected, lets do the math.
Ocd   =  (0.378*Odd)+(0.523*Odd.^2);
T_Ad =  [adcdata(:,1),((2.303*Ocd*0.000355324)/(0.00105))];
%wasnt that hard?