You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OSError when using pygmt.grdimage with shading=True param #638
Yesterday I installed gmt6 and pygmt with conda on win10 system. It is very easy to use. I have ploted some figures with pygmt module. It is all fine until I add shading=True to pygmt.grdimage. Besides I can't pass the grid (xarray.DataArray) to call_module("grdgradient") using virtual_from_grid. The error is something about
"access violation reading", and I need some help to sovle this !!
👋 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.
I have ploted some figures with pygmt module. It is all fine until I add shading=True to pygmt.grdimage.
你好 @liwentao-319, thanks for raising the issue and the kind words! What you are experiencing with grdimage shading may be a similar issue to #364. We tried to fix it in #581 but it appears to be an upstream issue with GMT 6.1.1, so it might take a while to fix (November 2020 probably), but it is definitely a priority for the next PyGMT v0.2.1 or v0.3.0 release.
In the meantime, if you really want grdimage with shading, either use pure GMT to do so, or try downgrading to GMT 6.1.0 and see if it works (though this comes with other issues).
Besides I can't pass the grid (xarray.DataArray) to call_module("grdgradient") using virtual_from_grid. The error is something about "access violation reading", and I need some help to sovle this !!
I've not seen this error before, might be a Windows thing, and I'll only have access to a Windows machine to check this. My guess is that you're on the 'E:' drive but it's trying to write to the 'C:' drive and this doesn't work. You could try without the GMTTempFile (just pass in a proper filepath) and see if it works, but do note that what you're using is a 'hack' and not something we support officially. If you have some time, you're welcome to submit a Pull Request to wrap grdgradient, I'm sure the community will greatly appreciate it 😄
Also, in the future, please post your error messages as text instead of as a screenshot, this will help users in the future to more easily search for the same issue!
@liwentao-319 As mentioned by @weiji14, this issue may be caused by an upstream GMT bug. In PR GenericMappingTools/gmt#4328, a related bug was fixed, and the PR may also fix the issue you're having. It would be good if you can try your scripts with the GMT development version.
As an Anaconda user, you can run conda install -c conda-forge/label/dev gmt to install the GMT development version. Please let us know if it solves your problems. Thanks.
Activity
welcome commentedon Oct 3, 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.
weiji14 commentedon Oct 3, 2020
你好 @liwentao-319, thanks for raising the issue and the kind words! What you are experiencing with
grdimageshading may be a similar issue to #364. We tried to fix it in #581 but it appears to be an upstream issue with GMT 6.1.1, so it might take a while to fix (November 2020 probably), but it is definitely a priority for the next PyGMT v0.2.1 or v0.3.0 release.In the meantime, if you really want
grdimagewith shading, either use pure GMT to do so, or try downgrading to GMT 6.1.0 and see if it works (though this comes with other issues).I've not seen this error before, might be a Windows thing, and I'll only have access to a Windows machine to check this. My guess is that you're on the 'E:' drive but it's trying to write to the 'C:' drive and this doesn't work. You could try without the
GMTTempFile(just pass in a proper filepath) and see if it works, but do note that what you're using is a 'hack' and not something we support officially. If you have some time, you're welcome to submit a Pull Request to wrapgrdgradient, I'm sure the community will greatly appreciate it 😄Also, in the future, please post your error messages as text instead of as a screenshot, this will help users in the future to more easily search for the same issue!
liwentao-319 commentedon Oct 4, 2020
OK, I will try it and post my codes and error messages as text next time. And thanks for your reply!
seisman commentedon Oct 15, 2020
@liwentao-319 As mentioned by @weiji14, this issue may be caused by an upstream GMT bug. In PR GenericMappingTools/gmt#4328, a related bug was fixed, and the PR may also fix the issue you're having. It would be good if you can try your scripts with the GMT development version.
As an Anaconda user, you can run
conda install -c conda-forge/label/dev gmtto install the GMT development version. Please let us know if it solves your problems. Thanks.liwentao-319 commentedon Oct 18, 2020
@seisman The command you advised works well. Thank you very much!!