FUNCTION plot_fluximages, astruct, vname, $
THUMBSIZE=THUMBSIZE, FRAME=FRAME, $
XSIZE=XSIZE, YSIZE=YSIZE, GIF=GIF, REPORT=REPORT,$
TSTART=TSTART,TSTOP=TSTOP,NONOISE=NONOISE,$
CDAWEB=CDAWEB,DEBUG=DEBUG,COLORBAR=COLORBAR, $
SMOOTH=SMOOTH
w = where(tag_names(astruct) eq strupcase(vname),wc)
if (wc eq 0) then begin
print,'ERROR=No variable with the name:',vname,' in param 1!' & return,-1
endif else vnum = w[0]
Zvar = astruct.(vnum)
if keyword_set(COLORBAR) then COLORBAR=1L else COLORBAR=0L
if COLORBAR then xco=100
if keyword_set(SMOOTH) then SMOOTH=1L else SMOOTH=0L
a = tagindex('DISPLAY_TYPE',tag_names(astruct.(vnum)))
if(a[0] ne -1) then display= astruct.(vnum).DISPLAY_TYPE $
else begin
print, 'ERROR= No DISPLAY_TYPE attribute for variable'
endelse
ipts=parse_display_type(display)
keywords=str_sep(display,'>')
wc=where(keywords eq 'THUMBSIZE',wcn)
if(wcn ne 0) then THUMBSIZE = fix(keywords[wc[0]+1])
if keyword_set(REPORT) then reportflag=1L else reportflag=0L
a = size(astruct.(vnum))
if (a[n_elements(a)-2] ne 8) then begin
print,'ERROR= 1st parameter to plot_images not a structure' & return,-1
endif else begin
a = tagindex('DAT',tag_names(astruct.(vnum)))
if (a[0] ne -1) then idat = astruct.(vnum).DAT $
else begin
a = tagindex('HANDLE',tag_names(astruct.(vnum)))
if (a[0] ne -1) then handle_value,astruct.(vnum).HANDLE,idat $
else begin
print,'ERROR= 1st parameter does not have DAT or HANDLE tag' & return,-1
endelse
endelse
endelse
b = astruct.(vnum).DEPEND_0 & c = tagindex(b[0],tag_names(astruct))
d = tagindex('DAT',tag_names(astruct.(c)))
if (d[0] ne -1) then edat = astruct.(c).DAT $
else begin
d = tagindex('HANDLE',tag_names(astruct.(c)))
if (d[0] ne -1) then handle_value,astruct.(c).HANDLE,edat $
else begin
print,'ERROR= Time parameter does not have DAT or HANDLE tag' & return,-1
endelse
endelse
var_names = tag_names(astruct)
found = where('GCI_POS' eq var_names, fnd_cnt)
if (fnd_cnt ge 1) then begin
var_index = found[0]
d = tagindex('DAT',tag_names(astruct.(var_index)))
if (d[0] ne -1) then pos_dat = astruct.(var_index).DAT $
else begin
d = tagindex('HANDLE',tag_names(astruct.(var_index)))
if (d[0] ne -1) then handle_value,astruct.(var_index).HANDLE,pos_dat $
else begin
print,'ERROR= GCI_POS parameter does not have DAT or HANDLE tag' & return,-1
endelse
endelse
endif
var_names = tag_names(astruct)
found = where('GCI_SPINAXIS' eq var_names, fnd_cnt)
if (fnd_cnt ge 1) then begin
var_index = found[0]
d = tagindex('DAT',tag_names(astruct.(var_index)))
if (d[0] ne -1) then spin_dat = astruct.(var_index).DAT $
else begin
d = tagindex('HANDLE',tag_names(astruct.(var_index)))
if (d[0] ne -1) then handle_value,astruct.(var_index).HANDLE,spin_dat $
else begin
print,'ERROR= GCI_SPINAXIS parameter does not have DAT or HANDLE tag' & return,-1
endelse
endelse
endif
a = tagindex('SOURCE_NAME',tag_names(astruct.(vnum)))
if (a[0] ne -1) then begin
sn = break_mystring(astruct.(vnum).SOURCE_NAME,delimiter='>')
b = sn[0]
endif else b = ''
a = tagindex('DESCRIPTOR',tag_names(astruct.(vnum)))
if (a[0] ne -1) then b = b + ' ' + astruct.(vnum).DESCRIPTOR
a = tagindex('DATA_TYPE',tag_names(astruct.(vnum)))
if (a[0] ne -1) then b = b + ' ' + astruct.(vnum).DATA_TYPE
a = tagindex('FIELDNAM',tag_names(astruct.(vnum)))
if (a[0] ne -1) then b = b + ' ' + astruct.(vnum).FIELDNAM
window_title = b
if(COLORBAR) then begin
a=tagindex('UNITS',tag_names(astruct.(vnum)))
if(a[0] ne -1) then ctitle = astruct.(vnum).UNITS else ctitle=''
endif
if keyword_set(XSIZE) then xs=XSIZE else xs=512
if keyword_set(YSIZE) then ys=YSIZE else ys=512
vkluge=0
tip = tagindex('PLATFORM',tag_names(astruct.(vnum)))
if (tip ne -1) then begin
if (astruct.(vnum).platform eq 'Viking') then vkluge=1
endif
tip = tagindex('DESCRIPTOR',tag_names(astruct.(vnum)))
if (tip ne -1) then begin
descriptor=str_sep(astruct.(vnum).descriptor,'>')
endif
isize = size(idat)
if (isize[0] eq 2) then n_images=1 else n_images=isize[isize[0]]
if (n_images eq 1) then FRAME=1
if keyword_set(FRAME) then begin
if ((FRAME ge 1)AND(FRAME le n_images)) then begin
idat = idat[*,*,(FRAME-1)]
idat = reform(idat)
if (vkluge)then idat = rotate(idat,7)
isize = size(idat)
r1 = 450./isize[1]
r2 = 450./isize[2]
xs = ceil(isize[1]*r1)+50
ys = ceil(isize[2]*r2)+15
a = tagindex('VALIDMIN',tag_names(astruct.(vnum)))
if (a[0] ne -1) then begin & b=size(astruct.(vnum).VALIDMIN)
if (b[0] eq 0) then zvmin = astruct.(vnum).VALIDMIN $
else begin
zvmin = 0
print,'WARNING=Unable to determine validmin for ',vname
endelse
endif
a = tagindex('VALIDMAX',tag_names(astruct.(vnum)))
if (a[0] ne -1) then begin & b=size(astruct.(vnum).VALIDMAX)
if (b[0] eq 0) then zvmax = astruct.(vnum).VALIDMAX $
else begin
zvmax = 2000
print,'WARNING=Unable to determine validmax for ',vname
endelse
endif
a = tagindex('FILLVAL',tag_names(astruct.(vnum)))
if (a[0] ne -1) then begin & b=size(astruct.(vnum).FILLVAL)
if (b[0] eq 0) then zfill = astruct.(vnum).FILLVAL $
else begin
zfill = 2000
print,'WARNING=Unable to determine Image fill value for ',vname
endelse
endif
if keyword_set(DEBUG) then begin
print, 'Image valid min and max: ',zvmin, ' ',zvmax
wmin = min(idat,MAX=wmax)
print, 'Actual min and max of data',wmin,' ', wmax
endif
w = where((idat lt zvmin or idat eq zfill),wc)
if wc gt 0 then begin
if keyword_set(DEBUG) then print, 'Number of values below the valid min = ',wc
print,'WARNING=setting ',wc,' fill values in image data to zvmin...'
idat[w] = zvmin
w = 0
endif
wmin = min(idat,MAX=wmax)
if (wmax lt 1.0 ) then begin
w = where(idat le wmax, wc)
if wc gt 0 then begin
idat[w] = 1.0
if keyword_set(DEBUG) then print, 'valid max lt 1, setting data le to vmax to 1.0'
endif
endif
w = where((idat gt zvmax),wc)
if wc gt 0 then begin
if keyword_set(DEBUG) then print, 'Number of values above the valid max = ',wc
if keyword_set(DEBUG) then print,'WARNING=setting ',wc,' fill values in image data to red...'
diff = zvmax - zvmin
coffset = red_offset(GIF=GIF,diff)
print, 'diff = ',diff, ' coffset = ',coffset
idat[w] = zvmax - coffset
w = 0
endif
if keyword_set(DEBUG) then begin
print, 'Statistics about the data distribution'
w = where(((idat lt zvmax) and (idat ge (zvmax-10))),wc)
if wc gt 0 then print, 'Number of values between ',zvmax,' and ',zvmax-10,' = ',wc
w = where(((idat lt zvmax-10) and (idat ge (zvmax-20))),wc)
if wc gt 0 then print, 'Number of values between ',zvmax-10,' and ',zvmax-20,' = ',wc
w = where(((idat lt zvmax-20) and (idat ge (zvmax-30))),wc)
if wc gt 0 then print, 'Number of values between ',zvmax-20,' and ',zvmax-30,' = ',wc
w = where(((idat lt zvmax-30) and (idat ge (zvmax-40))),wc)
if wc gt 0 then print, 'Number of values between ',zvmax-30,' and ',zvmax-40,' = ',wc
w = where(((idat lt zvmax-40) and (idat ge (zvmax-50))),wc)
if wc gt 0 then print, 'Number of values between ',zvmax-40,' and ',zvmax-50,' = ',wc
w = where(((idat lt zvmax-50) and (idat ge (zvmax-60))),wc)
if wc gt 0 then print, 'Number of values between ',zvmax-50,' and ',zvmax-60,' = ',wc
endif
if keyword_set(NONOISE) then begin
semiMinMax,idat,zvmin,zvmax,/MODIFIED
w = where((idat lt zvmin),wc)
if wc gt 0 then begin
print,'WARNING=filtering values less than 3-sigma from image data...'
idat[w] = zvmin
w = 0
endif
w = where((idat gt zvmax),wc)
if wc gt 0 then begin
print,'WARNING=filtering values greater than 3-sigma from image data...'
diff = zvmax - zvmin
coffset = red_offset(GIF=GIF,diff)
print, 'diff = ',diff, ' coffset = ',coffset
idat[w] = zvmax - coffset
w = 0
endif
endif
idmax=max(idat)
idmin=min(idat)
if keyword_set(GIF) then begin
atags=tag_names(astruct.(vnum))
b = tagindex('LOGICAL_SOURCE',atags)
b1 = tagindex('LOGICAL_FILE_ID',atags)
b2 = tagindex('Logical_file_id',atags)
if (b[0] ne -1) then psrce = strupcase(astruct.(vnum).LOGICAL_SOURCE)
if (b1[0] ne -1) then $
psrce = strupcase(strmid(astruct.(vnum).LOGICAL_FILE_ID,0,9))
if (b2[0] ne -1) then $
psrce = strupcase(strmid(astruct.(vnum).Logical_file_id,0,9))
GIF=strmid(GIF,0,(strpos(GIF,'.gif')))+'_f000.gif'
if(FRAME lt 100) then gifn='0'+strtrim(string(FRAME),2)
if(FRAME lt 10) then gifn='00'+strtrim(string(FRAME),2)
if(FRAME ge 100) then gifn=strtrim(string(FRAME),2)
GIF=strmid(GIF,0,(strpos(GIF,'.gif')-3))+gifn+'.gif'
endif
xmargin=!x.margin
if COLORBAR then begin
if (!x.omargin[1]+!x.margin[1]) lt 14 then !x.margin[1] = 14
!x.margin[1] = 14
endif
temp_gif = gif + strtrim(string(frame-1),2)
case descriptor[0] of
'EUV' : begin
spin = 84.0
polar = 0.6
nocircles = 1
nodipole = 1
nocolorbar = 1
noborder = 1
reverseorder = 1
smooth = 0L
end
'HENA': begin
spin = 120.0
polar = 6.0
nocolorbar = 1
noborder = 1
nocircles = 0
nodipole = 0
reverseorder = 0
smooth = 1L
end
'MENA': begin
spin = 128.0
polar = 4.0
nocolorbar = 1
noborder = 1
nocircles = 0
nodipole = 0
reverseorder = 2
smooth = 0L
end
'LENA': begin
itmp = idat
idat = fltarr(12,12)
idat = itmp[18:29,*]
spin = 96.0
polar = 8.0
nocolorbar = 1
noborder = 1
nocircles = 0
nodipole = 0
reverseorder = 0
smooth = 0L
end
else : begin
print, 'setting spin and polar angles to default'
spin = 84.0
polar = 0.6
smooth = 0L
end
endcase
twin=make_array(2, /integer, value=512)
win=make_array(2, /integer, value=512)
twin[0] = xs - (!x.margin[0]+!x.margin[1]) & twin[1] = ys - (!y.margin[0] + !y.margin[1])
tmax = max(twin)
np = size(idat)
win[0]=fix(tmax/np[1])*np[1]
win[1] = win[0]
print, 'asking for image size of ',win
stat = plot_enaflux(edat[FRAME-1],idat, spin, polar, pos_dat[*,FRAME-1], $
spin_dat[*,FRAME-1], 1, wsize=win, DEBUG=DEBUG,$
noborder=noborder, nocircles=nocircles, nodipole=nodipole, $
nocolorbar=nocolorbar, smooth=smooth, gif=temp_gif, reverseorder=reverseorder)
if (stat ge 0) then begin
read_gif,temp_gif,a,r,g,b
if (gif) then begin
deviceopen,6,fileOutput=GIF,sizeWindow=[win[0]+xco,win[1]+35]
if (reportflag eq 1) then begin
printf,1,'I_GIF=',GIF & close,1
endif
print,'I_GIF=',GIF
endif else begin
window,/FREE,XSIZE=xs+xco,YSIZE=ys+30,TITLE=window_title
endelse
tv, a, 10, 25 ,/device
if COLORBAR then begin
plot,[0,1],[0,1],/noerase,/nodata,xstyle=4,ystyle=4
if (n_elements(cCharSize) eq 0) then cCharSize = 0.
cscale = [idmin, idmax]
xwindow = !x.window
offset = 0.01
colorbar, cscale, ctitle, logZ=logZ, cCharSize=cCharSize, $
position=[!x.window[1]+offset, !y.window[0],$
!x.window[1]+offset+0.03, !y.window[1]],$
fcolor=244, /image
!x.window = xwindow
endif
acolor = !d.table_size
project_subtitle,astruct.(0),window_title,/IMAGE,TIMETAG=edat[FRAME-1]
endif else begin
print, 'plot_enaflux failed'
endelse
if keyword_set(GIF) then begin
deviceclose
cmd = strarr(2)
cmd[0] = "rm"
cmd[1] = temp_gif
spawn, cmd, /noshell
endif
endif
endif else begin
tsize = 140
if (keyword_set(THUMBSIZE)) then begin
tsize = THUMBSIZE
if tsize lt 140 then tsize = 140 else tsize = THUMBSIZE
endif
isize = size(idat)
if (isize[0] eq 2) then begin
nimages = 1 & npixels = double(isize[1]*isize[2])
endif else begin
nimages = isize[isize[0]] & npixels = double(isize[1]*isize[2]*nimages)
endelse
if NOT keyword_set(TSTART) then start_frame = 0 $
else begin
w = where(edat ge TSTART,wc)
if wc eq 0 then begin
print,'ERROR=No image frames after requested start time.' & return,-1
endif else start_frame = w[0]
endelse
if NOT keyword_set(TSTOP) then stop_frame = nimages $
else begin
w = where(edat le TSTOP,wc)
if wc eq 0 then begin
print,'ERROR=No image frames before requested stop time.' & return,-1
endif else stop_frame = w[wc-1]
endelse
if (start_frame gt stop_frame) then no_data_avail = 1L $
else begin
no_data_avail = 0L
if ((start_frame ne 0)OR(stop_frame ne nimages)) then begin
idat = idat[*,*,start_frame:stop_frame]
isize = size(idat)
if (isize[0] eq 2) then nimages = 1 else nimages = isize[isize[0]]
edat = edat[start_frame:stop_frame]
endif
endelse
ncols = xs / tsize & nrows = (nimages / ncols) + 1
label_space = 12
if(tsize > 60) then label_space = 24
boxsize = tsize+label_space
ys = (nrows*boxsize) + 15
if (no_data_avail eq 0) then begin
a = tagindex('VALIDMIN',tag_names(astruct.(vnum)))
if (a[0] ne -1) then begin & b=size(astruct.(vnum).VALIDMIN)
if (b[0] eq 0) then zvmin = astruct.(vnum).VALIDMIN $
else begin
zvmin = 0
print,'WARNING=Unable to determine validmin for ',vname
endelse
endif
a = tagindex('VALIDMAX',tag_names(astruct.(vnum)))
if (a[0] ne -1) then begin & b=size(astruct.(vnum).VALIDMAX)
if (b[0] eq 0) then zvmax = astruct.(vnum).VALIDMAX $
else begin
zvmax = 2000
print,'WARNING=Unable to determine validmax for ',vname
endelse
endif
a = tagindex('FILLVAL',tag_names(astruct.(vnum)))
if (a[0] ne -1) then begin & b=size(astruct.(vnum).FILLVAL)
if (b[0] eq 0) then zfill = astruct.(vnum).FILLVAL $
else begin
zfill = 2000
print,'WARNING=Unable to determine Image fill value for ',vname
endelse
endif
if keyword_set(DEBUG) then begin
print, 'Image valid min and max: ',zvmin, ' ',zvmax
wmin = min(idat,MAX=wmax)
print, 'Actual min and max of data',wmin,' ', wmax
endif
w = where((idat lt zvmin or idat eq zfill),wc)
if wc gt 0 then begin
print,'WARNING=setting ',wc,' fill values in image data to black...'
idat[w] = zvmin
w = 0
if wc eq npixels then print,'WARNING=All data outside min/max!!'
endif
for t = 0, nimages-1 do begin
image = idat[*,*,t]
image_max = max(image)
if (image_max lt 1.0 ) then begin
w = where(image le image_max, wc)
if wc gt 0 then begin
image[w] = 1.0
if keyword_set(DEBUG) then print, 'image max lt 1, setting data le to the image max to 1.0 for IMAGE # ',t
endif
endif
idat[*,*,t] = image
endfor
w = where((idat gt zvmax),wc)
if wc gt 0 then begin
if keyword_set(DEBUG) then print,'WARNING=setting ',wc,' fill values in image data to red...'
diff = zvmax - zvmin
coffset = red_offset(GIF=GIF,diff)
print, 'diff = ',diff, ' coffset = ',coffset
idat[w] = zvmax - coffset
w = 0
if wc eq npixels then print,'WARNING=All data outside min/max!!'
endif
if keyword_set(DEBUG) then begin
print, 'Statistics about the data distribution'
w = where(((idat lt zvmax) and (idat ge (zvmax-10))),wc)
if wc gt 0 then print, 'Number of values between ',zvmax,' and ',zvmax-10,' = ',wc
w = where(((idat lt zvmax-10) and (idat ge (zvmax-20))),wc)
if wc gt 0 then print, 'Number of values between ',zvmax-10,' and ',zvmax-20,' = ',wc
w = where(((idat lt zvmax-20) and (idat ge (zvmax-30))),wc)
if wc gt 0 then print, 'Number of values between ',zvmax-20,' and ',zvmax-30,' = ',wc
w = where(((idat lt zvmax-30) and (idat ge (zvmax-40))),wc)
if wc gt 0 then print, 'Number of values between ',zvmax-30,' and ',zvmax-40,' = ',wc
w = where(((idat lt zvmax-40) and (idat ge (zvmax-50))),wc)
if wc gt 0 then print, 'Number of values between ',zvmax-40,' and ',zvmax-50,' = ',wc
w = where(((idat lt zvmax-50) and (idat ge (zvmax-60))),wc)
if wc gt 0 then print, 'Number of values between ',zvmax-50,' and ',zvmax-60,' = ',wc
endif
if keyword_set(NONOISE) then begin
print, 'before semiminmax min and max = ', zvmin, zvmax
semiMinMax,idat,zvmin,zvmax,/MODIFIED
w = where((idat lt zvmin),wc)
if wc gt 0 then begin
print,'WARNING=filtering values less than 3-sigma from image data...'
idat[w] = zvmin
w = 0
endif
w = where((idat gt zvmax),wc)
if wc gt 0 then begin
print,'WARNING=filtering values greater than 3-sigma from image data...'
diff = zvmax - zvmin
coffset = red_offset(GIF=GIF,diff)
print, 'diff = ',diff, ' coffset = ',coffset
idat[w] = zvmax - coffset
w = 0
endif
endif
idmax=max(idat) & idmin=min(idat)
if keyword_set(DEBUG) then begin
print, '!d.table_size = ',!d.table_size
print, 'min and max after filtering = ',idmin, ' ', idmax
endif
case descriptor[0] of
'EUV' : begin
spin = 84.0
polar = 0.6
nocircles = 1
nodipole = 1
nocolorbar = 1
noborder = 1
reverseorder = 0
end
'HENA': begin
spin = 120.0
polar = 6.0
nocolorbar = 1
noborder = 1
nocircles = 0
nodipole = 0
reverseorder = 0
end
'MENA': begin
spin = 128.0
polar = 4.0
nocolorbar = 1
noborder = 1
nocircles = 0
nodipole = 0
reverseorder = 2
end
'LENA': begin
itmp = idat
idat = fltarr(12,12,nimages)
for numgif = 0, nimages-1 do begin
idat[*,*,numgif] = itmp[18:29,*,numgif]
endfor
spin = 96.0
polar = 8.0
nocolorbar = 1
noborder = 1
nocircles = 0
nodipole = 0
reverseorder = 0
end
else : begin
print, 'setting spin and polar angles to default'
spin = 84.0
polar = 0.6
end
endcase
for numgif = 0, nimages-1 do begin
win=make_array(2, /integer, value=tsize)
temp_gif = gif + strtrim(string(numgif),2)
stat = plot_enaflux(edat[numgif],idat[*,*,numgif], spin, polar, $
pos_dat[*,numgif], spin_dat[*,numgif], 1, wsize=win, DEBUG=DEBUG,$
noborder=noborder, nocircles=nocircles, nodipole=nodipole, $
nocolorbar=nocolorbar, smooth=smooth, gif=temp_gif, reverseorder=reverseorder)
if (stat ge 0) then begin
if (n_elements(temp_gifs) eq 0) then temp_gifs = temp_gif else temp_gifs = [temp_gifs,temp_gif]
endif else begin
print, 'Gif not generated for gif number ',numgif,' and date ',edat[numgif]
endelse
endfor
nimages = n_elements(temp_gifs)
nrows = (nimages / ncols) + 1
ys = (nrows*boxsize) + 15
if keyword_set(GIF) then begin
deviceopen,6,fileOutput=GIF,sizeWindow=[xs+xco,ys+40]
if (no_data_avail eq 0) then begin
if(reportflag eq 1) then printf,1,'IMAGE=',GIF
print,'IMAGE=',GIF
endif else begin
if(reportflag eq 1) then printf,1,'I_GIF=',GIF
print,'I_GIF=',GIF
endelse
endif else begin
window,/FREE,XSIZE=xs+xco,YSIZE=ys+40,TITLE=window_title
endelse
xmargin=!x.margin
if COLORBAR then begin
if (!x.omargin[1]+!x.margin[1]) lt 14 then !x.margin[1] = 14
!x.margin[1] = 14
plot,[0,1],[0,1],/noerase,/nodata,xstyle=4,ystyle=4
endif
if (vkluge)then for j=0,nimages-1 do idat[*,*,j] = rotate(idat[*,*,j],7)
irow=0
icol=0
for j=0,nimages-1 do begin
if(icol eq ncols) then begin
icol=0
irow=irow+1
endif
xpos=icol*tsize
ypos=ys-(irow*tsize+30)
if (irow gt 0) then ypos = ypos-(label_space*irow)
xthb=tsize
ythb=tsize+label_space
xsp=float(xthb)/float(xs+80)
ysp=float(ythb)/float(ys+30)
yi= 1.0 - 10.0/ys
x0i=0.0095
y0i=yi-ysp
x1i=0.0095+xsp
y1i=yi
x0=x0i+icol*xsp
y0=y0i-irow*ysp
x1=x1i+icol*xsp
y1=y1i-irow*ysp
xpimg=xthb
ypimg=ythb-label_space
xspm=float(xthb)
yspm=float(ythb-label_space)
yi= (ys+30) - label_space
x0i=2.5
y0i=yi-yspm
x1i=2.5+xspm
y1i=yi
x0=x0i+icol*xspm
y0=y0i-(irow*yspm+irow*label_space)
x1=x1i+icol*xspm
y1=y1i-(irow*yspm+irow*label_space)
position=[x0,y0,x1,y1]
xpos=x0
ypos=y0
read_gif,temp_gifs[j],a,r,g,b
tv, a, xpos, ypos, /DEVICE
foreground = !d.table_size-1
if (j eq 0) then begin
prevdate = decode_cdfepoch(edat[j])
endif else prevdate = decode_cdfepoch(edat[j-1])
edate = decode_cdfepoch(edat[j])
shortdate = strmid(edate, 10, strlen(edate))
if ( tsize gt 50 ) then begin
xyouts, xpos, ypos-10, edate, color=foreground, charsize=1.0,/DEVICE
endif else xyouts, xpos, ypos-10, shortdate, color=foreground, charsize=1.2,/DEVICE
icol=icol+1
cmd = strarr(2)
cmd[0] = "rm"
cmd[1] = temp_gifs[j]
spawn, cmd, /noshell
endfor
if ((reportflag eq 1)AND(no_data_avail eq 0)) then begin
PRINTF,1,'VARNAME=',astruct.(vnum).varname
PRINTF,1,'NUMFRAMES=',nimages
PRINTF,1,'NUMROWS=',nrows & PRINTF,1,'NUMCOLS=',ncols
PRINT,1,'THUMB_HEIGHT=',tsize+label_space
PRINT,1,'THUMB_WIDTH=',tsize
PRINTF,1,'START_REC=',start_frame
PRINTF,1,'FLUX_IMAGE=1'
endif
if (no_data_avail eq 0) then begin
PRINT,'VARNAME=',astruct.(vnum).varname
PRINT,'NUMFRAMES=',nimages
PRINT,'NUMROWS=',nrows & PRINT,'NUMCOLS=',ncols
PRINT,'THUMB_HEIGHT=',tsize+label_space
PRINT,'THUMB_WIDTH=',tsize
PRINT,'START_REC=',start_frame
PRINT,'FLUX_IMAGE=1'
endif
if ((keyword_set(CDAWEB))AND(no_data_avail eq 0)) then begin
fname = GIF + '.sav' & save_mystruct,astruct,fname
endif
project_subtitle,astruct.(0),window_title,/IMAGE, $
TIMETAG=[edat[0],edat[nimages-1]]
if COLORBAR then begin
if (n_elements(cCharSize) eq 0) then cCharSize = 0.
cscale = [idmin, idmax]
xwindow = !x.window
!x.window[1]=0.858
!y.window=[0.1,0.9]
offset = 0.01
colorbar, cscale, ctitle, logZ=0, cCharSize=cCharSize, $
position=[!x.window[1]+offset, !y.window[0],$
!x.window[1]+offset+0.03, !y.window[1]],$
fcolor=244, /image
!x.window = xwindow
endif
!x.margin=xmargin
if keyword_set(GIF) then deviceclose
endif else begin
print,'STATUS=No data in specified time period.'
if keyword_set(GIF) then begin
xyouts,xs/2,ys/2,/device,alignment=0.5,color=244,$
'NO DATA IN SPECIFIED TIME PERIOD'
deviceclose
endif else begin
xyouts,xs/2,ys/2,/device,alignment=0.5,'NO DATA IN SPECIFIED TIME PERIOD'
endelse
endelse
endelse
if keyword_set(GIF) then device,/close
return,0
end