sc1 = 2;
yr1 = 1981;
doy1 = 1;
doy2 = 1;
stepwise = 0;
%-----------------------------------------
%if stepwise == 0
array = dlmread('fData_rho.txt','',1,0);
%end
%if stepwise == 1
%array = dlmread('f_stepwiseData.txt','',1,0);
%end
%-----------------------------------------

sc = array(:,1);
fYr = array(:,2);
f = array(:,3);
fm = array(:,4);
fp = array(:,5);
fmod = array(:,6);

[year,doy,hr,mn,sec] = fYear2Date(fYr);

fDoy = doy + ( hr + (mn + sec/60)/60 )/24;

fYr1 = date2fYear(yr1,doy1,0,0,0);
fYr2 = date2fYear(yr1,doy2,0,0,0);

iSel = find( fYr>=fYr1 & fYr<=fYr2 & sc==sc1 );
fDoyS = fDoy(iSel);
fS = f(iSel);
fmS = fm(iSel);
fpS = fp(iSel);
fmodS = fmod(iSel);

ss= get(0,'ScreenSize');
ss3 = ss(3);
ss4 = ss(4);
set(0,'DefaultFigurePosition',[0.03*ss3 0.6*ss4 0.35*ss3 0.3*ss4]);
  
figure()

plot(fDoyS,fmodS,'r')
hold on
errorbar(fDoyS,fS,fS-fmS,fpS-fS,'*-')
hold off
xlim([doy1 doy2])
title([num2str(yr1) ' GOES ' num2str(sc1) '  stepwise on: ' num2str(stepwise)])
xlabel('DOY')
ylabel('f_1/f_3')
