;$Id: pgrah.pro,v 1.2 2020/10/26 17:30:35 brandenb Exp $
;
power,'_GWh','hel_GWh',k=k,spec1=grah1,spec2=grah2,i=n,tt=t,/noplot,/lks
nt=n_elements(t)
;
!p.multi=[0,1,3]
default,t1_grah,2.5
default,t2_grah,4.5
good=where(t ge t1_grah and t le t2_grah)
if good[0] eq -1 then begin
  it1_grah=nt-2
  it2_grah=nt-2
endif else begin
  it1_grah=min(good)
  it2_grah=max(good)
endelse
print,'AXEL: t1_grah, t2_grah=',t(it1_grah),t(it2_grah)
;
;plot_oi,k[1:*],grah2m[1:*]/grah1m[1:*],yr=[0,.4]
;
grahr=grah2/grah1
pc_error_range_array,t[it1_grah:*],transpose(grahr[*,it1_grah:*]),mean=grahrm,error=grahre
pc_error_range_array,t[it1_grah:*],transpose(grah1[*,it1_grah:*]),mean=grah1m,error=grah1e
pc_error_range_array,t[it1_grah:*],transpose(grah2[*,it1_grah:*]),mean=grah2m,error=grah2e
plot_oo,k[1:*],grah2m[1:*]
errplot,k[1:*],grah2m[1:*]-grah2e[1:*],grah2m[1:*]+grah2e[1:*]
;
plot_oo,k[1:*],grahrm[1:*]
errplot,k[1:*],grahrm[1:*]-grahre[1:*],grahrm[1:*]+grahre[1:*]
;
plot_oi,k[1:*],grahrm[1:*],yr=[-.1,1] 
errplot,k[1:*],grahrm[1:*]-grahre[1:*],grahrm[1:*]+grahre[1:*]
;
save,file='grahm.sav',t,t1_grah,it1_grah,k, grahrm,grahre, grah1m,grah1e, grah2m,grah2e
spawn,'cvs add -kb grahm.sav'
END
