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

function Return_Cubes_Diff, FileName1, FileName2, $
	 ArrSize, Naxis1, Naxis2, $
	 Frame1, Frame2, BlockLength = BlockLength

 If not(keyword_set(BlockLength)) then BlockLength = 0
 
 ;Get Image from first file
 Fits_Read, FileName1, Dummy_1,$ 
 	First = (Frame1) * ArrSize + Blocklength, $
        Last = (Frame1+1)*ArrSize + BlockLength - 1
 Dummy_1 = reform(temporary(Dummy_1), Naxis1, Naxis2)

 ;Get Image from second file
 Fits_Read, FileName2, Dummy_2, $
	First = (Frame2) * ArrSize + BlockLength, $
        Last = (Frame2+1)*ArrSize + BlockLength - 1
 Dummy_2 = reform(temporary(Dummy_2), Naxis1, Naxis2)

 Image = temporary(long(Dummy_2) - long(Dummy_1))
 return, Image

end
