# Title: Ruby script drawing contour map for deepconv/arare5 output data 
#
# History: 2011/09/27 (Masatsugu Odaka)
#
require "numru/ggraph"
include NumRu

file1 = 'AdvTest_xy-y_050_PTemp.nc'
varname = 'PTemp'

var = GPhys::IO.open(file1, varname)
time  = GPhys::IO.open(file1, 't').val

GGraph.set_linear_contour_options( 'min'=>-0.5, 'max'=>4.0, 'interval'=>0.5 )  
GGraph.set_linear_tone_options( 'min'=>-0.5, 'max'=>4.0, 'interval'=>0.1 )  

# <Open DCL>
#DCL.swlset( 'ldump', true )
DCL.swlset( 'lwait', false )
DCL.gropn(4)
GGraph.set_fig('viewport'=>[0.2,0.8,0.2,0.8])

for i in 0...time.length do
# <Drawing data by GGraph>
  GGraph.tone( var.cut(true,true,0,time[i]) )
  GGraph.contour( var.cut(true,true,0,time[i]), false )
  GGraph.color_bar( 'tickintv'=>5 )
end

# <Close DCL>
DCL.grcls
