Skip to content

OSError when using pygmt.grdimage with shading=True param #638

Closed

Description

@liwentao-319

Description of the problem
Hi!

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 !!

code1 -> error1
image

image

code2->error2
image

System information

image

Activity

  1. welcome commented on Oct 3, 2020

    @welcome

    👋 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.

  2. added
    bug
    on Oct 3, 2020
  3. weiji14 commented on Oct 3, 2020

    @weiji14
    Member

    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!

  4. liwentao-319 commented on Oct 4, 2020

    @liwentao-319
    Author

    OK, I will try it and post my codes and error messages as text next time. And thanks for your reply!

  5. added
    upstream
    on Oct 8, 2020
  6. seisman commented on Oct 15, 2020

    @seisman
    Member

    @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.

  7. added this to the 0.2.1 milestone on Oct 15, 2020
  8. liwentao-319 commented on Oct 18, 2020

    @liwentao-319
    Author

    @seisman The command you advised works well. Thank you very much!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugupstream

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions