# coding: utf-8 sin#!/usr/bin/ruby # coding: utf-8 require "numru/ggraph" include NumRu # NetCDFファイル "air.mon.mean.nc"から変数"air"を読み,GPhysオブジェクトgpに格納 gp = GPhys::IO.open( "air.mon.mean.nc", "air" ) #経度に関して平均を取る gp = gp.mean('lon') # pngファイルに出力 DCL.swpset("ifl",1) DCL.gropn(2) # 描画画面を準備 # 両軸を線形にする GGraph.set_fig( 'itr'=> 1 ) #12枚の絵に対して行う操作 for i in 1..12 time_label = "2020-" + i.to_s + "-01 00:00:0.0" #時間を2020年1月1日00:00からスタート print i, " : ", time_label, "\n" # 出力の際の経過を画面に表す GGraph.tone( gp.cut('time'=>DateTime.parse(time_label)), true, 'min'=>-100 ) # 最小値設定 GGraph.color_bar # カラーバーを描画 end DCL.grcls # 画面を閉じる