function [wvl,radiodata,darkavg,temp]=read_radiometer(filename)
% Reads radiometer data.  Not sure what the name of the particular
% radiometer instrument is.  Sorry.
%
% wvl=wavlength vector
% radiodata=data array
% darkavg=average dark counts
% temp=temperature
% peakloccand=candidates for peak location.  look at plot to decide which
% is right. (removed)
% 
% ENA 07122013
radiometerdat=importdata(filename);
headerln=radiometerdat{1};
headertxt=textscan(headerln,'%s','Delimiter',',');
headertext=headertxt{1};
wvl=zeros(length(headertext)-11,1);
for i=4:length(headertext)-8
    wvl(i-3)=str2double(headertext{i}(4:9));
end
radiodata=zeros(length(wvl),length(radiometerdat)-1);
temp=zeros(length(radiometerdat)-1,1);
darkcount=temp;
darkavg=temp;
for i=2:length(radiometerdat)
    tempdata=textscan(radiometerdat{i},'%f','Delimiter',',');
    radiodata(:,i-1)=tempdata{1}(4:length(wvl)+3);
    temp(i-1)=tempdata{1}(end-6);
    darkavg(i-1)=tempdata{1}(end-7);
end
