pro get_dpc_info, dpc, nx, ny, npix, sum, err, mnem, $
		qforce_rd=qforce_rd, qprint=qprint, struct=struct, infil=infil, qstop=qstop
;+
;NAME:
;	get_dpc_info
;PURPOSE:
;	To read a database file and return information on the data product
;SAMPLE CALLING SEQUENCE:
;	get_dpc_info, dpc, nx, ny, npix, sum, err, mnemonic
;	get_dpc_info, dpc_struct, /struct
;INPUT:
;	dpc	- The data product to return the info for
;OUTPUT:
;	nx	- The number of "X" pixels (columns)
;	ny	- The number of "Y" pixels (lines)
;	npix	- The total number of pixels
;	err	- Error (0=no error, 1=error)
;	mnemonic- The mnemonic that is associated with that data product
;OPTIONAL KEYWORD INPUTS:
;	qforce_rd - If set, force the database file to be read again
;	qprint	- If set, print a summary of the data products to the screen
;	struct	- If set, return the structure which holds all of the DPC info
;	infil	- The input file to read.  The default is 
;		  $MDI_CAL_INFO/dpc_table.txt
;HISTORY:
;	Written 18-Apr-94 by M.MOrrison
;	21-Sep-94 (MDM) - Added IMIN/IMAX values to the structure
;	28-Sep-95 (MDM) - Allowed MNEM to be defined always
;Ver2.0 12-Oct-95 (MDM) - Modified to use the Stanford format DPC table file
;			- Added .IP_LIST and .PIXMAP2 keywords and read the
;			  DPC_FORMAT files to get those values.
;Ver2.1  7-Nov-95 (MDM) - Modified to read the RDB format of the format files
;			  (not the keyword format)
;	25-Jul-96 (MDM) - Modified to make NX,NY longs for unknown DPC
;	29-Aug-96 (MDM) - Scrapped reading code and called RD_DPC_TABLE
;	 3-Oct-96 (MDM) - Added 'infil=infil' to the RD_DPC_TABLE call
;-
;
common get_dpc_info_blk, dpc_struct
;
qread = n_elements(dpc_struct) eq 0
if (keyword_set(qforce_rd)) then qread = 1
;
if (qread) then rd_dpc_table, dpc_struct, infil=infil
;
if (keyword_set(qstop)) then stop
if (keyword_set(struct)) then begin
    dpc = dpc_struct
    return
end
;
if (keyword_set(qprint)) then begin
    fmt = '(1x, z8.8, 4i10, 3x, a20, 3x, a)'
    for i=0,n_elements(dpc_struct)-1 do begin
	dpc0 = dpc_struct(i)
	str = string(dpc0.dpc, dpc0.nx, dpc0.ny, $
			dpc0.npix, dpc0.sum, dpc0.mnem, dpc0.comment, format=fmt)
	print, str
    end
    return
end
;
nx = 1040L
ny = 1033L
err = 1
mnem = ''
;
ss = where(dpc_struct.dpc eq dpc, nn)
if (nn ne 0) then begin
    ii = ss(0)
    nx = dpc_struct(ii).nx
    ny = dpc_struct(ii).ny
    sum = dpc_struct(ii).sum
    err = 0
    mnem = dpc_struct(ii).mnem
end
;
npix = nx*ny
end
