Created
February 9, 2023 08:25
-
-
Save mehori/91d281d157010f91e34b171992a10a53 to your computer and use it in GitHub Desktop.
NCLで一番ありがちな「次元が違います」「メタデータがありません」エラーをチェックする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
f1 = addfile("sample1.nc","r") | |
f2 = addfile("sample2.nc","r") | |
v1 = f1->v(0,:,:) ; 0 にした次元は落ちるので、2次元になる | |
v2 = f2->v(0,:,:) | |
printVarSummary(v1) ; 次元を表示してチェック | |
diff = (v2 - v1) - 273.15 ; 算数をするとメタデータが消えたりするので | |
copy_VarCoords(v1, diff) ; 他の変数からコピーしてあげる | |
end | |
・とにかく悩んだら printVarSummary してチェックする | |
・メタデータが欠落したらてきとうなところから copy_VarCoords してあげる | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment