if ( $OPT_dump ) /(.*)_.*-s-(.*)\.nc/ =~ ARGV[1] info = $1+"_"+$2 /(.*)\.nc/ =~ ARGV[0] info1 = $1 /(.*)\.nc/ =~ ARGV[1] info2 = $1 /(.*)\.nc/ =~ ARGV[2] info3 = $1 convert = '~sugiyama/work/deepconv/arare4/tools/dcmodel-dclps2png.rb' order = Math::log10(time0+deltime*num).to_i + 1 fmt = "%0"+(order.to_i).to_s+"d" for i in 0..num time = sprintf(fmt, time0 + i * deltime) j = i * 3 + 1 k = i * 3 + 2 l = i * 3 + 3 outputfile = info+"_t"+time.to_s+".png" pngfile1 = info1+"_t"+time.to_s+".png" pngfile2 = info2+"_t"+time.to_s+".png" pngfile3 = info3+"_t"+time.to_s+".png" pgmfile1 = info1+"_t"+time.to_s+".pgm" pgmfile2 = info2+"_t"+time.to_s+".pgm" pgmfile3 = info3+"_t"+time.to_s+".pgm" output1 = "xwdtopnm dcl_"+j+".xwd | pnmtopng > "+pngfile1 output2 = "xwdtopnm dcl_"+k+".xwd | pnmtopng > "+pngfile2 output3 = "xwdtopnm dcl_"+l+".xwd | pnmtopng > "+pngfile2 convert1 = "convert "+pngfile1+" "+pgmfile1 convert2 = "convert "+pngfile2+" "+pgmfile2 convert3 = "convert "+pngfile3+" "+pgmfile3 convert4 = "convert -channel Red "+pgmfile1+" -channel Green "+pgmfile2+" -channel Blue "+pgmfile3+" -combine "+outputfile del = "rm "+ pngfile1+" "+pngfile2+" "+pngfile3+" "+pgmfile1+" "+pgmfile2+" "+pgmfile3 system( output1 ) system( output2 ) system( output3 ) system( convert1 ) p convert1 system( convert2 ) p convert2 system( convert3 ) p convert3 system( convert4 ) p convert4 system( del ) p del end end