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

Regridder error ESMC_GridCreateNoPeriDim() failed with rc = 545 #314

Open
eaven123 opened this issue Nov 14, 2023 · 9 comments
Open

Regridder error ESMC_GridCreateNoPeriDim() failed with rc = 545 #314

eaven123 opened this issue Nov 14, 2023 · 9 comments

Comments

@eaven123
Copy link

use xe.Regridder:
errors:
File "/root/miniconda3/envs/xeradar/lib/python3.11/site-packages/esmpy/api/grid.py", line 410, in init
self._struct = ESMP_GridCreateNoPeriDim(self.max_index,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/xeradar/lib/python3.11/site-packages/esmpy/interface/cbindings.py", line 601, in ESMP_GridCreateNoPeriDim
raise ValueError('ESMC_GridCreateNoPeriDim() failed with rc = '+str(rc)+
ValueError: ESMC_GridCreateNoPeriDim() failed with rc = 545. Please check the log files (named "*ESMF_LogFile").
image
how to sovle?

@huard
Copy link
Contributor

huard commented Nov 14, 2023

Those messages don't ring any bell. In case you get no tips, you might want to post a minimal example that reproduces this error.

@aulemahal aulemahal changed the title xe.Regridder error ESMC_GridCreateNoPeriDim() failed with rc = 545. Please check the log files (named "*ESMF_LogFile"). Regridder error ESMC_GridCreateNoPeriDim() failed with rc = 545 Nov 14, 2023
@aulemahal
Copy link
Collaborator

Hi @eaven123, is this error raised when you are using xe.SpatialAverager ? If yes, this might be because of malformed polygons. Try simplifying with df["geometry"] = df.simplify(tolerance=0.02, preserve_topology=True), where tolerance is set to something smaller than the output grid resolution, but not too small.

@eaven123
Copy link
Author

eaven123 commented Nov 15, 2023

Those messages don't ring any bell. In case you get no tips, you might want to post a minimal example that reproduces this error.

hi,the data cannot be provided to you, but the reference logic is as follows, and xesmf 0.8.2.

    url = env_config.get('path', 'OUTPUT_PATH') + method + "/" 
    if not os.path.exists(url):
        os.makedirs(url)
    if len(orig_lat) > 0 and len(orig_lon) > 0 and len(out_lat) > 0 and len(out_lon) > 0:
        filename = f"{method}_{ele}_{len(orig_lat)}x{len(orig_lon)}_{len(out_lat)}x{len(out_lon)}.nc"
        regridder = xe.Regridder(grid_in, grid_out, method, filename=url + filename, ignore_degenerate=True)
        # reuse_weights=True
        data_regrid = regridder(data).astype(np.float32)

@eaven123
Copy link
Author

eaven123 commented Nov 15, 2023

Hi @eaven123, is this error raised when you are using xe.SpatialAverager ? If yes, this might be because of malformed polygons. Try simplifying with df["geometry"] = df.simplify(tolerance=0.02, preserve_topology=True), where tolerance is set to something smaller than the output grid resolution, but not too small.

This error is caused by xe.Regridder.

@aulemahal
Copy link
Collaborator

Hi @eaven123. By searching the error code with the search engine of github (the input box usually is in the top right of the page), I found that there was a discussion about this specific issue : #307

Seems to be dependent on the dask setup. The suggestion would be to use a dask.distributed.Client (https://distributed.dask.org/en/stable/client.html) instead of the basic threaded configuration.

@eaven123
Copy link
Author

eaven123 commented Nov 15, 2023 via email

@aulemahal
Copy link
Collaborator

from dask.distributed import Client
import xesmf as xe

client = Client()

... your code ...

@eaven123
Copy link
Author

eaven123 commented Nov 15, 2023 via email

@eaven123
Copy link
Author

eaven123 commented Nov 16, 2023 via email

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