#!/usr/bin/env ruby
#
# 表題: ape お絵描きサムネイル HTML 作成スクリプト
#
# 履歴: 2003/09/28 やまだ由 
#
# 注意: 本プログラムは, 
#       dcphoto.pl Ver 1.02 - 写真用 HTML作成スクリプト
#       Mitsuda Chihiro   <totera@ep.sci.hokudai.ac.jp>
#       を ruby で写経し, やまだ由用にカスタマイズしたものである 
#
#
#
#

END{

  all_exp = ["control", 
             "peaked", 
             "flat", 
             "Qobs", 
             "control-5N", 
             "1keq", 
             "3keq", 
             "3kw1"]

  all_exp.each{ |exp|
    exp_jikkou(exp)
  }

  all_exp.each{ |exp|
    exp_jikkou_anm(exp) unless exp == "control"
  }

  exp_jikkou_sonota

}


########################################################
##  ユーザ設定
########################################################

def jikkou

# インデックスファイル  $PWD/../html/${index}.html, $PWD/../html/table_${index}.rd
# $index = "T39L24_non_radiation_3hour_control_sh"
# $index = "#{$head}#{$figdir}"

# 情報ファイル, $PWD/${infofile}
# $infofile = $index + ".txt"
# $infofile = "T39L24_non_#{$figdir}.txt"

# 拡張子
$base = ".gif"

# 接頭子
# $head = "T39L24_non_control_"

# 絵のあるディレクトリ名, $PWD/../${figdir}
# $figdir = "sh"

# 横にならべるファイル数
# $figtable_num = 3

#画像ファイルサイズ

# $width  = "160" ; $height = "120"
# $width  = "200" ; $height = "150"
# $width  = "280" ; $height = "210"

# テーブル, フォントの色
# $color_table   = "#ADD8E6" 
$color_table   = "#CCFF99" 
$color_font    = "#000080" 
$color_link    = "#269900" 
$color_visited = "#269900" 
$color_hover   = "#99FF33" 

# html ヘッダタイトル
#$title  = "time-mean calculated for APE SH standard output [control]"

# サムネイルタイトル
$header1 = $title 
$header2 = "<br>resolution: T39L24, cumulus parameterization: no cumulus scheme, <br> Original data produced: 2005/02/** on ES. <br><br><hr>

