;+
;PROCEDURE:	load_stb_l1_let
;PURPOSE:	
;   loads STEREO/IMPACT LET high resolution data for "tplot".
;
;INPUTS:	none, but will call "timespan" if time
;		range is not already set.
;KEYWORDS:
;  TIME_RANGE:  2 element vector specifying the time range
;  DATA:        Data returned in this named variable.
;  NODATA:	Returns 0 if data exists for time range, otherwise returns 1.
;  PREFIX:	(string) prefix for tplot variables.  Default is 'sta_'
;  NAME:	(string) name for tplot variables. Default is 'sta_let'
;  MASTERFILE:	(string) full filename of master file.
;SEE ALSO: 
;  "make_cdf_index","loadcdf","loadcdfstr","loadallcdf"
;
;CREATED BY:	Peter Schroeder
;LAST MODIFIED:	11/27/06
;-


pro load_stb_l1_let,time_range=trange,data=d,  $
  nodata=nodat, $
  prefix = prefix, $
  name = bname, $
  masterfile=masterfile, novardata=nvd
  
if not keyword_set(masterfile) then masterfile = 'STB_L1U'
;cdfnames = ['B_HGRTN']
ppx = 'B'
myformat = getenv('STB_L1U')+'/STB_L1_LET_*.cdf'

d=0
nodat = 0

loadallcdf,myformat,time_range=trange, novarnames=novarnames, $
    cdfnames=cdfnames,data=d,res =res, tplot_name='stb_let'

if keyword_set(d) eq 0 then begin
   message,'No STB LET data during this time.',/info
   nodat = 1
  return
endif

H_energies = [2., 2.45, 2.95, 3.4, 3.8, 4.25, 4.75, 5.5, 7., 9., 11., 13.5]

store_data,'stb_let_H_UNSEC_FLUX',data={x: d.time, y: transpose(d.H_UNSEC_FLUX), $
   v: H_energies}, dlim={ylog: 1, spec: 1}
end