Skip to content

Commit

Permalink
use np.close to check for zero area in redistribute
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-schmitt committed Aug 21, 2023
1 parent caaa2d3 commit cece69c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oggm/sandbox/distribute_2d.py
Expand Up @@ -339,7 +339,7 @@ def distribute_thickness_from_simulation(gdir, input_filesuffix='',
for band_id, npix in zip(band_ids.astype(int), counts):
band_area = dgy.area_m2.values[band_id]
band_volume = dgy.volume_m3.values[band_id]
if band_area != 0:
if ~np.isclose(band_area, 0):
# We have some ice left
pix_cov = band_area / dx2
mask = (band_index_mask == band_id) & \
Expand Down

0 comments on commit cece69c

Please sign in to comment.