PRO mk_mlsompeg, filetype SPAWN,'ls -1 *.'+filetype,files spawn,'pwd',dir converter='imconv' convert_type='JPEG' num_files=N_ELEMENTS(files) tmpname=files[0] yrddoy=strmid(tmpname,0,6) date=yrddoy2date(yrddoy) year=STRING(date[0],FORMAT='(i4.4)') month=STRING(date[1],FORMAT='(i2.2)') day=STRING(date[2],FORMAT='(i2.2)') j=0 k=0 lct,'/home/stanger/color/bwy.lut' tvlct,r,g,b,/get first='000' last=string(num_files-1,format='(i3.3)') ascale='16' aref='DECODED' ;mn=-100 & mx = 500 ;mn=-100 & mx = 300 mn=-100 & mx = 400 FOR i = 0, num_files-1 DO BEGIN CASE filetype OF 'jpg': BEGIN write_jpeg,yrddoy+'.'+STRING(i,format='(i3.3)')+'.jpg', $ tmp,true=3 END 'gif': BEGIN read_gif,files[i],tmp,r,g,b gif2jpg24,tmp,r,g,b,jtmp write_jpeg,yrddoy+'.'+STRING(i,format='(i3.3)')+'.jpg', $ jtmp,true=3, $ quality=50 END 'rpB.slit': BEGIN pBfilename=files[i] STRPUT,pBfilename,'pB ',STRPOS(files[i],'rpB') pBfilename=STRCOMPRESS(pBfilename,/REMOVE_ALL) print,pBfilename datatype='.mk4.rpBvig' SPAWN,'pc44 -d 512 '+pBfilename,junk tmp=INTARR(512,512) ;tmp=INTARR(960,960) avgtmp=tmp openr,1,files[i] & readu,1,tmp & close,1 ;tmp=SHIFT(tmp,(960/2)-30,0) tmp[*,0]=tmp[*,1] j=j+1 IF (j EQ 3) THEN BEGIN print,'Now doing avg image'+STRING(k) ;medarr,tmp_cube,avgtmp avgtmp=tmp avgtmp=bytscl(avgtmp,min=mn,max=mx,top=249) ;avgtmp=CONGRID(avgtmp,512,512) avgtmp=annomk4arr(files[i],avgtmp,mn,mx) gif2jpg24,avgtmp,r,g,b,avgjtmp write_jpeg,yrddoy+'.'+string(k,format='(i3.3)')+'.avg.jpg', $ avgjtmp,true=3,quality=50 j=0 k=k+1 ENDIF tmp=bytscl(tmp,min=mn,max=mx,top=249) ;tmp=CONGRID(tmp,512,512) tmp=annomk4arr(files[i],tmp,mn,mx) gif2jpg24,tmp,r,g,b,jtmp write_jpeg,yrddoy+'.'+STRING(i,format='(i3.3)')+'.jpg', $ jtmp,true=3, quality=50 END ENDCASE ENDFOR mpegFileName=year+month+day+datatype+'.mpg' ;Build the mpeg parameter file paramfile='mlso2mpeg.params' OPENW,unit,paramfile,/GET_LUN PRINTF,unit,'PATTERN IBBPBBPBBPBB' PRINTF, unit, 'OUTPUT ' + mpegFileName PRINTF, unit, 'GOP_SIZE 12' PRINTF, unit, 'SLICES_PER_FRAME 1' PRINTF, unit, 'BASE_FILE_FORMAT '+convert_type ;PRINTF, unit, 'INPUT_CONVERT ' + converter + ' *' PRINTF, unit, 'INPUT_CONVERT *' PRINTF, unit, 'INPUT_DIR '+dir PRINTF, unit, 'INPUT' PRINTF, unit, yrddoy+'.*.jpg ['+ first + '-' + last + ']' PRINTF, unit, 'END_INPUT' PRINTF, unit, 'PIXEL HALF' PRINTF, unit, 'RANGE 16' PRINTF, unit, 'PSEARCH_ALG LOGARITHMIC' PRINTF, unit, 'BSEARCH_ALG SIMPLE' PRINTF, unit, 'IQSCALE '+ascale PRINTF, unit, 'PQSCALE '+ascale PRINTF, unit, 'BQSCALE '+ascale PRINTF, unit, 'REFERENCE_FRAME '+aref PRINTF, unit, 'FORCE_ENCODE_LAST_FRAME' FREE_LUN, unit mpegFileName=year+month+day+datatype+'.sml.mpg' ;Build the mpeg parameter file last=string(k-1,format='(i3.3)') paramfile='mlso2smlmpeg.params' OPENW,unit,paramfile,/GET_LUN PRINTF,unit,'PATTERN IBBPBBPBBPBB' PRINTF, unit, 'OUTPUT ' + mpegFileName PRINTF, unit, 'GOP_SIZE 12' PRINTF, unit, 'SLICES_PER_FRAME 1' PRINTF, unit, 'BASE_FILE_FORMAT '+convert_type ;PRINTF, unit, 'INPUT_CONVERT ' + converter + ' *' PRINTF, unit, 'INPUT_CONVERT *' PRINTF, unit, 'INPUT_DIR '+dir PRINTF, unit, 'INPUT' PRINTF, unit, yrddoy+'.*.avg.jpg ['+ first + '-' + last + ']' PRINTF, unit, 'END_INPUT' PRINTF, unit, 'PIXEL HALF' PRINTF, unit, 'RANGE 16' PRINTF, unit, 'PSEARCH_ALG LOGARITHMIC' PRINTF, unit, 'BSEARCH_ALG SIMPLE' PRINTF, unit, 'IQSCALE '+ascale PRINTF, unit, 'PQSCALE '+ascale PRINTF, unit, 'BQSCALE '+ascale PRINTF, unit, 'REFERENCE_FRAME '+aref PRINTF, unit, 'FORCE_ENCODE_LAST_FRAME' FREE_LUN, unit END