pro pl_monitor_center, pl_infil, obsid=obsid, timerange=timerange
;+
;NAME:
;	pl_monitor_center
;PURPOSE:
;	To plot the center of the sun versus time
;SAMPLE CALLING SEQUENCE:
;	pl_monitor_center
;	pl_monitor_center, '/md80/log/history/monitor_center.thermal
;HISTORY:
;	Written 14-Feb-96 by M.Morrison
;	 8-Apr-96 (MDM) - Modified to read the new column SeqID
;			- Added OBSID keyword input for screening what to plot
;			- Changed screening radius from 490 to 470 pixels
;			- Added TIMERANGE option and only set to the expanded
;			  plot range for IDL versions less than 4.0
;-
;
if (!d.name eq 'PS') then device, /land
;
if (n_elements(pl_infil) eq 0) then pl_infil = '~/monitor_center.txt'
mat = rd_tfile(pl_infil, 8)
n = n_elements(mat(0,*))
;
ss = where((fix(mat(2,*)) ne 0) and $
	(fix(mat(4,*)) gt 470) and (fix(mat(5,*)) gt 1550))
;
if (keyword_set(obsid)) then begin
    qok = bytarr(n)
    qok(ss) = 1
    ss = where( qok and (strmid(mat(7,*), 5, 3) eq obsid) )
end
if (ss(0) eq -1) then begin
    print, 'No valid data found in: ' + pl_infil
    return
end
;
mat = mat(*,ss)
;
dattim = mat(0,*) + ' ' + mat(1,*)
xyr = float(mat(2:4,*))
ad = float(mat(5:6,*))
;
tim = anytim2ints(dattim)
n = n_elements(tim)
dt = int2secarr(tim(n-1), tim(0))
if (!version.release lt '4.0.0') then xrange = [anytim2ints(tim(0), off=-.25*dt), anytim2ints(tim(0), off=dt*1.05)]
if (n_elements(timerange) ne 0) then xrange = timerange
!p.multi=[0,1,3]
titarr = ['X Position (E/W)', 'Y Position (N/S)', 'Radius']
for i=0,2 do utplot, tim, xyr(i,*), /ynozero, psym=-1, $
	tit=titarr(i), ytit='Pixels (2 arcsec)',timerange=xrange
;
plottime, 0, 0, 'PL_MONITOR_CENTER  Ver 1.1
plottime
pprint
end