Using feet for contours instead or meters

As the title suggests, I am trying to use feet units instead of the default meters. Is this possible? Sorry if this has already been asked, I am new to pygmt and cannot to find any examples in the documentation to do this.

My code is fairly basic, so I have attached it here.
maps_cp.txt (1.4 KB)

In the docs says that foot is available. I think that you just should append f to the value.

Unfortunately I have added ‘f’ to the end of all values (i.e. 200f), but this doesn’t seem to change anything. I wonder if there is a piece of code that is overriding my selection.

(Not sure how this is done in PyGMT; this is regular gmt from the command line)

What about scaling your grid with grid+s<scale> in your grdcontour command?

Units like feet, km, nautical miles etc are strictly for horizontal control. That somebody has a grid with heights or hairlenght or whatever and want to change the numbers there is grdmath and there is the solution @Andreas pointed out, but probably even better with +d0.3048 to be exact.

1 Like

Now I learned something new as well. Thanks Paul!

From grdcontour:

ingrid[=ID|?varname][+b band][+d divisor][+n invalid][+o offset][+s scale]

Thank you Paul and Andreas for the responses. I do understand how this could be a solution. I looked at the GMT documentation and see this “scale” in grdcontour, but I do not see the implementation in pygmt. I searched the pygmt documentation for “grdmath” and only see one reference here with no example of use.

grdmath and gmtmath are not, nor will they be, wrapped in PyGMT since you can do math on matrices in Python.
Perhaps someone with PyGMT experience can comment on how to apply that scale to topo_data.