We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d060f0 commit bae08d1Copy full SHA for bae08d1
pygmt/accessors.py
@@ -32,13 +32,15 @@ def __init__(self, xarray_obj):
32
try:
33
self._source = self._obj.encoding["source"] # filepath to NetCDF source
34
if not Path(self._source).exists():
35
- raise ValueError(f"Grid source file {self._source} doesn't exist.")
+ raise FileNotFoundError(
36
+ f"Grid source file {self._source} doesn't exist."
37
+ )
38
# Get grid registration and grid type from the last two columns of
39
# the shortened summary information of `grdinfo`.
40
self._registration, self._gtype = map(
41
int, grdinfo(self._source, per_column="n").split()[-2:]
42
)
- except (KeyError, ValueError):
43
+ except (KeyError, ValueError, FileNotFoundError):
44
self._registration = 0 # Default to Gridline registration
45
self._gtype = 0 # Default to Cartesian grid type
46
0 commit comments