;pro return_cube_diff
;
;PURPOSE:
;	To return the difference between two reads of a datacube
;
;	Result = FrameLast -FrameFirst
;INPUTS:
;	FirstFrame: The First frame in the difference
;	LastFrame: The Second frame in the difference

function Return_Cube_Diff, FileName, ArrSize, Naxis1, Naxis2, $
	 FirstFrame, LastFrame, BlockLength = BlockLength

 If not(keyword_set(BlockLength)) then BlockLength = 0
 
 ;Get Last Image
 Fits_Read, FileName, Dummy_Last,$ 
 	First = (LastFrame) * ArrSize + Blocklength, $
        Last = (LastFrame+1)*ArrSize + BlockLength - 1
 Dummy_Last = reform(temporary(Dummy_Last), Naxis1, Naxis2)

 ;Get First Image
 Fits_Read, FileName, Dummy_First, $
	First = (FirstFrame) * ArrSize + BlockLength, $
        Last = (FirstFrame+1)*ArrSize + BlockLength - 1
 Dummy_First = reform(temporary(Dummy_First), Naxis1, Naxis2)

 Image = temporary(float(Dummy_Last) - float(Dummy_First))
 
 return, Image

end
