Pro thm_mult_gmag_plot, date, duration, no_data_load = no_data_load, $
n_per_page = n_per_page, winsize = winsize, $
_extra = _extra
if not keyword_set(date) then begin
dprint, 'You must specify a date. (Format : YYYY-MM-DD/HH:MM:SS)'
return
endif
if not keyword_set(duration) then duration = 1.
start_time = time_double(date)
end_time = start_time+86400.*duration
timespan, date, duration
if not keyword_set(no_data_load) then begin
del_data, 'thg_mag_*'
thm_load_gmag, site = '????', /subtract_median
endif
tplotvars = tnames('thg_mag_????')
if tplotvars[0] eq '' then begin
dprint, 'Appropriate tplot variables could not be found!'
dprint, 'Searched for "thg_mag_????"'
dprint, 'plot program was aborted.'
return
endif
stations = tplotvars
lats = fltarr(n_elements(stations))
lons = fltarr(n_elements(stations))
nstations = n_elements(stations)
for i = 0, nstations-1 do begin
get_data, stations[i], dlimits = dl
lats[i] = float(dl.cdf.vatt.station_latitude)
lons[i] = float(dl.cdf.vatt.station_longitude)
endfor
lat_index = reverse(sort(lats))
stations = stations[lat_index]
stations0 = stations
original_device = !d.name
osf = strupcase(!version.os_family)
If(osf Eq 'WINDOWS') Then set_plot, 'win' Else set_plot, 'x'
If(n_elements(winsize) Eq 2) Then Begin
window, 0, xsize = winsize[0], ysize = winsize[1]
Endif Else Begin
screen_size = get_screen_size()
xss = screen_size/3.0
xss = 100.0*fix(xss[0]/100)
window, 0, xsize = xss, ysize = screen_size(1)*0.9
Endelse
tplot_options, 'region', [0.00, 0.00, 0.95, 1.]
!p.color = 0
!p.background = 255
!p.charsize = 1.0
time_stamp, /off
date_compress = strcompress(strmid(date, 0, 4)+strmid(date, 5, 2)+strmid(date, 8, 2), /remove_all)
timespan, date, duration
If(keyword_set(n_per_page)) Then npp = n_per_page $
Else npp = 3
nx = ceil(nstations/float(npp))
stations0 = stations
for w = 0, nx-1 do begin
wch = strcompress(/remove_all, string(w))
x0 = w*npp
x1 = (x0+npp-1) < (nstations-1)
stations = stations0[x0:x1]
thetitle = 'Sample: '+wch
dprint, 'PLOTTING:', stations
tplot, stations, window = 0, title = thetitle
wshow, 0
dprint, 'Hit Enter to Continue:'
xxx = strarr(1)
read, xxx
endfor
set_plot, original_device
end