1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Gradsで陸上のデータのみを描画する方法

Last updated at Posted at 2016-10-24

海と陸両方値を持つデータ(以後landsea.bin,変数名landsea)に対して,陸地のみのデータを使って解析したい場合に,元データから陸面のみのデータセットをgrads scriptで作成します.

必要なデータ:陸地のみ値が入っているデータ(以後landonly.bin,変数名land).

以下スクリプト

'reinit'
'open landonly.ctl'
'define mask = const(land,-1,-u)' #undef(ここでは海の値)を-1に変更
'open landsea.ctl'
'set t 1'
'define maskdata = lterp(mask,landsea.2)' #maskデータを作成
'd maskout(landsea, maskdata)' #陸のみのlandseaデータを描画

補足
maskout(expr,mask)
maskの値がゼロより小さいとき,exprはundefに設定される.

const(expr, value, -u or-a)
-u: undefもvalid dataもvalueに設定
-a: undefのみをvalueに設定.valid dataは変化しない
grads本家ページもあわせて確認してください.

参考
http://cola.gmu.edu/grads/gadoc/gradfuncmaskout.html
http://cola.gmu.edu/grads/gadoc/gradfuncconst.html

1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?