#!/usr/bin/ruby

dir1 = "smallsize-gif/"
dir2 = "/work32/taniro/exp4-1-ensemble/ncdata/meandata/pic/smallsize-gif/"
ofname = "montage.sh"

t0=0.0
i=1

outfile = open(ofname, "w")
outfile.print("\#\!/usr/bin/env sh\n")

51.times{
  t = t0 + 0.2*(i-1)
  i = i + 1
  if t <= 9.8
    time = "#{t}" + "0"
    fname1 = "exp4-1-1_eksp-3D_t=#{time}.gif"
    fname2 = "exp4-e-1_eksp-3D_t=#{time}.gif"
    fname3 = "exp4-m-1_eksp-3D_t=#{time}.gif"
    outfile.print("montage -density 180 -geometry 450x350 -borderwidth 0 #{dir1}#{fname1} #{dir2}#{fname2} #{fname3}", "\n")
  else
    time = "#{t}"
    fname1 = "exp4-1-1_eksp-3D_t=#{time}.gif"
    fname2 = "exp4-e-1_eksp-3D_t=#{time}.gif"
    fname3 = "exp4-m-1_eksp-3D_t=#{time}.gif"
    outfile.print("montage -density 180 -geometry 450x350 -borderwidth 0 #{dir1}#{fname1} #{dir2}#{fname2} #{fname3}", "\n")
  end
}

outfile.close
