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

Error while using the DEM.grd as a numpy variable #717

Closed
vivigb opened this issue Dec 7, 2020 · 3 comments
Closed

Error while using the DEM.grd as a numpy variable #717

vivigb opened this issue Dec 7, 2020 · 3 comments
Labels
bug Something isn't working help wanted Helping hands are appreciated

Comments

@vivigb
Copy link

vivigb commented Dec 7, 2020

Description of the problem

import pygmt
region=[77, 79, 29.5, 30.5]
fig= pygmt.Figure()
ctopo=pygmt.makecpt(cmap="himalaya.cpt")
grid = pygmt.datasets.load_earth_relief(resolution='01s', region=region)
KWARGS = dict(grid=grid,region=region, projection='M4i',frame=True, E=300)
fig.grdimage(**KWARGS,cmap=ctopo,shading=True)
fig.show()

Giving me the following error

Traceback (most recent call last):
  File "<ipython-input-11-78e4c4e19ed9>", line 1, in <module>
    fig.grdimage(**KWARGS,cmap=ctopo,shading=True)
  File "C:\ProgramData\Anaconda3\envs\roses\lib\site-packages\pygmt\helpers\decorators.py", line 270, in new_module
    return module_func(*args, **kwargs)
  File "C:\ProgramData\Anaconda3\envs\roses\lib\site-packages\pygmt\helpers\decorators.py", line 411, in new_module
    return module_func(*args, **kwargs)
  File "C:\ProgramData\Anaconda3\envs\roses\lib\site-packages\pygmt\base_plotting.py", line 485, in grdimage
    lib.call_module("grdimage", arg_str)
  File "C:\ProgramData\Anaconda3\envs\roses\lib\site-packages\pygmt\clib\session.py", line 503, in call_module
    self.session_pointer, module.encode(), mode, args.encode()
OSError: exception: access violation reading 0x000001E880146FBC

I am using conda environment in Windows

PyGMT information:
  version: v0.2.1
System information:
  python: 3.7.8 | packaged by conda-forge | (default, Nov 17 2020, 23:02:53) [MSC v.1916 64 bit (AMD64)]
  executable: C:\ProgramData\Anaconda3\envs\roses\python.exe
  machine: Windows-10-10.0.19041-SP0
Dependency information:
  numpy: 1.19.4
  pandas: 1.1.4
  xarray: 0.16.1
  netCDF4: 1.5.4
  packaging: 20.4
  ghostscript: 9.53.3
  gmt: 6.1.1
GMT library information:
  binary dir: C:/ProgramData/Anaconda3/envs/roses
  cores: 4
  grid layout: rows
  library path: C:/ProgramData/Anaconda3/envs/roses/Library/bin/gmt.dll
  padding: 2
  plugin dir: C:/ProgramData/Anaconda3/envs/roses/Library/bin/gmt_plugins
  share dir: c:/programs/gmt5/share
  version: 6.1.1
@welcome
Copy link

welcome bot commented Dec 7, 2020

👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct.

@seisman
Copy link
Member

seisman commented Dec 7, 2020

Yes, we notice similar crashes in our CI testings. It's still unclear to us why and where it happens, as none of us is developing PyGMT under Windows.

You have two options:

  1. Re-run the script again. Sometimes it crashes, but sometimes it works well
  2. Directly use the GMT remote file, i.e., KWARGS = dict(grid="@earth_relief_01s",region=region, projection='M4i',frame=True, E=300), instead of using the pygmt.datasets.load_earth_relief, which loads the grid into memory.

@seisman
Copy link
Member

seisman commented Mar 18, 2021

I'd like to close the issue, because:

  1. We already know that PyGMT sometimes crashes on Windows
  2. We don't have any Windows developers to track the crashes
  3. There are most likely issues of GMT, not PyGMT.

@seisman seisman closed this as completed Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Helping hands are appreciated
Projects
None yet
Development

No branches or pull requests

2 participants