pro make_full_unshifted_mpeg, y_low=y_low,y_high=y_high,x_low=x_low,x_high=x_high,$
	Shack_Directory=Shack_Directory,Date=Date

If (not keyword_set(Date)) then Date='11'
If (not keyword_set(Shack_Directory)) then Shack_Directory='/a/pippin01/Volumes/u08/lsst/CPanalysis/2005-05-'+Date+'/ShackHartman/'
If (not keyword_set(pixels)) then pixels='whole_array'
If (not keyword_set(y_low)) then y_low=140
If (not keyword_set(y_high)) then y_high=780
If (not keyword_set(x_low)) then x_low=220
If (not keyword_set(x_high)) then x_high=860

Raw_dir=Shack_Directory+'raw/'
Raw_files=file_search(Raw_dir+'*5132*.fits',count=num_files)

;Time will be coded as 2005*1000+Day_Number+hr/24+min/60+second/3600
year_offset=double(2005000)
time_gap=0.0001
num_of_telescope_shifts=0

;NAME OF MOVIE
mpegname=Shack_directory+'mpegs/all_files_unshifted.mpeg'

diff_movie=mpeg_open([768,768],quality=50)
frame_no=0
no_frames_per_image=3

;SET PLOT TO BUFFER SO THAT OTHER PROCESSES CAN OCCUR WHILE MOVIE IS MADE
set_plot,'z'

device,set_resolution=[768,768]

        for file_number=0,num_files -1 do begin
	
	
	unshifted_filename=Raw_files(file_number)
	raw_path_parts=strsplit(Raw_files(file_number),'/',/extract)
        raw_file_ref=strsplit(raw_path_parts(N_elements(raw_path_parts)-1),'raw.fits',$
                /extract,/regex)
        pre_letter=strsplit(raw_file_ref,'_',/extract)
        pre_number=pre_letter(1)
	pre_letter=pre_letter(0)
	
	
	print,FORMAT='(%"%s")',file_number

	fits_read,unshifted_filename,unshifted_image,header

	uttime=SXPAR(header,'DATE-OBS')


	unshifted_image=unshifted_image(x_low:x_high,y_low:y_high)

	;SET UP REFERENCE LINES
	x_h=x_low-20+findgen((x_high-x_low)+40)
        y_h=fltarr((x_high-x_low)+40)+468
        x_v=[540,540]
        y_v=[0,820]



	erase
	!p.noerase=1


	unshifted_image=bytscl(unshifted_image,min=20,max=5000)
	unshifted_image=congrid(unshifted_image,768,768)

	;image1=fltarr(500,500)
	image1=unshifted_image
	;image1(0,*,*)=unshifted_image
	;image1(1,*,*)=unshifted_image
	;image1(2,*,*)=unshifted_image
	
	tv,image1

	plot,x_h,y_h,xrange=[x_low,x_high],yrange=[y_low,y_high],position=[0,0,1,1],$
             thick=.2,xstyle=11,ystyle=11
        plot,x_v,y_v,xrange=[x_low,x_high],yrange=[y_low,y_high],position=[0,0,1,1],$
             thick=.2,xstyle=11,ystyle=11
        xyouts,25,25,pre_letter+' '+pre_number,/device
        xyouts,25,50,uttime,/device
	
	image1=tvrd()
	for i=0, no_frames_per_image do begin
		mpeg_put,diff_movie,IMAGE=image1,$
			 frame=(frame_no*no_frames_per_image+i),$
			 /order
	endfor


	frame_no=frame_no+1
	
	endfor
	
mpeg_save,diff_movie,FILENAME=mpegname
mpeg_close,diff_movie

end

