#!/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{

  ["a","con","b","c","d"].each{ |exp|

    cum = "adj"
    html_make(cum, exp)
    cum = "kuo"
    html_make(cum, exp)
    
  }

  ["c"].each{ |exp|

    cum = "adj"
    html_make_misc(cum, exp)
    
  }
  
  sonota_jikkou

}

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

def jikkou

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

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

# 拡張子
$base = ".gif"

# 接頭子
# $head = "T39L48_eml_control_"

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

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

#画像ファイルサイズ

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

# テーブル, フォントの色
$color_table   = "#ADD8E6" 
$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 = "#{$header2pre}<br>
<br>
[<a href =\"spctfilt_setting.html\">Filter Settings</a>] 
<br><br>
<hr>
<table BORDER=\"0\" cellspacing=\"10\" align=\"center\">
<tr><td><small>
adj_a: 
</small></td><td><small>
[<a href =\"adj_a_spctfilt_xt.html\">xt</a>] 
[<a href =\"adj_a_spctfilt_xtop.html\">xtop</a>] 
[<a href =\"adj_a_spctfilt_spct.html\">spct</a>] 
[<a href =\"adj_a_spctfilt_comp-xz.html\">comp-xz</a>] 
[<a href =\"adj_a_spctfilt_comp-xy.html\">comp-xy</a>] 
[<a href =\"adj_a_spctfilt_realcomp-xz.html\">realcomp-xz</a>] 
[<a href =\"adj_a_spctfilt_realcomp-xy.html\">realcomp-xy</a>] 
</small></td><td><small>
kuo_a: 
</small></td><td><small>
[<a href =\"kuo_a_spctfilt_xt.html\">xt</a>] 
[<a href =\"kuo_a_spctfilt_xtop.html\">xtop</a>] 
[<a href =\"kuo_a_spctfilt_spct.html\">spct</a>] 
[<a href =\"kuo_a_spctfilt_comp-xz.html\">comp-xz</a>] 
[<a href =\"kuo_a_spctfilt_comp-xy.html\">comp-xy</a>] 
[<a href =\"kuo_a_spctfilt_realcomp-xz.html\">realcomp-xz</a>] 
[<a href =\"kuo_a_spctfilt_realcomp-xy.html\">realcomp-xy</a>] 
</small></td></tr><tr><td><small>
adj_con: 
</small></td><td><small>
[<a href =\"adj_con_spctfilt_xt.html\">xt</a>] 
[<a href =\"adj_con_spctfilt_xtop.html\">xtop</a>] 
[<a href =\"adj_con_spctfilt_spct.html\">spct</a>] 
[<a href =\"adj_con_spctfilt_comp-xz.html\">comp-xz</a>] 
[<a href =\"adj_con_spctfilt_comp-xy.html\">comp-xy</a>] 
[<a href =\"adj_con_spctfilt_realcomp-xz.html\">realcomp-xz</a>] 
[<a href =\"adj_con_spctfilt_realcomp-xy.html\">realcomp-xy</a>] 
</small></td><td><small>
kuo_con: 
</small></td><td><small>
[<a href =\"kuo_con_spctfilt_xt.html\">xt</a>] 
[<a href =\"kuo_con_spctfilt_xtop.html\">xtop</a>] 
[<a href =\"kuo_con_spctfilt_spct.html\">spct</a>] 
[<a href =\"kuo_con_spctfilt_comp-xz.html\">comp-xz</a>] 
[<a href =\"kuo_con_spctfilt_comp-xy.html\">comp-xy</a>] 
[<a href =\"kuo_con_spctfilt_realcomp-xz.html\">realcomp-xz</a>] 
[<a href =\"kuo_con_spctfilt_realcomp-xy.html\">realcomp-xy</a>] 
</small></td></tr><tr><td><small>
adj_b: 
</small></td><td><small>
[<a href =\"adj_b_spctfilt_xt.html\">xt</a>] 
[<a href =\"adj_b_spctfilt_xtop.html\">xtop</a>] 
[<a href =\"adj_b_spctfilt_spct.html\">spct</a>] 
[<a href =\"adj_b_spctfilt_comp-xz.html\">comp-xz</a>] 
[<a href =\"adj_b_spctfilt_comp-xy.html\">comp-xy</a>] 
[<a href =\"adj_b_spctfilt_realcomp-xz.html\">realcomp-xz</a>] 
[<a href =\"adj_b_spctfilt_realcomp-xy.html\">realcomp-xy</a>] 
</small></td><td><small>
kuo_b: 
</small></td><td><small>
[<a href =\"kuo_b_spctfilt_xt.html\">xt</a>] 
[<a href =\"kuo_b_spctfilt_xtop.html\">xtop</a>] 
[<a href =\"kuo_b_spctfilt_spct.html\">spct</a>] 
[<a href =\"kuo_b_spctfilt_comp-xz.html\">comp-xz</a>] 
[<a href =\"kuo_b_spctfilt_comp-xy.html\">comp-xy</a>] 
[<a href =\"kuo_b_spctfilt_realcomp-xz.html\">realcomp-xz</a>] 
[<a href =\"kuo_b_spctfilt_realcomp-xy.html\">realcomp-xy</a>] 
</small></td></tr><tr><td><small>
adj_c: 
</small></td><td><small>
[<a href =\"adj_c_spctfilt_xt.html\">xt</a>] 
[<a href =\"adj_c_spctfilt_xtop.html\">xtop</a>] 
[<a href =\"adj_c_spctfilt_spct.html\">spct</a>] 
[<a href =\"adj_c_spctfilt_comp-xz.html\">comp-xz</a>] 
[<a href =\"adj_c_spctfilt_comp-xy.html\">comp-xy</a>] 
[<a href =\"adj_c_spctfilt_realcomp-xz.html\">realcomp-xz</a>] 
[<a href =\"adj_c_spctfilt_realcomp-xy.html\">realcomp-xy</a>] 
</small></td><td><small>
kuo_c: 
</small></td><td><small>
[<a href =\"kuo_c_spctfilt_xt.html\">xt</a>] 
[<a href =\"kuo_c_spctfilt_xtop.html\">xtop</a>] 
[<a href =\"kuo_c_spctfilt_spct.html\">spct</a>] 
[<a href =\"kuo_c_spctfilt_comp-xz.html\">comp-xz</a>] 
[<a href =\"kuo_c_spctfilt_comp-xy.html\">comp-xy</a>] 
[<a href =\"kuo_c_spctfilt_realcomp-xz.html\">realcomp-xz</a>] 
[<a href =\"kuo_c_spctfilt_realcomp-xy.html\">realcomp-xy</a>] 
</small></td></tr><tr><td><small>
adj_d: 
</small></td><td><small>
[<a href =\"adj_d_spctfilt_xt.html\">xt</a>] 
[<a href =\"adj_d_spctfilt_xtop.html\">xtop</a>] 
[<a href =\"adj_d_spctfilt_spct.html\">spct</a>] 
[<a href =\"adj_d_spctfilt_comp-xz.html\">comp-xz</a>] 
[<a href =\"adj_d_spctfilt_comp-xy.html\">comp-xy</a>] 
[<a href =\"adj_d_spctfilt_realcomp-xz.html\">realcomp-xz</a>] 
[<a href =\"adj_d_spctfilt_realcomp-xy.html\">realcomp-xy</a>] 
</small></td><td><small>
kuo_d: 
</small></td><td><small>
[<a href =\"kuo_d_spctfilt_xt.html\">xt</a>] 
[<a href =\"kuo_d_spctfilt_xtop.html\">xtop</a>] 
[<a href =\"kuo_d_spctfilt_spct.html\">spct</a>] 
[<a href =\"kuo_d_spctfilt_comp-xz.html\">comp-xz</a>] 
[<a href =\"kuo_d_spctfilt_comp-xy.html\">comp-xy</a>] 
[<a href =\"kuo_d_spctfilt_realcomp-xz.html\">realcomp-xz</a>] 
[<a href =\"kuo_d_spctfilt_realcomp-xy.html\">realcomp-xy</a>] 
</small></td></tr></table>
<hr> 
[misc] adj_c: 
[<a href =\"adj_c_spctfilt_misc_xt.html\">xt</a>] 
[<a href =\"adj_c_spctfilt_misc_xtop.html\">xtop</a>] 
[<a href =\"adj_c_spctfilt_misc_spct.html\">spct</a>] 
[<a href =\"adj_c_spctfilt_misc_comp-xz.html\">comp-xz</a>] 
[<a href =\"adj_c_spctfilt_misc_comp-xy.html\">comp-xy</a>] 
[<a href =\"adj_c_spctfilt_misc_realcomp-xz.html\">realcomp-xz</a>] 
[<a href =\"adj_c_spctfilt_misc_realcomp-xy.html\">realcomp-xy</a>] 
[<a href =\"adj_c_spctfilt_misc_comp-z4-xz.html\">comp-z4-xz</a>] 
[<a href =\"adj_c_spctfilt_misc_comp-z4-xy.html\">comp-z4-xy</a>] 
<hr> 
[<a href =\"../stdexp/stdexp.html\">Standard</a>] 
[<a href =\"../t42l12/t42l12.html\">T42L12</a>] 
[<a href =\"../hs86sst/hs86sst.html\">HS86SST</a>] 
<hr> 
[<a href= \"../\">HOME</a>]
"


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

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

end



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

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


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

def html_make(cum, exp)

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt"
  $index = "#{$head}#{$figdir}_xt"
  $infofile = "spctfilt_xt.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "filtered x-t diagram"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt"
  $index = "#{$head}#{$figdir}_xtop"
  $infofile = "spctfilt_xtop.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "filtered x-t diagram overploted realdata"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt"
  $index = "#{$head}#{$figdir}_spct"
  $infofile = "spctfilt_spct.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "filtered x-t spctrum"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt"
  $index = "#{$head}#{$figdir}_comp-xy"
  $infofile = "spctfilt_comp-xy.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "filtered composite x-y diagram"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt"
  $index = "#{$head}#{$figdir}_comp-xz"
  $infofile = "spctfilt_comp-xz.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "filtered composite x-z diagram"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt"
  $index = "#{$head}#{$figdir}_realcomp-xy"
  $infofile = "spctfilt_realcomp-xy.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "composite x-y diagram used the filtered reference point"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt"
  $index = "#{$head}#{$figdir}_realcomp-xz"
  $infofile = "spctfilt_realcomp-xz.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "composite x-z diagram used the filtered reference point"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

end


def html_make_misc(cum, exp)

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt_misc"
  $index = "#{$head}#{$figdir}_xt"
  $infofile = "spctfilt_misc/#{cum}_#{exp}_spctfilt_xt.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "filtered x-t diagram"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt_misc"
  $index = "#{$head}#{$figdir}_xtop"
  $infofile = "spctfilt_misc/#{cum}_#{exp}_spctfilt_xtop.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "filtered x-t diagram overploted realdata"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt_misc"
  $index = "#{$head}#{$figdir}_spct"
  $infofile = "spctfilt_misc/#{cum}_#{exp}_spctfilt_spct.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "filtered x-t spctrum"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt_misc"
  $index = "#{$head}#{$figdir}_comp-xz"
  $infofile = "spctfilt_misc/#{cum}_#{exp}_spctfilt_comp-xz.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "filtered composite x-z diagram"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt_misc"
  $index = "#{$head}#{$figdir}_realcomp-xz"
  $infofile = "spctfilt_misc/#{cum}_#{exp}_spctfilt_realcomp-xz.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "composite x-z diagram used the filtered reference point"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt_misc"
  $index = "#{$head}#{$figdir}_comp-xy"
  $infofile = "spctfilt_misc/#{cum}_#{exp}_spctfilt_comp-xy.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "filtered composite x-y diagram"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt_misc"
  $index = "#{$head}#{$figdir}_realcomp-xy"
  $infofile = "spctfilt_misc/#{cum}_#{exp}_spctfilt_realcomp-xy.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "composite x-y diagram used the filtered reference point"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt_misc"
  $index = "#{$head}#{$figdir}_comp-z4-xz"
  $infofile = "spctfilt_misc/#{cum}_#{exp}_spctfiltz4_comp-xz.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "filtered composite x-z diagram"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

  $head = "#{cum}_#{exp}_"
  $figdir = "spctfilt_misc"
  $index = "#{$head}#{$figdir}_comp-z4-xy"
  $infofile = "spctfilt_misc/#{cum}_#{exp}_spctfiltz4_comp-xy.txt"
  $title  = "#{cum}_#{exp} spectral filtering" 
  $header2pre = "filtered composite x-y diagram"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

end


def sonota_jikkou

  $head = ""
  $figdir = "spctfilt"
  $index = "spctfilt_setting"
  $infofile = "spctfilt_setting.txt"
  $title  = "spectral filtering" 
  $header2pre = "setting"
  $width  = "200" ; $height = "150" ; $figtable_num = 4
  jikkou

end

def anim_sed(index)

  `sed s/-t0.gif\\"\\>/-anim.gif\\"\\>/ ../#{index}.html > tmp.html`
  `mv tmp.html ../#{index}.html`

end






