LoginSignup
0
0

More than 5 years have passed since last update.

NCL > function > getMainMarker(wks) > wksを受け取って、塗りつぶした星形のリソースを返す

Last updated at Posted at 2019-02-15
動作環境
Xeon E5-2620 v4 (8コア) x 2
32GB RAM
GeForce GT 730 1GB GDDR5
CentOS 6.9 (64bit)
NCAR Command Language Version 6.3.0
for WRF3.7.1, WPS3.7.1
  openmpi-1.8.x86_64 とその-devel
  mpich.x86_64 3.1-5.el6とその-devel
  gcc version 4.4.7 (とgfortran)
for WRF3.9, WPS3.9
  Open MPI v2.1.1
  gcc version 4.9.2 (とgfortran; devtoolset-3使用)
 NetCDF v4.4.1.1, NetCDF (Fortran API) v4.4.4
Python 2.6.6 (r266:84292, Aug 18 2016, 15:13:37) 
Python 3.6.0 on virtualenv
GNU bash, version 4.1.2(2)-release (x86_64-redhat-linux-gnu)
date (GNU coreutils) 8.4 
tmux 1.6-3.el6

NCL(NCAR Command Language)関連。

関連

マーカーの定義をする場合にインデックスを作るが、それにはwksが必要となる。
マーカーの各種定義とwksの生成後の実装が読みにくくなったため、NCLの関数を使って整理することにした。

この記事では作った関数の紹介を行う。

資料

関数の作り方の資料
- https://www.ncl.ucar.edu/Training/Webinars/NCL_Processing/NCL_Processing_Intro_Part_3.pdf

実装

関数部分だけの実装

詳細はNCL > マーカー > 塗りつぶした星形を配置するを参照。

undef("getMainMarker")
function getMainMarker(wks)
begin
 ; marker (filled star shape)
 mstring = "z"  ; filled start shape
 fontnum = 35
 xoffset = 0.0
 yoffset = 0.0
 ratio = 1.0
 size = 1.0
 angle = 0.0
 index_filled_star = NhlNewMarker(wks, mstring, fontnum, xoffset, yoffset, ratio, size, angle)

 ; filled star (white)
 wrkres = True
 wrkres@gsMarkerColor = "White"
 wrkres@gsMarkerIndex = index_filled_star
 wrkres@gsMarkerSizeF = 0.01
 return(wrkres)
end

getMainMarker()コール時に引数としてwks(workstation)を渡す。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0