pro spec4d,tempdat, $
LIMITS = limits, $
UNITS = units, $
COLOR = col, $
BDIR = bdir, $
PHI = phi, $
THETA = theta, $
PITCHANGLE = pang, $
VECTOR = vec, $
SUNDIR = sundir, $
a_color = a_color, $
LABEL = label, $
xdat = xdat, $
ydat = ydat, $
dydat = dydat, $
BINS = bins, $
VELOCITY = vel, $
mbin = mbin, $
OVERPLOT = oplot,sec = sec,pot = pot,title=title
if size(/type,tempdat) ne 8 or tempdat.valid eq 0 then begin
print,'Invalid Data'
return
endif
if ndimen(tempdat.data) eq 3 then begin
if not keyword_set(mbin) then mbin=0
tmp = tempdat
tmp.gf[*,*,0] = tmp.gf[*,*,mbin-1]
tmp.eff[*,*,0] = tmp.eff[*,*,mbin-1]
tmp.mass_arr[*,*,0] = tmp.mass_arr[*,*,mbin-1]
tmp.tof_arr[*,*,0] = tmp.tof_arr[*,*,mbin-1]
tmp.bkg[*,*,0] = tmp.bkg[*,*,mbin-1]
tmp.data[*,*,0] = tmp.data[*,*,mbin-1]
spec3d,tmp, $
LIMITS = limits, $
UNITS = units, $
COLOR = col, $
BDIR = bdir, $
PHI = phi, $
THETA = theta, $
PITCHANGLE = pang, $
VECTOR = vec, $
SUNDIR = sundir, $
a_color = a_color, $
LABEL = label, $
xdat = xdat, $
ydat = ydat, $
dydat = dydat, $
BINS = bins, $
VELOCITY = vel, $
OVERPLOT = oplot,sec = sec,pot = pot,title=title
if not keyword_set(mbin) then begin
for i=1,tempdat.nmass-1 do begin
tmp = tempdat
tmp.gf[*,*,0] = tmp.gf[*,*,i]
tmp.eff[*,*,0] = tmp.eff[*,*,i]
tmp.mass_arr[*,*,0] = tmp.mass_arr[*,*,i]
tmp.tof_arr[*,*,0] = tmp.tof_arr[*,*,i]
tmp.bkg[*,*,0] = tmp.bkg[*,*,i]
tmp.data[*,*,0] = tmp.data[*,*,i]
spec3d,tmp, $
UNITS = units, $
COLOR = col, $
BDIR = bdir, $
PHI = phi, $
THETA = theta, $
PITCHANGLE = pang, $
VECTOR = vec, $
SUNDIR = sundir, $
a_color = a_color, $
LABEL = label, $
xdat = xdat, $
ydat = ydat, $
dydat = dydat, $
BINS = bins, $
VELOCITY = vel, $
OVERPLOT = 1
endfor
endif
endif
end