Pro thm_fftfbk_overplot, date, device = device, dont_delete_data = dont_delete_data, $
directory = directory, makepng = makepng
probe_list = ['a', 'b', 'c', 'd', 'e']
inner_probes = ['a', 'd', 'e']
outer_probes = ['b', 'c']
If(~keyword_set(dont_delete_data)) Then del_data, '*'
If(~keyword_set(date)) Then Begin
dprint, 'Date must be set to generate fft-fbk overview plots'
Return
Endif
If(keyword_set(directory)) Then dir = directory Else dir = './'
If(keyword_set(device)) Then set_plot, device
date2 = time_string(date)
timespan, date2, 1
year = string(strmid(date2, 0, 4))
month = string(strmid(date2, 5, 2))
day = string(strmid(date2, 8, 2))
thm_load_state, /get_support_data
thm_load_fbk
thm_load_fft
inner_probe_tvars = ''
outer_probe_tvars = ''
For ip = 0, 4 Do Begin
sc = probe_list[ip]
thx = 'th'+sc
del_data, thx+'_fb_h*'
fbk_tvars = tnames(thx+'_fb_*')
If(n_elements(fbk_tvars) eq 1) Then fbk_tvars = [fbk_tvars, 'filler']
For i = 0, 1 Do Begin
get_data, fbk_tvars[i], data = dd
If(size(dd, /type) Ne 8) Then Begin
filler = fltarr(2, 6)
filler[*, *] = float('NaN')
name = thx+'_fb_'+strcompress(string(i+1), /remove_all)
store_data, name, data = {x:time_double(date)+findgen(2), y:filler, v:findgen(6)}
options, name, 'spec', 1
ylim, name, 1, 1000, 1
zlim, name, 0, 0, 1
fbk_tvars[i] = name
Endif Else Begin
store_data, fbk_tvars[i], data = {x:dd.x, y:dd.y, v:[2048., 512., 128., 32., 8., 2.]}
options, fbk_tvars[i], 'spec', 1
options, fbk_tvars[i], 'zlog', 1
ylim, fbk_tvars[i], 2.0, 2048.0, 1
thm_spec_lim4overplot, fbk_tvars[i], ylog = 1, zlog = 1, /overwrite
lbl = thx+'_fbk_'+strmid(fbk_tvars[i], 7)
options, fbk_tvars[i], 'ytitle', strjoin(strsplit(lbl, '_', /extract), '!c')
x1 = strpos(fbk_tvars[i], 'scm')
If(x1[0] Ne -1) Then Begin
options, fbk_tvars[i], 'ztitle', '<|nT|>'
get_data, fbk_tvars[i], data = d
If(is_struct(d)) Then zlim, fbk_tvars[i], min(d.y), 2.0, 1
Endif
xv = strpos(fbk_tvars[i], 'v')
If(xv[0] Ne -1) Then options, fbk_tvars[i], 'ztitle', '<|V|>'
xe = strpos(fbk_tvars[i], 'e')
If(xe[0] Ne -1) Then Begin
options, fbk_tvars[i], 'ztitle', '<|mV/m|>'
get_data, fbk_tvars[i], data = d
If(is_struct(d)) Then zlim, fbk_tvars[i], min(d.y), 2.0, 1
Endif
Endelse
Endfor
fft_tvars_eac = tnames(thx+'_fff_??_e?c34')
fft_tvars_scm = tnames(thx+'_fff_??_scm3')
fft_tvars = [fft_tvars_eac, fft_tvars_scm]
For i = 0, 1 Do Begin
get_data, fft_tvars[i], data = dd
If(size(dd, /type) Ne 8) Then Begin
filler = fltarr(2, 6)
filler[*, *] = float('NaN')
name = thx+'_fff_'+strcompress(string(i+1), /remove_all)
store_data, name, data = {x:time_double(date)+findgen(2), y:filler, v:findgen(6)}
options, name, 'spec', 1
ylim, name, 1, 1000, 1
zlim, name, 0, 0, 1
fft_tvars[i] = name
Endif Else Begin
options, fft_tvars[i], 'spec', 1
options, fft_tvars[i], 'zlog', 1
lbl = thx+'_fff_'+strmid(fft_tvars[i], 7)
options, fft_tvars[i], 'ytitle', strjoin(strsplit(lbl, '_', /extract), '!c')
zv = where(dd.y Eq 0, nzv)
If(nzv Gt 0) Then dd.y[zv] = !values.f_nan
yv = where(dd.v Eq 0, nyv)
If(nyv Gt 0) Then Begin
yv1 = where(dd.v Gt 0, nyv1)
If(nyv1 Gt 0) Then Begin
minyv1 = min(dd.v[yv1])
dd.v[yv] = minyv1 > 1.0
Endif
Endif
store_data, fft_tvars[i], data = temporary(dd)
tdegap, fft_tvars[i], /overwrite, dt = 600.0
thm_spec_lim4overplot, fft_tvars[i], ylog = 1, zlog = 1, /overwrite
Endelse
Endfor
Case ip of
0:inner_probe_vars = [fft_tvars, fbk_tvars]
1:outer_probe_vars = [fft_tvars, fbk_tvars]
2:outer_probe_vars = [outer_probe_vars, fft_tvars, fbk_tvars]
3:inner_probe_vars = [inner_probe_vars, fft_tvars, fbk_tvars]
4:inner_probe_vars = [inner_probe_vars, fft_tvars, fbk_tvars]
Endcase
Endfor
ititle = 'Inner Probes: P5, P3, P4 (TH-A,D,E) FFT, FBK'
otitle = 'Outer Probes: P1, P2 (TH-B,C) FFT, FBK'
tplot_options, 'lazy_ytitle', 1
!p.charsize = 0.6
If(keyword_set(makepng)) Then Begin
dprint, 'PLot_dir: '+dir
tplot, inner_probe_vars, title = ititle
thm_gen_multipngplot, 'thm_tohban_fftfbkinner', date2, directory = dir
tplot, outer_probe_vars, title = otitle
thm_gen_multipngplot, 'thm_tohban_fftfbkouter', date2, directory = dir
Endif Else Begin
If(!d.name NE 'Z') Then window, 0, xs = 640, ys = 720
tplot, inner_probe_vars, title = ititle
If(!d.name NE 'Z') Then window, 2, xs = 640, ys = 480
tplot, outer_probe_vars, title = otitle, window = 2
Endelse
Return
End