<table BORDER=\"0\" cellspacing=\"10\" align=\"center\">
<tr><td><small>
control: 
</small></td><td><small>
[<a href =\"T39L24_non_control_gt.html\">GT</a>] 
[<a href =\"T39L24_non_control_sh.html\">SH</a>] 
[<a href =\"T39L24_non_control_tr.html\">TR</a>] 
[<a href =\"T39L24_non_control_ml.html\">ML</a>] 
[<a href =\"T39L24_non_control_mf.html\">MF</a>] 
[<a href =\"T39L24_non_control_pf.html\">PF</a>] <br> 
[<a href =\"T39L24_non_control_tr_etc.html\">TR_etc</a>] 
[<a href =\"T39L24_non_control_tr_wk.html\">TR_wk</a>] 
[<a href =\"T39L24_non_control_tr_qtuz.html\">TR_qtuz</a>] 
[<a href =\"T39L24_non_control_tr_qtuz_etc.html\">TR_qtuz_etc</a>] 
[<a href =\"T39L24_non_control_comp.html\">COMP</a>]
</small></td><td><small>
peaked:
</small></td><td><small>
[<a href =\"T39L24_non_peaked_gt.html\">GT</a>] 
[<a href =\"T39L24_non_peaked_sh.html\">SH</a>] 
[<a href =\"T39L24_non_peaked_tr.html\">TR</a>] 
[<a href =\"T39L24_non_peaked_ml.html\">ML</a>] 
[<a href =\"T39L24_non_peaked_mf.html\">MF</a>] 
[<a href =\"T39L24_non_peaked_pf.html\">PF</a>] <br>
[<a href =\"T39L24_non_peaked_tr_etc.html\">TR_etc</a>] 
[<a href =\"T39L24_non_peaked_tr_wk.html\">TR_wk</a>] 
</small></td></tr><tr><td><small>
flat:
</small></td><td><small>
[<a href =\"T39L24_non_flat_gt.html\">GT</a>] 
[<a href =\"T39L24_non_flat_sh.html\">SH</a>] 
[<a href =\"T39L24_non_flat_tr.html\">TR</a>] 
[<a href =\"T39L24_non_flat_ml.html\">ML</a>] 
[<a href =\"T39L24_non_flat_mf.html\">MF</a>] 
[<a href =\"T39L24_non_flat_pf.html\">PF</a>] <br>
[<a href =\"T39L24_non_flat_tr_etc.html\">TR_etc</a>] 
[<a href =\"T39L24_non_flat_tr_wk.html\">TR_wk</a>] 
</small></td><td><small>
Qobs:
</small></td><td><small>
[<a href =\"T39L24_non_Qobs_gt.html\">GT</a>] 
[<a href =\"T39L24_non_Qobs_sh.html\">SH</a>] 
[<a href =\"T39L24_non_Qobs_tr.html\">TR</a>] 
[<a href =\"T39L24_non_Qobs_ml.html\">ML</a>] 
[<a href =\"T39L24_non_Qobs_mf.html\">MF</a>] 
[<a href =\"T39L24_non_Qobs_pf.html\">PF</a>] <br>
[<a href =\"T39L24_non_Qobs_tr_etc.html\">TR_etc</a>] 
[<a href =\"T39L24_non_Qobs_tr_wk.html\">TR_wk</a>] 
</small></td></tr><tr><td><small>
control-5N:
</small></td><td><small>
[<a href =\"T39L24_non_control-5N_gt.html\">GT</a>] 
[<a href =\"T39L24_non_control-5N_sh.html\">SH</a>] 
[<a href =\"T39L24_non_control-5N_tr.html\">TR</a>]
[<a href =\"T39L24_non_control-5N_ml.html\">ML</a>] 
[<a href =\"T39L24_non_control-5N_mf.html\">MF</a>] 
[<a href =\"T39L24_non_control-5N_pf.html\">PF</a>] <br>
[<a href =\"T39L24_non_control-5N_tr_etc.html\">TR_etc</a>] 
[<a href =\"T39L24_non_control-5N_tr_wk.html\">TR_wk</a>] 
</small></td><td><small>
1keq:
</small></td><td><small>
[<a href =\"T39L24_non_1keq_gt.html\">GT</a>] 
[<a href =\"T39L24_non_1keq_sh.html\">SH</a>] 
[<a href =\"T39L24_non_1keq_tr.html\">TR</a>]
[<a href =\"T39L24_non_1keq_ml.html\">ML</a>] 
[<a href =\"T39L24_non_1keq_mf.html\">MF</a>] 
[<a href =\"T39L24_non_1keq_pf.html\">PF</a>] <br>
[<a href =\"T39L24_non_1keq_tr_etc.html\">TR_etc</a>] 
[<a href =\"T39L24_non_1keq_tr_wk.html\">TR_wk</a>] 
[<a href =\"T39L24_non_1keq_sh_anm.html\">SHanm</a>] 
</small></td></tr><tr><td><small>
3keq:
</small></td><td><small>
[<a href =\"T39L24_non_3keq_gt.html\">GT</a>] 
[<a href =\"T39L24_non_3keq_sh.html\">SH</a>] 
[<a href =\"T39L24_non_3keq_tr.html\">TR</a>]
[<a href =\"T39L24_non_3keq_ml.html\">ML</a>] 
[<a href =\"T39L24_non_3keq_mf.html\">MF</a>] 
[<a href =\"T39L24_non_3keq_pf.html\">PF</a>] <br>
[<a href =\"T39L24_non_3keq_tr_etc.html\">TR_etc</a>] 
[<a href =\"T39L24_non_3keq_tr_wk.html\">TR_wk</a>] 
[<a href =\"T39L24_non_3keq_sh_anm.html\">SHanm</a>] 
</small></td><td><small>
3kw1:
</small></td><td><small>
[<a href =\"T39L24_non_3kw1_gt.html\">GT</a>] 
[<a href =\"T39L24_non_3kw1_sh.html\">SH</a>] 
[<a href =\"T39L24_non_3kw1_tr.html\">TR</a>]
[<a href =\"T39L24_non_3kw1_ml.html\">ML</a>] 
[<a href =\"T39L24_non_3kw1_mf.html\">MF</a>] 
[<a href =\"T39L24_non_3kw1_pf.html\">PF</a>] <br>
[<a href =\"T39L24_non_3kw1_tr_etc.html\">TR_etc</a>] 
[<a href =\"T39L24_non_3kw1_tr_wk.html\">TR_wk</a>] 
[<a href =\"T39L24_non_3kw1_sh_anm.html\">SHanm</a>] 
</small></td></tr></table>
<hr>
[<a href =\"../T39L48_eml/T39L48_eml.html\">T39L48_eml</a>] 
[<a href =\"../T39L48_ias/T39L48_ias.html\">T39L48_ias</a>] 
[<a href =\"../T39L48_ksc/T39L48_ksc.html\">T39L48_ksc</a>] 
[<a href =\"../T39L48_kuo/T39L48_kuo.html\">T39L48_kuo</a>] 
[<a href =\"../T39L48_mca/T39L48_mca.html\">T39L48_mca</a>] 
[<a href =\"../T39L48_non/T39L48_non.html\">T39L48_non</a>] 
<hr>
[<a href =\"../T39L24_eml/T39L24_eml.html\">T39L24_eml</a>] 
[<a href =\"../T39L48_eml/T39L48_eml.html\">T39L48_eml</a>] 
[<a href =\"../T39L96_eml/T39L96_eml.html\">T39L96_eml</a>] 
[<a href =\"../T79L48_eml/T79L48_eml.html\">T79L48_eml</a>] 
[<a href =\"../T159L48_eml/T159L48_eml.html\">T159L48_eml</a>] 
[<a href =\"../T319L48_eml/T319L48_eml.html\">T319L48_eml</a>] 
<hr>
[<a href =\"../T39L24_non/T39L24_non.html\">T39L24_non</a>] 
[<a href =\"../T39L48_non/T39L48_non.html\">T39L48_non</a>] 
[<a href =\"../T39L96_non/T39L96_non.html\">T39L96_non</a>] 
[<a href =\"../T79L48_non/T79L48_non.html\">T79L48_non</a>] 
[<a href =\"../T159L48_non/T159L48_non.html\">T159L48_non</a>] 
[<a href =\"../T319L48_non/T319L48_non.html\">T319L48_non</a>] 
<hr>
[<a href =\"../\">HOME</a>]
"


# サムネイルフッタ ;
$footer = "Last update: #{Time.now} <br> 
           Copyright &copy\; AGU for APE 2005 (YAMADA Yukiko)"


# ファイル生成実行
print $title, "\n" ; apethum

end



########################################################
##  include ファイル
########################################################

require 'date'
require '/home/yukiko/lib/ape-thum.rb'
$KCODE = "e"


########################################################
##  ローカル生成ルーチン
########################################################

def exp_jikkou(exp)

  $head = "T39L24_non_#{exp}_"
  $figdir = "sh"
  $index = "#{$head}#{$figdir}"
  $infofile = "#{$figdir}.txt"
  $title  = "Aqua Planet: Single-Level 2-D Means from \'#{exp}\' Experiment" 
  $width  = "200";  $height = "150" ; $figtable_num = 4
  jikkou

  $head = "T39L24_non_#{exp}_"
  $figdir = "gt"
  $index = "#{$head}#{$figdir}"
  $infofile = "#{$figdir}.txt"
  $title  = "Aqua Planet: Global Time-Series from \'#{exp}\' Experiment"
  $width  = "280" ; $height = "210" ; $figtable_num = 3
  jikkou

  $head = "T39L24_non_#{exp}_"
  $figdir = "ml"
  $index = "#{$head}#{$figdir}"
  $infofile = "#{$figdir}.txt"
  $title  = "Aqua Planet: Multiple-Level 3-D Means from \'#{exp}\' Experiment"
  $width  = "280" ; $height = "210" ; $figtable_num = 3
  jikkou

  $head = "T39L24_non_#{exp}_"
  $figdir = "mf"
  $index = "#{$head}#{$figdir}"
  $infofile = "#{$figdir}.txt"
  $title  = "Aqua Planet: Multiple-Level Zonal Mean Fluxes from \'#{exp}\' Experiment"
  $width  = "280" ; $height = "210" ; $figtable_num = 3
  jikkou

  $head = "T39L24_non_#{exp}_"
  $figdir = "pf"
  $index = "#{$head}#{$figdir}"
  $infofile = "#{$figdir}.txt"
  $title  = "Aqua Planet: Parameterization Forcing from from \'#{exp}\' Experiment"
  $width  = "280" ; $height = "210" ; $figtable_num = 3
  jikkou

  $head = "T39L24_non_#{exp}_"
  $figdir = "tr_wk"
  $index = "#{$head}#{$figdir.sub("_wk","")}"
  $infofile = "#{$figdir.sub("_wk","")}.txt"
  $title  = "Aqua Planet: Transients from \'#{exp}\' Experiment"
  $width  = "200";  $height = "150" ; $figtable_num = 4
  jikkou

  $head = "T39L24_non_#{exp}_"
  $figdir = "tr_etc"
  $index = "#{$head}#{$figdir}"
  $infofile = "#{$figdir}.txt"
  $title  = "Aqua Planet: Transients from \'#{exp}\' Experiment ...consideration"
  $width  = "200";  $height = "150" ; $figtable_num = 4
  jikkou

  $head = "T39L24_non_#{exp}_"
  $figdir = "tr_wk"
  $index = "#{$head}#{$figdir}"
  $infofile = "#{$figdir}.txt"
  $title  = "Aqua Planet: Takayabu (1994), Wheeler and Kiladis (1999) Plot from \'#{exp}\' Experiment"
  $width  = "200";  $height = "150" ; $figtable_num = 4
  jikkou

end

def exp_jikkou_anm(exp)

  $head = "T39L24_non_#{exp}_"
  $figdir = "sh"
  $index = "#{$head}#{$figdir}_anm"
  $infofile = "#{$figdir}_anm.txt"
  $title  = "Aqua Planet: Single-Level 2-D Means from \'#{exp}\' Experiment" 
  $width  = "200";  $height = "150" ; $figtable_num = 4
  jikkou

  $head = "T39L24_non_#{exp}_"
  $figdir = "gt"
  $index = "#{$head}#{$figdir}_anm"
  $infofile = "#{$figdir}_anm.txt"
  $title  = "Aqua Planet: Global Time-Series from \'#{exp}\' Experiment"
  $width  = "280" ; $height = "210" ; $figtable_num = 3
  jikkou

  $head = "T39L24_non_#{exp}_"
  $figdir = "ml"
  $index = "#{$head}#{$figdir}_anm"
  $infofile = "#{$figdir}_anm.txt"
  $title  = "Aqua Planet: Multiple-Level 3-D Means from \'#{exp}\' Experiment"
  $width  = "280" ; $height = "210" ; $figtable_num = 3
  jikkou

  $head = "T39L24_non_#{exp}_"
  $figdir = "mf"
  $index = "#{$head}#{$figdir}_anm"
  $infofile = "#{$figdir}_anm.txt"
  $title  = "Aqua Planet: Multiple-Level Zonal Mean Fluxes from \'#{exp}\' Experiment"
  $width  = "280" ; $height = "210" ; $figtable_num = 3
#  jikkou

end


def exp_jikkou_sonota

  $head = "T39L24_non"
  $figdir = ""
  $index = "#{$head}#{$figdir}"
  $infofile = "T39L24_non.txt"
  $title  = "Aqua Planet: T39L24_non Experiment" 
  $width  = "200";  $height = "150" ; $figtable_num = 4
  jikkou

  $head = "T39L24_non_control_"
  $figdir = "comp"
  $index = "#{$head}#{$figdir}"
  $infofile = "#{$figdir}.txt"
  $title  = "Aqua Planet: Composite from \'control\' Experiment"
  $width  = "200";  $height = "150" ; $figtable_num = 4
  jikkou

  $head = "T39L24_non_control_"
  $figdir = "tr_qtuz"
  $index = "#{$head}#{$figdir}_etc"
  $infofile = "#{$figdir}_etc.txt"
  $title  = "Aqua Planet: Transients from \'control\' Experiment"
  $width  = "200";  $height = "150" ; $figtable_num = 4
  jikkou

  $head = "T39L24_non_control_"
  $figdir = "tr_qtuz_wk"
  $index = "#{$head}#{$figdir.sub("_wk","")}"
  $infofile = "#{$figdir.sub("_wk","")}.txt"
  $title  = "Aqua Planet: Transients from \'control\' Experiment"
  $width  = "200";  $height = "150" ; $figtable_num = 4
  jikkou

end







