clear all
close all


%HSE
load group2_imm_Lu_towards_sun_03-HSE187i; 

for ii=1:137
    med_HSE(ii)=median(radiodata(ii,:)); 
end 
wvl_HSE=wvl;

clear radiodata 
clear wvl

%HPL
load group2_imm_Lu_towards_sun_03-HPL174f; 
for ii=1:137
    med_HPL(ii)=median(radiodata(ii,:)); 
end
wvl_HPL=wvl; 
int_HPL_radiodata=interp1(wvl_HSE, med_HPL, wvl_HPL,'linear'); 
clear radiodata 
clear wvl

%HSE dark
load group2_imm_Lu_towards_sun_03-HED187i; 

for ii=1:137
    med_HSE_dark(ii)=median(radiodata(ii,:)); 
end 
clear radiodata 
clear wvl

%HPL dark
load group2_imm_Lu_towards_sun_03-PLD174f; 
for ii=1:137
    med_HPL_dark(ii)=median(radiodata(ii,:)); 
end
int_HPL_dark_radiodata=interp1(wvl_HSE, med_HPL_dark, wvl_HPL,'linear'); 
clear radiodata 
clear wvl

Ed=med_HSE-med_HSE_dark;
Lu=int_HPL_radiodata-int_HPL_dark_radiodata; 

figure 
plot (wvl_HSE, Ed); hold on
plot (wvl_HSE, Lu) 


