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

Artifacts appear when decreasing expansion_rate #156

Open
pierrechabert opened this issue Jun 17, 2024 · 5 comments
Open

Artifacts appear when decreasing expansion_rate #156

pierrechabert opened this issue Jun 17, 2024 · 5 comments

Comments

@pierrechabert
Copy link

pierrechabert commented Jun 17, 2024

Hi @SorooshMani-NOAA,

Trying to develop a mesh from a GEBCO DEM (the DEM file is "gebco_2023_n47.0_s40.0_w-72.0_e-63.0.tif", from https://download.gebco.net/), some artifacts (on a zonal direction as shown on the image below) appear when I decrease the expansion rate (from 0.1 to 0.001) of the add_contour function (below is some meshing scripts). Is there any recommendations on how to get the artifacts removed and properly following the coastlines?

Thank you so much for any help !

Best,
Pierre

target_size_min, target_size_max = 500, 10000  

hfun = ocsmesh.Hfun(
    deepcopy(rasters),
    hmin=target_size_min,
    hmax=target_size_max,
    base_shape=base_shape,
    base_shape_crs=domain_crs,
)

hfun.add_contour(
    level=0,
    target_size=target_size_min,
    expansion_rate=0.001,
)

hfun.add_constant_value(
    value=target_size_min,
    lower_bound=0,
)

driver = ocsmesh.JigsawDriver(geom, hfun, initial_mesh=False)
mesh = driver.run()

plot_mesh_edge(mesh.msh_t, lw=0.2)

Screenshot 2024-06-17 at 3 01 11 PM

@SorooshMani-NOAA
Copy link
Collaborator

Also

Concerning the error when trying to lower the libraries version, I found that the GEOS one needs a recent version

mesh = driver.run()

Results in

UnsupportedGEOSVersionError: The "iso" option requires at least GEOS 3.10.0

@SorooshMani-NOAA
Copy link
Collaborator

My suggestion is trying a version of matplotlib and python that is compatible with newer version of GEOS. But I haven't recently installed so I'm not sure which version aligns with which other

@felicio93
Copy link
Collaborator

felicio93 commented Jun 17, 2024

Hi @pierrechabert and @SorooshMani-NOAA.

Here is a conda env package list that works:
matplotlib 3.8.4 pypi_0 pypi
geos 3.12.1 h1537add_0 conda-forge
python 3.9.19 h4de0772_0_cpython conda-forge

sorry, I checked and this is the actual list:
matplotlib 3.5.2 py39haa95532_0
geos 3.11.1 h1537add_0 conda-forge
python 3.9.0 h7840368_5_cpython conda-forge

Also, I am at this moment working on the contour line problem (which seems to be caused by the collections attribute deprecation in version > 3.8). @pierrechabert I will make sure I keep you in the loop once we have a permanent solution.

@felicio93
Copy link
Collaborator

Permanent solution added to the latest OCSMesh version (v1.5.6).

Please updated OCSMesh with the latest version

@pierrechabert
Copy link
Author

The artifacts no longer appear, thank you so much !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants