ruby dcl メモ


  1. long_name
  2. units
  3. missing_value
  4. color map
  5. copy
  6. 配列サイズ情報
  7. mask
  8. 描画範囲クリップ
  9. フォント

long_name

gphys.long_name = "long name"

units

gphys.units = "unit"

missing_value

rmiss = gphys.get_att('missing_value')[0]

color map

DCL.sgscmn(4)  # blue-cyan-white-yellow-red
DCL.sgscmn(14) # blue-white-red

see also here

copy

gphyscopied = gphys.copy

軸情報取得・変換

z = gphys.axis(namelev).pos.convert_units( Units['Pa'] )
z.long_name = 'pressure'
gphys.axis(namelev).set_pos(z)

z = gphys.axis(namelev).pos.convert_units( Units['days since 1979-1-1 00:00:0.0'] )
gphys.axis(namelev).set_pos(z)

time = gphys.coord('time').val

ls = gphys.coord('ls').val
ls = ls + 360
ls = ls % 360
varraytime = VArray.new( ls,
                { "long_name"=>'Ls',
                  "units"=>'degree' }, "ls" )
gphys.axis('ls').set_pos(varraytime)

km = gphyscopied.shape[1]

時間軸指定のための変換

Date.parse("2010-01-04")

軸の太さなど

#DCLExt.uz_set_params 'indext1'=>3,'indext2'=>5,'indexl1'=>5,'indexl2'=>5
DCLExt.uz_set_params 'indext1'=>9,'indext2'=>9,'indexl1'=>9,'indexl2'=>9

references:

配列サイズ情報

size = gphys.length

shapearray = gphys.shape

mask

mask = gphys.val.get_mask

k = 0
while k < km
  j = 0
  while j < jm
    if mask[j,k] == 1 then
      gphysout[j,k] = ( RPlanet * cos( lat[j] * PI / 180.0 ) * Omega + gphysout.val[j,k] ) * RPlanet * cos( lat[j] * PI / 180.0 )
    end
    j = j + 1
  end
  k = k + 1
end

描画範囲クリップ

DCL.sgpset('lclip', true)

フォント

変更

DCL.sgiset('IFONT', 2)
DCL.sgstxi(3)

see <URL:http://ruby.gfd-dennou.org/products/ruby-dcl/ruby-dcl-doc/rakuraku/node24.html>

サイズ

DCL.uzfact(0.75)

Last Updated: 2012/09/23, Since: 2012/09/23