; Given an array of filenames, assemble an mpeg from gifs, set the ; colortable by using the colors from the first gif file. FUNCTION mpeg_mymenagifs, f, OUTDIR=OUTDIR, DEBUG=DEBUG, QL=QL if keyword_set(DEBUG) then print,'INFO>mpeg_mymenagifs>Opening mpeg...' id = mpeg_open([192,192]) ; open a new mpeg file idat = bytarr(3,192,192) ; allocate one frame of memory read_gif,f(0),a,r,g,b ; get colortable from first gif tvlct, r,g,b ; load the color table ; construct mpeg frame by frame from the gif files for i=0,n_elements(f)-1 do begin ; process each gif image read_gif, f(i),a ; read the gif file idat(0,*,*) = r[a] ; extract red data idat(1,*,*) = g[a] ; extract green data idat(2,*,*) = b[a] ; extract blue data mpeg_put, id, frame=i, image=idat, order=1 ; write frame to file endfor ; construct a name for the mpeg file based on the datatime of first gif e = get_mytimefromfilename( f(0) ) p = parse_mystring( decode_cdfepoch(e) ) if keyword_set(QL) then fname = 'im_ql_mena_'+p(0)+p(1)+p(2)+p(3)+'_v01.mpg' $ else fname = 'im_k0_mena_'+p(0)+p(1)+p(2)+p(3)+'_v01.mpg' if keyword_set(OUTDIR) then fname = OUTDIR+fname ; close the mpeg and exit mpeg_save,id,filename=fname mpeg_close,id if keyword_set(DEBUG) then print,'INFO>mpeg_mymenagifs>'+fname+' completed.' return,0 end ; Given a mega-structure, make image by image gifs of the data FUNCTION gifplot_mymenaimages, a, OUTDIR=OUTDIR, DEBUG=DEBUG ; verify that the input mega-structure is valid if ami_mystruct(a) ne 1 then begin print, 'ERROR>plot_mymenaimages>Invalid input!' & return,-1 endif ; Extract needed variables from the structure etimes = get_mydata(a,'EPOCH') imgdat = get_mydata(a,'IMAGE2') scpos = get_mydata(a,'GCI_POS') spinaxis = get_mydata(a,'GCI_SPINAXIS') ; Make a gif of every image in the structure for i=0,n_elements(etimes)-1 do begin ; determine the name of the gif file p = parse_mystring( decode_cdfepoch( etimes(i) ) ) gname = a.(0).logical_source + '_' + p(0) + p(1) + p(2) + p(3) + p(4) + p(5) + '.gif' if keyword_set(OUTDIR) then gname=OUTDIR+gname else gname='/mission/image/sci/incoming/'+gname if keyword_set(DEBUG) then print,'INFO>plot_mymenaimages>gname=',gname square_image = imgdat(*,*,i) ; pull single image out of data s = plot_enaflux(etimes(i),square_image,128.0,4.0,$ scpos(*,i),spinaxis(*,i),1,GIF=gname,/nocolorbar,/noborder,$ wsize=[200,200],reverseorder=2,scalemin=500,scalemax=50000.0) if s ne -1 then begin ; gif file was generated if ami_defined(gnames) eq 0 then gnames=gname else gnames=[gnames,gname] endif endfor return,gnames end FUNCTION extract_mymenaimages,a, TIME_AVERAGING=TIME_AVERAGING,$ SMOOTHING_DESIRED=SMOOTHING_DESIRED,$ DEBUG=DEBUG ;;; MENA images are assembled by combining 32 consectutive polar "scans"; a ;;; scan is the combination of all three heads, 16 polar directions ("pixels") ;;; into a total of 28 pixels in the polar direction, 32 of those scans (= ;;; azimuth directions) make an image. Thus the image is 28 by 32 pixels, or ;;; 140 by 128 degrees. A pixel is 5 degrees wide in the polar direction, 4 ;;; degrees in the azimuthal direction. ;;; ;;; It is important to understand that there is no "beginning of image" ;;; indicator in the MENA data stream! However, by using UDF "blocking" we can ;;; guarantee that reading UDF IMMIMAGE data will always (!!!) locate us at ;;; the beginning of an image. Further, it is guaranteed that there is always ;;; a full image available in the data, even if there were no data. MENA ;;; IMMIMAGE IMAGES ARE ALWAYS PRODUCED< REGARDLESS OF THE EXISTENCE OF ;;; DATA. There are some more fine points, but they would make L1 processing ;;; very complicated and have, apparantly, not come up so far. ;;; First step: how many images are there. RBurley changed the calculation ;;; n_images from #sensor1 datapoints/32 to #epoch datapoints / 32 since the ;;; UDFCDF translation s/w can be forced by the VIDF to provide complete ;;; images, but apparantly not complete timetags. Sometimes the number of ;;; epoch data records was less than the number of sensor data records, and ;;; an array out of bounds error would occur. ; n_images = n_elements(a.sensor1.dat[0,*])/32 ;;; image contains 32 "scans" n_images = n_elements(a.epoch.dat)/32 if keyword_set(DEBUG) then print,'INFO>extract_mymenaimages>n_images=',n_images ;;; make an image array for n_images with 5 energies and a size of 28x32) m_image_array = fltarr(n_images,5,28,32) m_image_times = dblarr(n_images) ;;; assemble the images for i = 0L, n_images - 1 do begin ;;; begin image assembly loop ;;; Rick, here is a critical point. The next step uses the MENA definition ;;; of a coordinate system. Basically we define the polar angle to be zero ;;; when we point parallel to the spin axis, and 180 degrees, when we point ;;; antiparallel. The problem is, that (1) the heads are oriented such ;;; that, with increasing polar angle, the order is Head 3 - 2 - 1, and ;;; (2) the numbering of polar angles is such that it also is reversed: ;;; with increasing polar angle, it goes: Head 3[15:0], Head2 [15:0], ;;; Head 1 [15:0]. Therefore, we have to reverse the order of the ;;; pixels. The averaging is done in such a way that the two pixels from ;;; different heads are summed together and then divided by two. Any ;;; adjustment necessary to be able to do that (detector response etc.) is ;;; done in the VIDF. Please note that in cases where there are no two ;;; pixels overlapping (at both polar adges of the image), the value is ;;; still divided by two. This is necessary since in the VIDF each pixel is ;;; assigned a weight for the averaging, and non-overlapping pixels are ;;; assigned a weight of 2.0 for consistency. ;;; we are doing the proper pixel averaging simultaneosly for all 5 ;;; energies and all 32 azimuthal angles m_image_array[i,*,27,*] = a.sensor1.dat[*,i*32:(i+1)*32-1] / 2. m_image_array[i,*,26,*] = a.sensor2.dat[*,i*32:(i+1)*32-1] / 2. m_image_array[i,*,25,*] = a.sensor3.dat[*,i*32:(i+1)*32-1] / 2. m_image_array[i,*,24,*] = a.sensor4.dat[*,i*32:(i+1)*32-1] / 2. m_image_array[i,*,23,*] = $ (a.sensor5.dat[*,i*32:(i+1)*32-1] $ + a.sensor17.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,22,*] = $ (a.sensor6.dat[*,i*32:(i+1)*32-1] $ + a.sensor18.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,21,*] = $ (a.sensor7.dat[*,i*32:(i+1)*32-1] $ + a.sensor19.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,20,*] = $ (a.sensor8.dat[*,i*32:(i+1)*32-1] $ + a.sensor20.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,19,*] = $ (a.sensor21.dat[*,i*32:(i+1)*32-1] $ + a.sensor33.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,18,*] = $ (a.sensor22.dat[*,i*32:(i+1)*32-1] $ + a.sensor34.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,17,*] = $ (a.sensor23.dat[*,i*32:(i+1)*32-1] $ + a.sensor35.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,16,*] = $ (a.sensor24.dat[*,i*32:(i+1)*32-1] $ + a.sensor36.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,15,*] = $ (a.sensor9.dat[*,i*32:(i+1)*32-1] $ + a.sensor37.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,14,*] = $ (a.sensor10.dat[*,i*32:(i+1)*32-1] $ + a.sensor38.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,13,*] = $ (a.sensor11.dat[*,i*32:(i+1)*32-1] $ + a.sensor39.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,12,*] = $ (a.sensor12.dat[*,i*32:(i+1)*32-1] $ + a.sensor40.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,11,*] = $ (a.sensor13.dat[*,i*32:(i+1)*32-1] $ + a.sensor25.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,10,*] = $ (a.sensor14.dat[*,i*32:(i+1)*32-1] $ + a.sensor26.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,9,*] = $ (a.sensor15.dat[*,i*32:(i+1)*32-1] $ + a.sensor27.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,8,*] = $ (a.sensor16.dat[*,i*32:(i+1)*32-1] $ + a.sensor28.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,7,*] = $ (a.sensor29.dat[*,i*32:(i+1)*32-1] $ + a.sensor41.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,6,*] = $ (a.sensor30.dat[*,i*32:(i+1)*32-1] $ + a.sensor42.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,5,*] = $ (a.sensor31.dat[*,i*32:(i+1)*32-1] $ + a.sensor43.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,4,*] = $ (a.sensor32.dat[*,i*32:(i+1)*32-1] $ + a.sensor44.dat[*,i*32:(i+1)*32-1]) / 2. m_image_array[i,*,3,*] = a.sensor45.dat[*,i*32:(i+1)*32-1] / 2. m_image_array[i,*,2,*] = a.sensor46.dat[*,i*32:(i+1)*32-1] / 2. m_image_array[i,*,1,*] = a.sensor47.dat[*,i*32:(i+1)*32-1] / 2. m_image_array[i,*,0,*] = a.sensor48.dat[*,i*32:(i+1)*32-1] / 2. m_image_times(i) = a.epoch.dat(i*32) ;;; done with assembling the image, you have now a 28x32 image array; the ;;; indices are ordered such that they increase in the azimuthal direction ;;; (i.e. in the spin direction; the smaller the index, the "earlier" that ;;; scan was taken) and in the polar direction away from the +z ;;; axis. Please note that in the azimuthal direction this image is centered ;;; around Earth Nadir at all times for apogee science. endfor ;;; if time averaging is desired, now is the time to do so: if keyword_set(TIME_AVERAGING) then begin ;;; do average images together - nothing special here, you can do it in ;;; your favorite way. I perfer to average odd numbers of images together ;;; only print,'WARNING>extract_mymenaimages>not yet time averaging' endif ;;; now, if desired, smooth the images. We have decided to use median ;;; smoothing, since it preserves edges and acts mostly like a noise ;;; filter. Using the IDL smooth function applies a boxcar, and that changes ;;; the data more drastically ;;; ;;; If only single images (= no time averaging) are plotted, I heavily ;;; recommend smoothing. Otherwise the stastistical fluctuations will ;;; overwhelm the user. If you time average 5 images together, smoothing is ;;; not necessary. if keyword_set(SMOOTHING_DESIRED) then begin for i = 0L, n_images - 1 do $ for kk = 0, 4 do $ m_image_array[i,kk,*,*] = $ median(reform(m_image_array[i,kk,*,*]),3,/even) endif ;;; done with assembling the images. Now you need the look directions. I am ;;; not sure exactly what to tell you here, since I am not sure what exactly ;;; you need. But in general the following holds true: ;;; (1) each pixel is 5 degrees wide in the polar direction, the boundary ;;; between the 14th and the 15th pixel is located at 90 degrees polar angle ;;; (2) each pixel is 4 degrees wide in azimuth, the boundary between the 16th ;;; and 17th pixel is located at Earth Nadir. The m_image_array is organized ;;; such that increasing azimuth index values move away form +z. ;;; Fix the mena rotation for the plotting software by transposing each ;;; image and rotating 90 degree counterclockwise. 2001/03/26 RBurley. for i=0,n_images-1 do begin ; for each image for j=0,4 do m_image_array(i,j,*,*) = rotate(reform(m_image_array(i,j,*,*)),5) endfor return,{m_image_array:m_image_array,itimes:m_image_times} end ; Given start and stop times, in cdf-epoch timetags, create the mena cdf for that ; timespan. Ftype should be 'D' for a daily cfd and 'Q' for quicklook FUNCTION make_myMENAcdf, estart, estop, ftype, OUTDIR=OUTDIR, DEBUG=DEBUG ; convert the start and stop times into integers for UdfCdf call if keyword_set(DEBUG) then print,'INFO>make_mymenacdf>estart=',decode_cdfepoch(estart) if keyword_set(DEBUG) then print,'INFO>make_mymenacdf>estop =',decode_cdfepoch(estop) cdf_epoch,estart,y0,m0,d0,h0,n0,s0,/break & monday,y0,doy0,m0,d0,/yearday cdf_epoch,estop ,y1,m1,d1,h1,n1,s1,/break & monday,y1,doy1,m1,d1,/yearday ; Temporary code added 2005/1/31, in order to terminate QL production of QL ; MENA cdfs and browse products in order to facilitate EUV/HARP experiment by ; reducing science run time. if (ftype eq 0) then return,0 ; ; remove any intermediate mena cdfs from /burley/src f = '' & f = findfile('/mission/image/burley/src/IMMIMAGE*.cdf') if f(0) ne '' then begin if keyword_set(DEBUG) then print,'INFO>make_mymenacdf.pro>Rm old Intermediate cdfs.' for i=0,n_elements(f)-1 do spawn,'rm -f '+f(i) endif ; ; before proceeding with the creation of the intermediate mena cdf, which ; takes a long time to create, verify that definitive orbit data exists ; if this is a definitive data generation run. if ftype eq 1 then begin go_ahead = do_i_have_definitive_orbitdata(estart,estop,DEBUG=DEBUG) if go_ahead eq 0 then begin print,'INFO>make_mymenacdf>Insufficient definitive orbit data for daily' return,0 endif endif ; ; select the correct UdfCdf template and cdf master given the level zero ftype case ftype of 0 : begin ; quicklook template = '/mission/image/sci/data/master/MENA_UDFCDF_Q ' master = '/mission/image/sci/data/master/im_ql_mena_00000000_v01.cdf' end 1 : begin ; daily template = '/mission/image/sci/data/master/MENA_UDFCDF ' master = '/mission/image/sci/data/master/im_k0_mena_00000000_v01.cdf' end else : begin ; unknown ftype print,'ERROR>make_mymenacdf>UNKNOWN FTYPE = ',ftype return,-1 end endcase ; ; construct the UdfCdf command call c = '/mission/image/software/UDFTools/bin/UdfCdf ' c = c + template + strtrim(string(y0),2) + $ ' ' + strtrim(string(doy0),2) + ' ' + strtrim(string(h0),2) + ' ' + strtrim(string(n0),2) + $ ' ' + strtrim(string(s0),2) + ' ' + strtrim(string(y1),2) + ' ' + strtrim(string(doy1),2) + $ ' ' + strtrim(string(h1),2) + ' ' + strtrim(string(n1),2) + ' ' + strtrim(string(s1),2) if keyword_set(DEBUG) then print,'INFO>make_mymenacdf>spawning ',c,' at ',systime(0) spawn,c ; create the ugly cdf with the UdfCdf translator ; Locate the cdf that was just created, if it was created, and read it f = findfile('/mission/image/burley/src/IMMIMAGE*.cdf') if f(0) eq '' then begin print,'WARNING>make_mymenacdf>NO mena CDF WAS CREATED!' & return,-1 endif else begin f(0) = check_myuglycdfname(f(0)) ; verify cdf won't be treated as a 'master' by read_mycdf !quiet=1 & a = read_mycdf('',f(0),/all) & !quiet=0 ; read the cdf file ;--- ;stop ;--- if ami_mystruct(a) ne 1 then begin print,'ERROR>make_mymenacdf>read_mycdf did not return a structure!' & return,-1 endif ; The MENA PIDF can force UDFCDF to include an image which starts ; before the requested tstart/tstop. For example, if a 2 minute ; image starts at 30 seconds before end of day, it will be included ; in the file, and when write_mycdf autonames the file, it will be ; named using this first time. Therefore, these early images need ; to be filtered out. if a.epoch.dat(0) lt estart then begin if keyword_set(DEBUG) then print,'WARNING>make_myMENAcdf>TimeFiltering 1st image.' a = timeslice_mystruct(a,estart,estop) endif ; validate that enough data exists in the ugly cdf to make a usable cdf. In the ugly-cdf ; each scanline of the image is saved as a separate variable, at 2 second resolution. In ; the full cdf, this data must be combined into a 2 minute image. Thus, to have > 1 complete ; image in the good cdf, you must have at least 120 records in the ugly cdf. e = get_mydata(a,'EPOCH') ; get the epoch data from the structure if n_elements(e) lt 120 then begin print,'WARNING>make_menaproducts>Insufficient mena data to make mena cdf!' spawn,'rm -f '+f(0) ; delete the ugly cdf return,-1 endif endelse ; Read the mena master cdf if keyword_set(DEBUG) then print,'INFO>make_mymenacdf>reading mena master cdf...' !quiet=1 & m = read_mycdf('',master,/all,/nodatastruct) & !quiet=0 if ami_mystruct(m) ne 1 then begin print,'ERROR>make_mymenacdf>read_mycdf could not read the master!' & return,-1 endif ; Extract and descramble the images from the ugly cdf if keyword_set(DEBUG) then print,'INFO>make_mymenacdf>descrambling mena images.' menaimages = extract_mymenaimages(a,/smoothing_desired) ; Find and Read the cdfs which have the required ancillary orbit data if keyword_set(DEBUG) then print,'INFO>make_mymenacdf>generating ancillary data.' offset = 1000.0d0 * 360.0d0 ; compute a 6 minute offset in millisecs if ftype eq 1 then f = find_myorbitcdfs(estart - offset, estop + offset, /DAY,/DEF) if ftype eq 0 then f = find_myorbitcdfs(estart - offset, estop + offset, /QL,/PRED) if f(0) eq '' then begin print,'WARNING>make_mymenacdf>matching orbit cdf files not found!' & return,-1 endif !quiet=1 & d = read_mycdf('',f,/all) & !quiet=0 if ami_mystruct(d) ne 1 then begin print,'ERROR>make_mymenacdf>Eror reading orbit data from cdf!' & return,-1 endif ; Compute the interpolation points using the mena image times p = compute_interpolation_points( d.epoch.dat, menaimages.itimes ) ; Populate the m structure with orbit data interpolated to mena image times px = interpolate( reform( d.gci_pos.dat(0,*)),p ) py = interpolate( reform( d.gci_pos.dat(1,*)),p ) pz = interpolate( reform( d.gci_pos.dat(2,*)),p ) pv = dblarr( 3,n_elements(px) ) & pv(0,*)=px & pv(1,*)=py & pv(2,*)=pz m.GCI_POS.handle = handle_create(value=pv) px = interpolate( reform( d.gse_pos.dat(0,*)),p ) py = interpolate( reform( d.gse_pos.dat(1,*)),p ) pz = interpolate( reform( d.gse_pos.dat(2,*)),p ) pv = dblarr( 3,n_elements(px) ) & pv(0,*)=px & pv(1,*)=py & pv(2,*)=pz m.GSE_POS.handle = handle_create(value=pv) px = interpolate( reform( d.gsm_pos.dat(0,*)),p ) py = interpolate( reform( d.gsm_pos.dat(1,*)),p ) pz = interpolate( reform( d.gsm_pos.dat(2,*)),p ) pv = dblarr( 3,n_elements(px) ) & pv(0,*)=px & pv(1,*)=py & pv(2,*)=pz m.GSM_POS.handle = handle_create(value=pv) ; Locate spacecraft spin axis data covering the requested time span if ftype eq 0 then spin = find_myspinaxis(menaimages.itimes,/QL) $ else spin = find_myspinaxis(menaimages.itimes) ; quicklook or daily if amia_structure(spin) ne 1 then begin print,'WARNING>make_mymenacdf>Unable to get spinaxis data.' & return,-1 endif spinv = dblarr( 3,n_elements(spin.spinx) ) & spinv(0,*) = spin.spinx spinv(1,*) = spin.spiny & spinv(2,*) = spin.spinz m.GCI_SPINAXIS.handle = handle_create(value=spinv) ; ; Perform TBD manipulation of the images ; ; Insert the images into the m_structure s=size(menaimages.itimes) ; s(1) now equals number of frames m.epoch.handle = handle_create( value=menaimages.itimes ) ; Insert the 0th image img = fltarr(32,32,s(1)) ; create an array for i=0,s(1)-1 do img(2:29,*,i) = menaimages.m_image_array(i,0,*,*) m.image0.handle = handle_create( value=img ) ; insert into structure for i=0,s(1)-1 do img(2:29,*,i) = menaimages.m_image_array(i,1,*,*) m.image1.handle = handle_create( value=img ) ; insert into structure for i=0,s(1)-1 do img(2:29,*,i) = menaimages.m_image_array(i,2,*,*) m.image2.handle = handle_create( value=img ) ; insert into structure for i=0,s(1)-1 do img(2:29,*,i) = menaimages.m_image_array(i,3,*,*) m.image3.handle = handle_create( value=img ) ; insert into structure for i=0,s(1)-1 do img(2:29,*,i) = menaimages.m_image_array(i,4,*,*) m.image4.handle = handle_create( value=img ) ; insert into structure ; create the new cdf if keyword_set(OUTDIR) then d=OUTDIR else d='/mission/image/sci/incoming/' if keyword_set(DEBUG) then print,'INFO>make_mymenacdf>Creating output cdf.' s = write_mycdf(m,'',/autoname,/lowercase,OUTDIR=d,DEBUG=DEBUG) delete_myhandles,m & m=0 ; release memory space return,s end ; Given the input structure 'my_times' which includes tstart and tstop and ; filetype, generate all of the level-1 mena science data products. FUNCTION make_mymenaproducts, my_times, OUTDIR=OUTDIR, DEBUG=DEBUG for i=0,n_elements(my_times.tstart)-1 do begin print,'INFO>make_menaproducts>Tstart=',decompute_cdfepoch(my_times.tstart(i)) print,'INFO>make_menaproducts>Tstop =',decompute_cdfepoch(my_times.tstop(i)) print,'INFO>make_menaproducts>Ftype =',my_times.ftype(i) ; ; verify that ancillary orbit data exists for the time, if its a day file abort = 0 ; initialize abort flag if my_times.ftype(i) eq 1 then begin orb = find_myorbitcdfs(my_times.tstart(i),my_times.tstop(i),$ /day,/def) ; removed nofirstbefore keyword if orb(0) eq '' then begin print,'INFO>make_myMENAproducts>Insufficient orbit data for this timerange.' abort = 1 endif endif ; ; set output directory based on default and use of OUTDIR keyword if keyword_set(OUTDIR) then d = OUTDIR else d = '/mission/image/sci/incoming/' ; ; make a CDF file from UDF data for the time range if abort eq 0 then begin s = make_mymenacdf(my_times.tstart(i),my_times.tstop(i),$ my_times.ftype(i),OUTDIR=d,DEBUG=DEBUG) ; ; if CDF creation was succesfull, then make mena gif's and MPEG if (amia_string(s)) then begin !quiet=1 & a = read_mycdf('',s(0),/all,DEBUG=DEBUG) & !quiet=0 if amia_structure(a) then begin ; read was succesfull ; validate that enough data exists in the cdf to make a usable mpegs e = get_mydata(a,'EPOCH') ; get the epoch data from the structure if n_elements(e) lt 10 then begin print,'WARNING>make_menaproducts>Insufficient data to make mena mpeg!' endif else begin gnames = gifplot_mymenaimages(a,OUTDIR=d) ; make image-by-image gifs if n_elements(gnames) gt 1 then begin if my_times.ftype(i) eq 0 then begin s = make_mybiggif(gnames,OUTDIR=d,/QL, DEBUG=DEBUG) ; make single gif s = mpeg_mymenagifs(gnames, OUTDIR=d,/QL, DEBUG=DEBUG) ; make mpeg from gifs endif else begin s = make_mybiggif(gnames,OUTDIR=d,DEBUG=DEBUG) ; make single gif s = mpeg_mymenagifs(gnames, OUTDIR=d,DEBUG=DEBUG) ; make mpeg from gifs endelse endif endelse endif a = 0 ; release the memory endif endif endfor return,0 end