Add bounds fails with coordinates crossing the antimeridian or the Greenwich meridian.
@aulemahal がすでに取り組んでいます。
2022年12月14日 から。
評価
この issue はまだ評価されていません。
説明
Yet another bug with .cf.add_bounds... This one was already present before the 2D addition, but it would have been quite infrequent with 1D coordinates.
The interpolation / extrapolation estimates are not aware of the cyclic nature of the longitude.
MWE:
import xarray as xr
import cf_xarray
ds = xr.Dataset(
{'data': (('x', 'y'), np.ones((3, 3)))},
coords={
'x': [1, 2, 3],
'y': [1, 2, 3],
'lon': (('x',), [170, -170, -150], {'units': 'degrees_east'}),
'lat': (('y',), [-10, 0, 10], {'units': 'degrees_north'}),
},
)
ds.cf.add_bounds(('lon', 'lat')).lon_bounds
yields:
array([[ 340., 0.],
[ 0., -340.],
[-160., -140.]])
but we would expect:
array([[ 160., 0.],
[ 0., -160.],
[-160., -140.]])
Sadly, a quick internet search hasn't given me any pointers towards tools that already take this into account, except for projection-based tools (like pyproj).
We could have a check for "longitude" that looks for jumps and wraps the coordinates, but that jump threshold would be arbitrary. It's nonetheless the simplest way out I see, before parsing grid_mapping into pyproj objects.
- 主要言語
- Python
- スター
- 181
- フォーク
- 49
- 平均マージ
- 43分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
xarray-contrib/cf-xarray のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
xarray-contrib/cf-xarray#666 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
xarray-contrib/cf-xarray#623 ·
-
Consider adding opt-in support for circular axes when calling `bounds_to_vertices` (related to #594)オープン
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
xarray-contrib/cf-xarray#596 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
xarray-contrib/cf-xarray#570 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
xarray-contrib/cf-xarray#568 ·
xarray-contrib/cf-xarray の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
BasedHardware/omi#20271 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
openai/openai-cookbook#3153 ·
メンテナーはふだん 1 日以内に返信
-
cvss-severity:high devguard l3montree-cybersecurity/devguard/devguard pkg:golang/github.com/l3montree-dev/devguard risk:low state:open
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
l3montree-dev/devguard#3146 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
open-webui/open-webui#31849 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信