# -*- coding: utf-8 -*-
# NetCDF ファイルから画像を切り出す Ruby スクリプト
# main = で NetCDF データを指定

require "numru/ggraph"
include NumRu
include GGraph

#<< Graphic Setting >>
DCL.swpset('iwidth',700)      # window width
DCL.swpset('iheight',700)     # window height
###DCL.swpset('ldump',true)      # dump image files
DCL.swpset('lwait',false)     # do not wait mouse click to show the next page
###DCL.swpset('lalt',true)       # background plot
DCL.sgscmn(10)                # change colomap (see below)
###DCL.sgscmn(5)                 # change colomap (see below)

DCL.gropn(2)
DCL.sgpset('lfprop',true)   # to use the propotional font
DCL.sgpset('lcorner',false) # do not show the corner mark
DCL.sgpset('isub', 96)      # control character of subscription: '_' --> '`'
DCL.glpset('lmiss',true)    # handle data missing

#puts "Please input the time."
#num=gets.chomp
#puts "#{num.to_f}"
num=ARGV[1]
filename=ARGV[0].to_s
main = GPhys::IO.open("#{filename}", 'Km')
#main = GPhys::IO.open("#{filename}", 'Exner')
#main = GPhys::IO.open("#{filename}", 'PTemp')
#GGraph.contour( main.cut('t'=>num.to_f) )
GGraph.tone( main.cut('t'=>num.to_f, 'y'=>0) )
GGraph.color_bar('vlength'=>0.5,"landscape"=>true,'tickintv'=>0)
