PRO vu_quick_movie, ut, path=path, movie_dir=movie_dir, movie_file=movie_file, delay=delay ;+ ; NAME: ; vu_quick_movie ; PURPOSE: ; Create animated gifs from final (averaged) tomography files ; CATEGORY: ; Tomography ; CALLING SEQUENCE: ; vu_movie, ut, map_type, path=path, filter=filter, movie_dir=movie_dir, gif_dir=gif_dir ; INPUTS: ; ut array[2]; type: float or time structure ; range of times for which movie is required. ; Times can be specified as Carrington variables or in UT ; map_type ; scalar; type: character ; Any one of 'synoptic', 'earth_skysnap', 'earth_skysweep', ; 'earth_insitu' ; OPTIONAL INPUT PARAMETERS: ; path=path ; scalar; type: string; default: $dat/nagoya/slow/final ; directory in which to search for files ; filter=filter ; scalar; type: string; default: nv3d*.* ; file filter (including wildcard) used to search for files ; movie_dir=movie_dir ; scalar; type: string; default: $TUB ; destination directory for animated gif. ; If the directory doesn't exist then the animated gif is written to $TUB ; gif_dir=gif_dir ; scalar; type: string; default: $TUB ; destination directory for individual gifs ; By default the individual gifs are deleted. If gif_dir is set to an ; existing directory then the individual gifs are saved in this directory. ; /mpeg by default an animated gif is created; if /mpeg is set then an mpeg movie is ; made (NOT YET IMPLEMENTED) ; _extra=_extra ; OUTPUTS: ; (animated gif, and optionally the individual gifs) ; OPTIONAL OUTPUT PARAMETERS: ; hdr = hdr ; array[k]; type: structure ; headers of tomography files used to make individual images ; ff = ff ; array[n,l,m,2,k]; type: float ; 3d heliospheric arrays used ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; checkdir, mk_flick, SetFileSpec, GetFileSpec, do_file, flt_string ; vu_get, Carrington ; PROCEDURE: ;> The returned 'hdr' and 'ff' arrays can be passed to a subsequent call to ; make another movie from the same data. This bypasses the time-consuming ; reading of the same set of files. ;> All t3d files in the source directory 'path' fitting the 'filter' wildcard ; within the time range 'ut' are processed. Image are created at the time ; of each file. ; MODIFICATION HISTORY: ; MAR-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- IF IsType(path,/undefined) THEN message, 'no path to gif files specified' CASE IsType(movie_dir,/defined) OF 0: movie_dir = getenv('TUB') 1: BEGIN ; Make sure the destination dir for the movies exists. If not use $TUB. IF NOT checkdir(movie_dir) THEN BEGIN message, /info, 'movie directory '+movie_dir+' does not exist; using '+getenv('TUB')+' instead' movie_dir = getenv('TUB') ENDIF END ENDCASE gif = filepath(root=path, '*.gif') IF gif[0] EQ '' THEN message, 'no gif files found' gif = gif[sort(gif)] rots = flt_string(gif) sz = size(rots, /dim) rots = rots[sz[1]-1,*] utc = Carrington(ut, /get_variable) i = where(utc[0] LE rots AND rots LE utc[1]) IF i[0] EQ -1 THEN message, 'no gif files inside specified time period' gif = gif[i] ; Create the movie. Currently movies can only be created on the Linux boxes. On NT mk_flick ; does not do anything. mk_flick, movie_file, gif+'.*', /loop, delay=delay ; If the individual gifs are to be retained, then rename them and move them to gif_dir CASE keep_gifs OF 0: tmp = do_file(/delete, filepath(root=gif_dir,'*.gif.*')) 1: BEGIN SetFileSpec, vu_get(hdr, /file) t3d_nam = GetFileSpec(from='name', upto='type') SetFileSpec, gif gif_nam = GetFileSpec(from='name') IF gif NE '' THEN $ FOR i=0,cnt-1 DO $ tmp = do_file(/move, gif+'.'+string(format='(I5.5)',i), $ filepath(root=gif_dir, t3d_nam[i]+'_'+gif_nam)) END ENDCASE RETURN & END