;+
; NAME:
;     plot_xrt_hk_value
;
;
; PURPOSE:
;     plot hk data gathered by get_xrt_hk_value
;
;
; CALLING SEQUENCE:
;     
;     plot_xt_hk_data, data_str, start_time, end_time, ymax, ymin
;
; INPUTS:
;
;     data_str: structure from get_xrt_hk_value
;     start_time: Start time for plotting
;     end_time: End time for plotting
;     ymax, ymin: max and min values for plotting
;
;
; KEYWORD PARAMETERS:
;
;
; OUTPUTS:
;
;
; PROCEDURE:
;     
;     plot_xrt_hk_value, data_out, '1-oct-2008','1-nov-2008', 7, 0 
;
;
; MODIFICATION HISTORY:
;     written 2008-11-13 KKR
;-

pro plot_xrt_hk_value, hk_key, data_str, start_time, end_time, ymax, ymin

  end_sec = anytim(end_time)
  start_sec = anytim(start_time)

  utplot,[start_sec,end_sec],[ymin,ymax],/nodata,ytit=hk_key,$
         ystyle=1,timerange=[start_sec,end_sec],yrange=[ymin,ymax], yminor=1,$
         charsize=1.5

  nfiles = data_str.n_elements

  for i=0,nfiles-1 do begin
     t1='new_time=data_str.time'+trim(i)
     d1='out_hk_val=data_str.data'+trim(i)
     t11=execute(t1)
     d11=execute(d1)

     outplot,anytim(new_time),out_hk_val,psym=0,linestyle=0

     ;aa = out_hk_val - shift(out_hk_val,1)
     ;ss = where(aa ne 0, count)
     ;if (count gt 1) then begin
     ;  for ii = 1,(count-1) do print, new_time[ss[ii]], out_hk_val[ss[ii]]
     ;endif
  endfor

end
