LoginSignup
0
0

More than 5 years have passed since last update.

ECMWFのデータをNCLで読み込む時の注意点(scale_factor,add_offset)

Posted at

ERA-interimのデータをNCLで描画するのにいろいろと手こずってしまっていて。苦笑
一つ解決したのでメモ

参考URL

What are NetCDF files and how can I read them - Copernicus Knowledge Base - ECMWF Confluence Wiki https://confluence.ecmwf.int/display/CKB/What+are+NetCDF+files+and+how+can+I+read+them

ERA-interimの相対渦度(Relative Vorticity)
※ある領域で切り取ったP面データ

ncl
printVarSummary(rv)
Variable: rv
Type: short
Total Size: 1487402072 bytes
            743701036 values
Number of Dimensions: 4
Dimensions and sizes:   [time | 124] x [level | 37] x [latitude | 337] x [longitude | 481]
Coordinates: 
            time: [1016832..1017570]
            level: [1..1000]
            latitude: [21..-21]
            longitude: [150..210]
Number Of Attributes: 7
  scale_factor :    1.571946344201145e-08
  add_offset :  -0.0001068763029856368
  _FillValue :  -32767
  missing_value :   -32767
  units :   s**-1
  long_name :   Vorticity (relative)
  standard_name :   atmosphere_relative_vorticity

桁が多くなるようなパラメータは、データ容量を少なくするためにscale_factorとadd_offsetを使うようになっている。

対処法

scale_factorを掛け、add_offsetを加える。

正しい値 = (元の値 * scale_factor) + add_offset

この処理が必要ない場合

参考URLには

https//confluence.ecmwf.int/display/CKB/What+are+NetCDF+files+and+how+can+I+read+them
●Matlab (ncread, ncwrite) applies Scale_factor and Add_offset automatically
●R (ncvar_get) applies Scale_factor and Add_offset automatically
●Panoply applies Scale_factor and Add_offset automatically. It also displays the values of Scale_factor and Add_offset, causing many users to believe they have to calculate something - no, you don't.
●Metview from version 5 onwards applies Scale_factor and Add_offset automatically; Metview 4.x does not.
●The Unidata NetCDF4 module for Python (which is an interface to the NetCDF C library) applies Scale_factor and Add_offset automatically

と書いてある。これらを使ったことがないのだけど…これらのツールの場合自動的に計算されるので、この処理は必要ない。
また、みんな大好きgradsも同様に自動的に処理されるので、不要。

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