fix netlink contours for spherical grids
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start with the spherical grid and netlink contour property path exercised by the reproduction, especially curvilinear_compute_rectangular_grid_on_extension, curvilinear_convert_to_mesh2d, and mesh2d_get_property. Compare contour widths in longitude and latitude against cell circumcenters for the supplied 0.3-degree grid. Done when spherical-grid contours reach the circumcenters in both directions.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
When deriving the netlink contours for spherical grids, they seem too wide in the longitude direction, but they are as expected in the latitude direction.
To Reproduce
import xugrid as xu
from meshkernel.py_structures import Mesh2dProperty, Mesh2dLocation
import matplotlib.pyplot as plt
plt.close('all')
import numpy as np
from meshkernel import (
MeshKernel,
ProjectionType,
GeometryList,
MakeGridParameters,
Mesh2dProperty,
Mesh2dLocation,
)
# create basegrid
lon_min, lon_max, lat_min, lat_max = 1, 2, 48.5, 49.2
dxy = 0.3
make_grid_parameters = MakeGridParameters(
origin_x=lon_min,
origin_y=lat_min,
upper_right_x=lon_max,
upper_right_y=lat_max,
block_size_x=dxy,
block_size_y=dxy,
)
mk = MeshKernel(projection=ProjectionType.SPHERICAL)
mk.curvilinear_compute_rectangular_grid_on_extension(make_grid_parameters)
mk.curvilinear_convert_to_mesh2d() # convert to ugrid/mesh2d
mesh2d = mk.mesh2d_get()
net_contour = mk.mesh2d_get_property(
mesh2d_location=Mesh2dLocation.EDGES,
property=Mesh2dProperty.NETLINK_CONTOUR_POLYGON,
)
fig, ax = plt.subplots(1, 1, sharex=True, sharey=True)
mesh2d.plot_edges(ax=ax)
# reshape netcontours
_LINK_CONTOUR_MAX_VERTICES = 4
n_edges = mesh2d.edge_nodes.size // 2
contour_x = np.asarray(net_contour.x_coordinates, dtype=np.float64).reshape(
n_edges, _LINK_CONTOUR_MAX_VERTICES
)
contour_y = np.asarray(net_contour.y_coordinates, dtype=np.float64).reshape(
n_edges, _LINK_CONTOUR_MAX_VERTICES
)
ncontours = range(len(contour_x))
for n, x, y in zip(ncontours, contour_x, contour_y):
x = np.concatenate([x, [x[0]]])
y = np.concatenate([y, [y[0]]])
# only plot some of the netlink contours to not flood the figures
if np.remainder(n, 8) != 0:
continue
# plt.text(np.mean(x), np.mean(y), str(n))
ax.plot(x, y, "r")
ax.set_aspect("equal")
fig.tight_layout()
plt.show()
Gives the following figure:
Expected behavior
Netlink contours should reach until the circumcenter of the cells, which is the center in case of square cells.
Version info (please complete the following information):
- OS: Windows
- Version 8.4.1
- Ngôn ngữ chính
- Python
- Star
- 30
- Fork
- 5
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 4
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 Deltares/MeshKernelPy
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Deltares/MeshKernelPy#290 · 1 bình luận ·
-
Add `connect_hanging_nodes` APIĐang mởenhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Deltares/MeshKernelPy#287 ·
-
chore
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Deltares/MeshKernelPy#284 ·
-
Add support for Python 3.14Có thể đã có người làm @veenstrajelmer đã nhận 201 ngày trước. Đang mởchore
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
Deltares/MeshKernelPy#251 · 2 bình luận ·
-
Future proofing packageĐang mởchore
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Deltares/MeshKernelPy#190 ·
Tất cả issue của Deltares/MeshKernelPy
Issue tương tự
-
docs(contributing): the two things that silently block a PRCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởavailable documentation good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 95/100
Nixitov/Riptide-Native#944 ·
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 88/100
JTHCode/secretguard#24 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: middleware documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainer thường phản hồi trong vòng 1 ngày