Skip to content

Commit

Permalink
Report the minimum and maximum data values in GridObject.info (#128)
Browse files Browse the repository at this point in the history
Fixes #127

I also took the opportunity to indicate whether the coordinate system
is geographic or projected, which will be useful in #73.
  • Loading branch information
wkearn authored Jan 20, 2025
1 parent ac2384a commit 9e94715
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/topotoolbox/grid_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,14 @@ def info(self) -> None:
print(f"cellsize: {self.cellsize}")
print(f"bounds: {self.bounds}")
print(f"transform: {self.transform}")
print(f"crs: {self.crs}")
if self.crs is not None and self.crs.is_projected:
print(f"coordinate system (Projected): {self.crs}")
elif self.crs is not None and self.crs.is_geographic:
print(f"coordinate system (Geographic): {self.crs}")
else:
print(f"coordinate system: {self.crs}")
print(f"maximum z-value: {np.nanmax(self.z)}")
print(f"minimum z-value: {np.nanmin(self.z)}")

def show(self, cmap='terrain') -> None:
"""
Expand Down

0 comments on commit 9e94715

Please sign in to comment.