I don’t seem to be able to get my pygmt (in Jupyter Notebook) to use my gshhg files. I’ve written a test script to try to figure out what’s going on. The script is simple:
import pygmt
fig=pygmt.Figure()
fig.coast(
region="-85/-75/3/10",
projection="M15c",
land="lightgray",
water="white",
borders="1/0.5p",
shorelines="1/0.5p",
frame="ag",)
fig.show()
The error message I get is:
gshhg_version: cannot open file "/opt/homebrew/Cellar/gmt/6.5.0/share/gmt/coast/binned_GSHHS_h.nc" (-101).
coast [NOTICE]: Downloading binned_GSHHS_h.nc for the first time - be patient
gshhg_version: cannot open file "/Users/lwagner/.gmt/geography/gshhg/binned_GSHHS_h.nc" (-101).
coast [WARNING]: GSHHG version 2.2.0 or newer is needed to use coastlines with GMT.
Get and install GSHHG from ftp://ftp.soest.hawaii.edu/gshhg/.
coast [ERROR]: Could not find file [GSHHG high resolution shorelines]
gshhg_version: cannot open file "/opt/homebrew/Cellar/gmt/6.5.0/share/gmt/coast/binned_border_h.nc" (-101).
coast [NOTICE]: Downloading binned_border_h.nc for the first time - be patient
coast [ERROR]: Could not find file [GSHHG high resolution political boundaries]gshhg_version: cannot open file "/Users/lwagner/.gmt/geography/gshhg/binned_border_h.nc" (-101).
coast [ERROR]: No GSHHG databases available - must abort
Here’s the thing, though: I have those files!
(base) /opt/homebrew/Cellar/gmt/6.5.0/share/gmt/coast >ls
COPYING.LESSERv3 binned_GSHHS_i.nc binned_river_c.nc
COPYINGv3 binned_GSHHS_l.nc binned_river_f.nc
LICENSE.TXT binned_border_c.nc binned_river_h.nc
README.TXT binned_border_f.nc binned_river_i.nc
binned_GSHHS_c.nc binned_border_h.nc binned_river_l.nc
binned_GSHHS_f.nc binned_border_i.nc
binned_GSHHS_h.nc binned_border_l.nc
Or, with more detail:
(base) /opt/homebrew/Cellar/gmt/6.5.0/share/gmt/coast >ls -al
total 112832
drwxr-xr-x 21 lwagner admin 672 May 22 11:26 .
drwxr-xr-x 13 lwagner admin 416 Jan 7 04:34 ..
-rw-r--r-- 1 lwagner admin 7651 Jan 7 04:34 COPYING.LESSERv3
-rw-r--r-- 1 lwagner admin 35147 Jan 7 04:34 COPYINGv3
-rw-r--r-- 1 lwagner admin 1352 Jan 7 04:34 LICENSE.TXT
-rw-r--r-- 1 lwagner admin 15063 Jan 7 04:34 README.TXT
-rw-r--r-- 1 lwagner admin 136598 Jan 7 04:34 binned_GSHHS_c.nc
-rw-r--r-- 1 lwagner admin 31935651 Jan 7 04:34 binned_GSHHS_f.nc
-rw-r--r-- 1 lwagner admin 8437674 Jan 7 04:34 binned_GSHHS_h.nc
-rw-r--r-- 1 lwagner admin 2206533 Jan 7 04:34 binned_GSHHS_i.nc
-rw-r--r-- 1 lwagner admin 550248 Jan 7 04:34 binned_GSHHS_l.nc
-rw-r--r-- 1 lwagner admin 60813 Jan 7 04:34 binned_border_c.nc
-rw-r--r-- 1 lwagner admin 2131261 Jan 7 04:34 binned_border_f.nc
-rw-r--r-- 1 lwagner admin 509728 Jan 7 04:34 binned_border_h.nc
-rw-r--r-- 1 lwagner admin 217433 Jan 7 04:34 binned_border_i.nc
-rw-r--r-- 1 lwagner admin 98738 Jan 7 04:34 binned_border_l.nc
-rw-r--r-- 1 lwagner admin 229095 Jan 7 04:34 binned_river_c.nc
-rw-r--r-- 1 lwagner admin 7619434 Jan 7 04:34 binned_river_f.nc
-rw-r--r-- 1 lwagner admin 2266940 Jan 7 04:34 binned_river_h.nc
-rw-r--r-- 1 lwagner admin 908481 Jan 7 04:34 binned_river_i.nc
-rw-r--r-- 1 lwagner admin 364773 Jan 7 04:34 binned_river_l.nc
The README.TXT starts with the following:
$LastChangedDate: 2017-06-14 17:11:54 -1000 (Wed, 14 Jun 2017) $
$Revision: 679 $
Note: If you are adding the gshhg-gmt-x.x.x BEFORE you install GMT
then make sure to set the GSHHG_PATH setting in cmake/ConfigUser.cmake
before building GMT. If you are adding gshhg-gmt-x.x.x AFTER installing
GMT then you need to specify its path via gmt.conf's DIR_GSHHG setting.
--------------------------------------------------------------------
Global Self-consistent Hierarchical High-resolution Geography, GSHHG
Version 2.3.7 June 15, 2017
Distributed under the Lesser GNU Public License
Updates the Northern Mariana Islands with CUPS data from NOAA, adds
two missing islands to northern Norway, and adds in the missing
Kosovo-Serbia boundary.
Earlier GSHHG Version-specific comments:
====================================================================
Version 2.3.6 August 19, 2016
Fixed 11 crossings in Antarctica grounding line and one in the ice front.
Added missing islands Georgetown and MacMahan, ME, and updated Jan Mayen, Norway
[thanks to Norwegian Polar Institute]
[...]
Any ideas? I’m on an M2 Mac, if that makes a difference. Now that I think about it, I’m not sure I’ve seen this work since I switched over…