pro reget_dc_image, index_in, index1, data1, index2, data2
;
;+
;NAME:
;	reget_dc_image
;PURPOSE:
;	To read the history portion of an index and to re-read
;	the dark images used
;HISTORY:
;	Written 16-Mar-95 by M.Morrison
;-
;
common sel_dc_image_blk, dc_infil, dc_roadmap, temp, dc_filidx
;
index0 = index_in(0)	;only works on a single image
sel_dc_image, index0	;read the files/roadmaps into the common block
;
if (not his_exist(index0)) then begin
    print, 'The index must have a history record.  Try GET_DC_IMAGE instead'
    return
end
;
ss = where(index0.his.day_dark ne 0, nn)
times = anytim2ints(rotate([[index0.his.time_dark], [index0.his.day_dark]],4))
;
case nn of
    0: begin
	    print, 'A scalar value used: ' + strtrim(index0.his.time_dark(0),2)
	end
    1: begin
	    idset = tim2dset(dc_roadmap, times(0), del=del)
	    if (del(0) ne 0) then print, '******* Improper image match ******'
	    rd_xda, dc_infil, idset, index1, data1
	end
    2: begin
	    idset = tim2dset(dc_roadmap, times(1), del=del)
	    if (del(0) ne 0) then print, '******* Improper image match ******'
	    rd_xda, dc_infil, idset, index2, data2
	end
endcase
;
end
