7
4

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.

NCOでNetCDFを自在に扱う

Last updated at Posted at 2018-04-24

NetCDFを楽に扱うために便利なNCOコマンドのまとめ (c) 2018 @okadate

  • 2018/04/24 作成

NCO - NetCDF Operator

How to Install

ncks - Kitchen Sink

  • 切りとる
  • -dで切りとる範囲を指定(次元名、最小、最大、stride、duration)
  • 最小・最大のインデックスは 0 始まり、無指定も可
$ ncks -d time,0,2 in.nc out.nc    # 1,2,3番目のみ
$ ncks -d time,,,12 in.nc out.nc   # 12こづつ

  • 次元 time を Record用の次元(以下Rocord次元)に変更する
$ ncks --mk_rec_dmn time in.nc out.nc
  • Rocord次元:= UNLIMITED; //(30 currently)などと表示されるやつ

ncwa - Weighted Averager

  • -a で指定した方向に平均できる
$ ncwa -a rain_time in.nc out.nc

ncra - Record Averager

  • Record方向に平均する(Rocord次元は消える)
$ ncra in.nc out.nc

ncecat - Ensamble Concatenator

  • Record次元を追加できる(各変数に第1次元としてRecord次元が追加される)
$ ncecat in.nc out.nc

  • 本来は複数ファイルのアンサンブルをとるために使う
$ ncecat -u month in_{1..12}.nc out.nc

  • Record次元があるなら ncrcat(Record次元は消える、はず)

ncrename - Renamer

  • 名前を変更する
  • 下の例はrecordというDimensionの名前をfrc_timeに変更する
$ ncrename -d record,frc_time in.nc
7
4
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
7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?