Add bounds fails with coordinates crossing the antimeridian or the Greenwich meridian.
@aulemahal đang làm issue này rồi.
Từ ngày 14/12/2022.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 181
- Fork
- 51
- Merge trung bình
- 6 giờ 39 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của xarray-contrib/cf-xarray
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
xarray-contrib/cf-xarray#623 ·
-
Consider adding opt-in support for circular axes when calling `bounds_to_vertices` (related to #594)Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
xarray-contrib/cf-xarray#596 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
xarray-contrib/cf-xarray#570 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
xarray-contrib/cf-xarray#568 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
xarray-contrib/cf-xarray#566 · 2 bình luận ·
Tất cả issue của xarray-contrib/cf-xarray
Issue tương tự
-
Consolidate the now-identical CLI-native and composed tasks_packages guards (#5945 follow-up)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
spec-kitty/spec-kitty#6112 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: OpenRouter streaming chunks report the requested router name instead of the model OpenRouter servedCó thể đã có người làm @Mrun25 đã nhận hôm nay. Đang mởbug llm translation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
BerriAI/litellm#46095 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
uberdeveloper/fastbt#29 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
andrew-blake/melcloudhome#368 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
lane:discover
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SPARDiffData/differential-data-collection#33 ·
Maintainer thường phản hồi trong vòng 1 ngày