pro plothenaimf, ps = ps
  restore, '/project/image/dacsoft/pontus/inversions/datasets/doy2000303/' + $
'doy303_27_39kev_1501_ret.sav'
  jion1 = jion
;  restore, '/project/image/dacsoft/pontus/inversions/datasets/doy2001305/' + $
;'doy305_27_39kev_1215_ret.sav'

;  jion2 = jion
  min = 5
  max = 7
  if keyword_set(ps) then openps, /la
  colors, /w
  datacolors = !d.table_size-2
  if !d.name eq 'X' then window, xsize = 900, ysize = 700
  position = [.25, .05, .65, .6]
;  position = [.05, .05, .45, .6]
  elmax = 12
  elcl = 10
  plotion, jion1, /log, min = min, max = max, position = position, $
    /noerase, elmax = elmax, elc = elcl
;  position = [.55, .05, .95, .6]
;  plotion, jion2, /log, min = min, max = max, position = position, $
;    /noerase, elmax = elmax, elc = elcl

  ;; IMF
  filename = '/project/image/serv8/imf/ace_level0_20001028.txt'
  imf = processimf0(filename)
  position = [.25, .65, .75, .9]
  year = 2000d
  days_per_year = days_per_year(year)
  doy = 303d
  h0 = 15d
  m0 = 01d
  h1 = 15d
  m1 = 01d

  t0 = year+(doy-1)/days_per_year+13./(24.*days_per_year) +.9/(60.*24.*days_per_year)
  t1 = year+(doy-1)/days_per_year+17./(24.*days_per_year)
  xrange = [t0, t1]
  yrange = [-40, 40]
  !p.charsize = 1.5
  !p.charthick = 3
  !p.thick = 3
  plot, imf.t, imf.bz, xtickf = 'year2hhmm', /noerase, $
    position = position, ystyle = 8, xstyle = 1, $
    xrange = xrange, yrange = yrange, psym = 10, $
    ytitle = 'ACE IMF B!Dz!N, nT (RED)', $
    xticks = 4, xminor = 6, $
    xthick = !p.charthick, ythick = !p.charthick
  axis, /yax, color = 230, ytitle = 'ACE IMF B!Dy!N, nT (RED)', $
    yrange = yrange, ythick = !p.charthick
  oplot, imf.t, imf.by, color = 230, psym = 10
  ;; Vertical bar
  t = year+(doy-1)/days_per_year+h0/(24.*days_per_year)+ $
    m0/(60.*24.*days_per_year)
  plots, [t, t], yrange, /data
  t = year+(doy-1)/days_per_year+h1/(24.*days_per_year)+ $
    m1/(60.*24.*days_per_year)
  plots, [t, t], yrange, /data

  xyouts, .5, .95, '29 OCT 2000', charsize = 3, align = .5, /norm
  str = string(h0, f = '(I2.2)')+':'+string(m0, f = '(I2.2)')+ $
    ' UT 27-39 keV'

  xyouts, .5, .05, str, align = .5, /norm

;  str = string(h0, f = '(I2.2)')+':'+string(m0, f = '(I2.2)')+ $
;    ' UT 27-39 keV'
;  xyouts, .25, .05, str, align = .5, /norm
;  str = string(h1, f = '(I2.2)')+':'+string(m1, f = '(I2.2)')+ $
;    ' UT 27-39 keV'
;  xyouts, .75, .05, str, align = .5, /norm

  position = [.4, .1, .6, .12]
  colorbar, pos = position, title = 'ION FLUX (cm!E2!N sr s keV)!E-1!N', $
    min = min, max = max, ps = (!d.name eq 'PS'), ncolors = datacolors, $
    color = !p.color
  
  if keyword_set(ps) then closeps

  !p.charsize = 1
  !p.charthick = 1
  !p.thick = 1
  
  return
end
