Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coordinates in orthogonality GeometryList are incorrect #151

Open
veenstrajelmer opened this issue Feb 2, 2024 · 0 comments
Open

coordinates in orthogonality GeometryList are incorrect #151

veenstrajelmer opened this issue Feb 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@veenstrajelmer
Copy link

veenstrajelmer commented Feb 2, 2024

Describe the bug
The coordinates of the orthogonality GeometryList different from the mesh2d edge_x coordinates and they change on every script execution.

To Reproduce

from meshkernel import MakeGridParameters, MeshKernel, ProjectionType

lon_min, lon_max, lat_min, lat_max = 142, 150, -42, -39
dxy = 0.5
projection = ProjectionType(1)

make_grid_parameters = MakeGridParameters(angle=0,
                                          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=projection)
mk.curvilinear_compute_rectangular_grid_on_extension(make_grid_parameters)
mk.curvilinear_convert_to_mesh2d() #convert to ugrid/mesh2d

mesh2d = mk.mesh2d_get()
print(mesh2d.edge_x.min(), mesh2d.edge_x.max()) # 142.0 150.0
ortho = mk.mesh2d_get_orthogonality()
print(ortho.x_coordinates.min(), ortho.x_coordinates.max()) # 2.121995791e-314 1.2627657708965e-311 (but changing with every script execution, sometimes nan)

Expected behavior
ortho.x_coordinates array is equal to mesh2d.edge_x array.

Alternative solution
Return a numpy array with only the values instead.

Version info (please complete the following information):

  • OS: Windows
  • Version 3.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant