`angle` is not accepted in `curvilinear_make_uniform_on_extension`
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- python
研究方向
先從重現腳本以及 curvilinear_compute_rectangular_grid_on_extension 和 curvilinear_compute_rectangular_grid 入口開始,然後比較它們對旋轉球面網格的行為。查看 issue #113,了解已記錄的正交性背景。完成的標準是擴充路徑接受該角度,並以可接受的正交性產生所要求的範圍,包括旋轉 90 度時的合理行為。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
When using curvilinear_make_uniform_on_extension instead of curvilinear_make_uniform, angle is not an accepted keyword, it raises:
"MeshKernelError: Exception of type 'AlgorithmError' in libs/MeshKernelApi/include/MeshKernelApi/Utils.hpp (375:45) CreateUniformCurvilinearGridOnExtension: When generating an uniform grid on an defined extension, the grid angle must be equal to 0"
Also, when generating a spherical+rotated grid, the orthogonality is quite high (0.039 for this small extent)
To Reproduce
import meshkernel
import numpy as np
import matplotlib.pyplot as plt
plt.close("all")
projection = meshkernel.ProjectionType.SPHERICAL #SPERICAL results in non-orthogonal grid (0.039)
on_extension = False #True is not possible with angle!=0
#general settings
lon_min,lon_max = -1,-0.2
lat_min,lat_max = 49.1,49.6
lon_res,lat_res = 0.1,0.1
# Create an instance of MakeGridParameters and set the values
make_grid_parameters = meshkernel.MakeGridParameters()
make_grid_parameters.angle = 10.0
make_grid_parameters.origin_x = lon_min
make_grid_parameters.origin_y = lat_min
if on_extension:
make_grid_parameters.upper_right_x = lon_max
make_grid_parameters.upper_right_y = lat_max
else:
num_x = int(np.ceil((lon_max-lon_min)/lon_res))
num_y = int(np.ceil((lat_max-lat_min)/lat_res))
if projection == meshkernel.ProjectionType.SPHERICAL:
num_y = num_y*2 #TODO: remove *2, necessary to get correct lat grid extent with is_geographic=True
make_grid_parameters.num_columns = num_x
make_grid_parameters.num_rows = num_y
make_grid_parameters.block_size_x = lon_res
make_grid_parameters.block_size_y = lat_res
mk2 = meshkernel.MeshKernel(projection=projection)
if on_extension:
mk2.curvilinear_compute_rectangular_grid_on_extension(make_grid_parameters)
else:
mk2.curvilinear_compute_rectangular_grid(make_grid_parameters)
mk2.curvilinear_convert_to_mesh2d() #convert to ugrid/mesh2d
mesh2d = mk2.mesh2d_get()
fig, ax = plt.subplots()
mesh2d.plot_edges(ax)
print(mk2.mesh2d_get_orthogonality().values.max())
Expected behavior
A rotated grid, also when using curvilinear_make_uniform_on_extension
Version info (please complete the following information):
- OS: [e.g. Windows]
- Version branch 2.1.0 wheel of 4-7-2023
Registered also under: https://issuetracker.deltares.nl/browse/GRIDEDIT-1859
Additional context
Spherical grids are sometimes used for small domains, but very often for larger coastal seas or bays. These are some use cases from the real world:
- DCSM (not rotated, lon -15 to 5, lat 43 to 64): 3D model computation water level, current, temperature | Deltares
- MWRA (rotated 30-40 deg, lon -76 to -60, lat 35 to 45): The Updated Bays Eutrophication Model (BEM) | Deltares and https://www.mwra.com/media/file/2023-07.pdf
It would be neat if we could generate such meshes with curvilinear_make_uniform_on_extension. The acceptance criterion could be fairly straightforward: a mesh in the desired extent, with an acceptable orthogonality. Additionally, a 90 degree rotated grid should be fairly similar to 0 degree rotation, or we should limit the rotation between -45 degrees and +45 degrees.
More information about resulting orthogonality of the current algorithms is documented in https://github.com/Deltares/MeshKernelPy/issues/113.
- 主要語言
- Python
- 星號
- 30
- 分支
- 5
- 平均合併
- 1 天 17 小時
- 30 天內合併 PR
- 4
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Deltares/MeshKernelPy 的其他 Issue
-
bug
難度 4/5 3-5 天 新手友好度 48/100
Deltares/MeshKernelPy#296 ·
-
bug
難度 4/5 3-5 天 新手友好度 48/100
Deltares/MeshKernelPy#290 · 1 則留言 ·
-
enhancement
難度 3/5 1-2 天 新手友好度 45/100
Deltares/MeshKernelPy#287 ·
-
chore
難度 4/5 3-5 天 新手友好度 35/100
Deltares/MeshKernelPy#284 ·
-
Add support for Python 3.14可能已有人在做 @veenstrajelmer 於 201 天前認領。 未關閉chore
難度 3/5 1-2 天 新手友好度 25/100
Deltares/MeshKernelPy#251 · 2 則留言 ·
查看 Deltares/MeshKernelPy 的全部 Issue
相似的 Issue
-
docs(contributing): the two things that silently block a PR可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉available documentation good first issue
難度 1/5 1-3 小時 新手友好度 95/100
Nixitov/Riptide-Native#944 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 88/100
JTHCode/secretguard#24 ·
維護者通常 1 天內回覆
-
area: middleware documentation good first issue
難度 2/5 1-3 小時 新手友好度 88/100
-
enhancement good first issue
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 1 天內回覆
-
good first issue
難度 1/5 1 小時以內 新手友好度 95/100
omarelshamy25x/shamy-hijri#63 ·
維護者通常 1 天內回覆