;+ ; NAME: atvmakemovie ; PURPOSE: ; create a movie from an image stack in ATV. ; ; USAGE: ; Load a 3d data cube into ATV. get the color table set the way you want it. ; This command will iterate through every frame of the data cube and write ; it to disk as a PNG file, suitable for combining into an animation via ; 'convert' or the like. ; ; INPUTS: ; KEYWORDS: ; OUTPUTS: ; ; HISTORY: ; Began 2004-08-27 16:45:51 by Marshall Perrin ;- PRO atvmakemovie,crop=crop common atv_state, state common atv_color, r_vector, g_vector, b_vector, user_r, user_g, user_b,atv_r,atv_g,atv_b common atv_pdata, nplot, maxplot, plot_ptr common atv_images, $ main_image, $ main_image_stack, $ display_image, $ scaled_image, $ blink_image1, $ blink_image2, $ blink_image3, $ unblink_image, $ pan_image ;`files = file_search("/Users/mperrin/Desktop/movie/*fits") sz = size(main_image_stack) for i=0l,sz[3]-1 do begin print,"image is ",i atv_changeimage,i filename = "subtract_movie"+string(i,format='(i4.4)')+".png" filename2 = "subtract_cropped_movie"+string(i,format='(i4.4)')+".png" image = display_image atv_writepng,filename=filename,/overwrite result=read_png(filename) ;write_png,filename2,result[*,55:55+370,55:55+370] if keyword_set(crop) then begin r2 = transpose(result,[1,2,0]) ; turn from 3,n,m into n,m,3 if ~(keyword_set(mask)) then mask = total(r2,3) crop_badmask,r2,mask,r3 r4 = transpose(r3,[2,0,1]) write_png,filename2,r4 endif endfor ; display_image is the one end