% function [wvl,sky250,water251,ed186,median250,median251,median186,temp250,temp251,temp186]=read_darksubtract_hypersass(filestring)
dark250nm='-HLD250d.dat';
dark251nm='-HLD251d.dat';
dark186nm='-PED186f.dat';
data250nm='-Hsl250d.dat';
data251nm='-Hsl251d.dat';
data186nm='-HPE186f.dat';
dataends={'dark250','dark251','dark186','data250','data251','data186'};
dataproc={'sky250','water251','ed186'};
tempproc={'temp250','temp251','temp186'};
medianproc={'median250','median251','median186'};
errproc={'err250','err251','err186'};
for i=1:6
    fileend=eval([dataends{i},'nm']);
    filename=[filestring,fileend];
    [wvl,data,~,temp]=read_radiometer(filename);
    eval([dataends{i},'=data;']);
    if ismember(i,[2 4 6])
    eval([tempproc{i./2},'=temp;']);
    end
end
for i=4:6
    eval([dataproc{i-3},'=',dataends{i},';']);
    eval([errproc{i-3},'=std(transpose(',dataends{i},'))./sqrt(size(',dataends{i},',1))+std(transpose(',dataends{i-3},'))./sqrt(size(',dataends{i-3},',1));'])
end
median250=median(transpose(data250))-median(transpose(dark250));
median251=median(transpose(data251))-median(transpose(dark251));
median186=median(transpose(data186))-median(transpose(dark186));
rrs=(median251-(median250.*0.28))./median186;
for i=1:3
eval([dataends{i+3},identifier,'=',dataends{i+3},';'])
eval([tempproc{i},identifier,'=',tempproc{i},';'])
eval([medianproc{i},identifier,'=',medianproc{i},';'])
eval([errproc{i},identifier,'=',errproc{i},';'])
eval([dataends{i},identifier,'=',dataends{i},';'])
end
eval(['rrs',identifier,'=rrs;']);