以前のリビジョンの文書です


perlのスクリプト

  • perlのことをよく知らないので汚いと思います.

ディレクトリ内のepsをjpgに変換

epsをjpgに変換しておくと,nautilusやビューワでサムネイルが見れる. (epsを見れるビューワがあればいいんだけど)

#!/usr/bin/perl
$dir = './';
opendir DH, $dir or die "$dir:$!";
while ($file = readdir DH) {
    if( $file =~ m/\.eps$/ ){
	@array = split(/\./,$file);
	$value = $array[0].".jpg";
	print $file,$value;
	system "convert $file $value";
    }
}
closedir DH;
<code>
 
 
===== 数値計算で得られた連番ファイルを可視化 =====
 
<code perl>
#!/usr/bin/perl
$gpfile .= sprintf("%s\n","set terminal gif");
$gpfile .= sprintf("%s\n","set pm3d map");
for($i=1;$i < 30;$i++){
    $file = sprintf("hoge%04d",$i*10);
    $gpfile .= sprintf("%s\n","set output \"$file.gif\"");
    $gpfile .= sprintf("%s\n","splot \"$file.dat\" using 1:2:5");
};
open (GP, "| gnuplot" ) or die "no gnuplot";
print GP "$gpfile";
close GP;
system("gifsicle --delay 50 hoge*gif > anime.gif");

gifsicle はgifアニメを作成するツール.アニメを見るにはgifview.

gifview -a anim.gif
perl.1247210000.txt.gz · 最終更新: 2009/07/10 16:13 by 10.249.202.217
CC Attribution-Noncommercial-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0