pro mdimrot, seq_filnam, mat, force_calc=force_calc, qdisp=qdisp, qplot=qplot, xytrend=xytrend, hc=hc, plot_list=plot_list
;+
;NAME:
;	mdimrot
;INPUT:
;	seq_filnam - The series number or telemetry file name
;INPUT/OUPTUT:
;	mat	- The matrix of cross locations
;OPTINAL KEYWORD INPUT:
;	force_calc - If set, then force the grid calculation to be done over
;		  even if it is already done.  The default is to not 
;		  recalculate the cross locations if already done.
;	hc	- If set, make a hardcopy
;	qdisp	- If set, when doing the fitting of the cross locations, 
;		  display the image and the first guess
;	qplot	- If set, when doing the fitting of the cross locations,
;		  display the fit to the cross
;       plot_list - If set, only plot the plots listed in that string
;                   String items: rawp, smoop, diff, m1, m2, pol
;HISTORY:
;	Written 26-Apr-94 by M.Morrison (using PLOT_GROSS2 as a start)
;V1.1    3-Jun-94 (MDM) - Added capability to only do single plot
;                         (so that we can do guide plots)
;                         (added PLOT_LIST optional keyword input)
;-
;
progver = 'MDIMROT  Ver 1.1'
;
if (keyword_set(hc)) then begin
    save_dev = !d.name
    set_plot, 'ps
    device, /land
end
;
read_mdi, seq_filnam, images, code, txtfil, /type_info
infil = concat_dir(getenv('MDI_CAL_TXT'), txtfil+'.gcross')
;
qcalc = 1
if (file_exist(infil)) then qcalc = 0
if (keyword_set(force_calc)) then qcalc = 1
;
if (qcalc) then begin
    read_mdi, seq_filnam, images, nimg, /nimages		;should be 301
    images = indgen(nimg-1)
    idark = nimg-1			;last image is dark
    do_fit_gcross, seq_filnam, idark=idark, images=images, qdisp=qdisp, qplot=qplot, /qhr, nfit=40
end
;
if (n_elements(mat) eq 0) then mat = rd_tfile(infil, 11, 8, /conv)
n = n_elements(mat(0,*))
nrep = n/20
;
spawn, 'grep "Base:" ' + infil, result
tit0 = result(0)
;
plot_gcross, mat, tit0, nrep, 10, xytrend=xytrend, /mdimrot, progver=progver, plot_list=plot_list
;
if (!d.name eq 'PS') then begin
    pprint
    if (n_elements(save_dev) ne 0) then set_plot, save_dev
end

end
