Skip to content

Commit

Permalink
Handle negative value of radius (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
erblanm authored Jun 25, 2024
1 parent 26dab57 commit ebe6e2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/eolab/rastertools/hillshade.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def process_file(self, inputfile: str) -> List[str]:
wmax = np.maximum(wmax, np.nanmax(data)) if wmax is not None else np.nanmax(data)
wmin = np.minimum(wmin, np.nanmin(data)) if wmin is not None else np.nanmin(data)
delta = int((wmax - wmin) / self.resolution)
optimal_radius = int(delta / np.tan(np.radians(self.elevation)))
optimal_radius = abs(int(delta / np.tan(np.radians(self.elevation))))

if self.radius is None or optimal_radius <= self.radius:
self._radius = optimal_radius
Expand Down

0 comments on commit ebe6e2c

Please sign in to comment.