⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 movie.csh

📁 Spectral Element Method for wave propagation and rupture dynamics.
💻 CSH
字号:
#!/bin/csh# Generates a movie from *_*_sem2d.ps (output of SEM2D)#-- check argumentsif ( $#argv == 0 | $#argv > 2 ) then  echo "movie.csh [-crop] xx"  echo "where xx = dx, vx or ax, etc"  echo "makes a movie_xx_sem2d.gif from xx_*_sem2d.ps"   echo "-crop crops tightly the image, leaving out text"  exitendif  @ do_crop = ($1 == '-crop')if ( $#argv > 1 ) then  set xx = $2else  set xx = $1endif#-- check gif packagesif ( (! -X convert) | (! -X animate) ) then  echo "  This script requires the ImageMagick package (convert and animate)"  exit 1endifif (-X gifsicle) then  set MERGE_GIF = gifsicle  set MERGE_GIF_OPT =  "-m -d 10 -l"else if (-X gifmerge) then   set MERGE_GIF = gifmerge  set MERGE_GIF_OPT =  -l0else  echo "  This script requires the GIFSICLE or GIFMERGE packages"  exit 1endif#-- make movieecho "  Generating a movie"#@ lxo = 562@ lxo = 533@ lzo = 588@ pxo = 37@ pzo = 158@ marge = 20@ i = 1foreach ps_file ( `/bin/ls ${xx}_*.ps` )  echo "Converting $ps_file..."  set Num = $ps_file:r  if ($do_crop) then  # crop out the text  convert -crop ${lxo}x${lzo}+${pxo}+${pzo} $ps_file tmp.gif  # get effective image size for tight crop  if ($i == 1) then    convert -trim tmp.gif tmp3.gif    set nx = `identify  -format "%w" tmp3.gif`    set nz = `identify  -format "%h" tmp3.gif `    @ nx = $nx + $marge + $marge    @ nz = $nz + $marge + $marge    @ px = $lxo - $nx    @ pz = $lzo - $nz    @ i = 0    rm -f tmp3.gif  endif    convert -crop ${nx}x${nz}+${px}+${pz} -geometry 100% -rotate 90 tmp.gif $Num.gif  else    convert -rotate 90 -resize 640x480 $ps_file $Num.gif    #convert -rotate 90 -resize 320x240 $ps_file $Num.gif  endifendrm -f tmp.gif#gifmerge -l0 Snapshot*.gif > movie_sem2d.gif#gifsicle -m -d 10 -l Snapshot*.gif > movie_sem2d.gif$MERGE_GIF $MERGE_GIF_OPT ${xx}_*.gif > movie_${xx}_sem2d.gifrm -f ${xx}_*.gifecho "Created movie_${xx}_sem2d.gif"echo "To watch it again: animate movie_${xx}_sem2d.gif"animate movie_${xx}_sem2d.gif &#xanim movie_sem2d.gif &

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -