Skip to content

grdtrack not working with "profile" option #1827

@19giovi87

Description

@19giovi87

Hi,

I'm trying to extract the topography from a grid along a certain path, going from A to B.
For this purpose, here is the code:

region = [14.1, 15.2, 41.0, 41.6]
grid = pygmt.datasets.load_earth_relief(resolution="01s", region=region)
profile = '14.33/41.43/14.93/41.14'         # these are the coordinates of A and B

track   = pygmt.grdtrack(points = None, grid = grid,
                                          profile = profile)

This is the error I get. It occurs with any grid provided, as long as the "profile" option is used and "points" is set to None.

File "/Users/giovanni_work/anaconda3/envs/pygmt/lib/python3.9/site-packages/pygmt/helpers/utils.py", line 69, in data_kind
    raise GMTInvalidInput("No input data provided.")

GMTInvalidInput: No input data provided.

I don't know if this is a bug or I'm just wrongly using the profile/points option is grdtrack.
Any clues on how to solve this?

Thank you!

System information

PyGMT information:
  version: v0.5.0
System information:
  python: 3.9.10 | packaged by conda-forge | (main, Feb  1 2022, 21:28:27)  [Clang 11.1.0 ]
  executable: /Users/rex/anaconda3/envs/pygmt/bin/python
  machine: macOS-11.6.1-x86_64-i386-64bit
Dependency information:
  numpy: 1.22.3
  pandas: 1.4.1
  xarray: 2022.3.0
  netCDF4: 1.5.8
  packaging: 21.3
  ghostscript: 9.54.0
  gmt: 6.3.0
GMT library information:
  binary dir: /Users/giovanni_work/anaconda3/envs/pygmt/bin
  cores: 16
  grid layout: rows
  library path: /Users/giovanni_work/anaconda3/envs/pygmt/lib/libgmt.dylib
  padding: 2
  plugin dir: /Users/giovanni_work/anaconda3/envs/pygmt/lib/gmt/plugins
  share dir: /Users/giovanni_work/anaconda3/envs/pygmt/share/gmt
  version: 6.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions