$LOAD_PATH.unshift("../lib/") require "numru/gphys/gphys.rb" require "numru/gphys/gphys_io.rb" require "test/unit" include NumRu class GPhysTest < Test::Unit::TestCase def setup @T = GPhys::IO.open("../testdata/T.jan.nc","T") # NetCDF data @Tgd = GPhys::IO.open("../testdata/T.jan.ctl","T") # GrADS data end def test_cyclic_ext te = @T.cyclic_ext(0) assert_equal( te.shape[0], @T.shape[0]+1 ) # to make sure it is extened assert_equal( te.axis(0).pos.max.to_f, 360.0 ) # to make sure it is extened te = @Tgd.cyclic_ext(0) assert_equal( te.axis(0).pos.max.to_f, 360.0 ) # to make sure it is extened end end