[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master c46f638d 2/2: Segment: --keepmaxnearriver has
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master c46f638d 2/2: Segment: --keepmaxnearriver has an effect on the output |
Date: |
Thu, 10 Aug 2023 12:01:51 -0400 (EDT) |
branch: master
commit c46f638df45faa96777c4378e4f6b82729f9fe51
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Segment: --keepmaxnearriver has an effect on the output
Until now, when the user gave '--keepmaxnearriver' the number of output
clumps would be the same as before, even when clumps existed that had a
maximum that was touching a river. This happened because when checking for
neighboring river pixels, Segment was looking for 0-valued pixels, but they
will be negative!
With this commit, the problem has been solved by properly checking the
neighboring pixels of the maximum pixel as those that are less than 1.
This fixes bug #64541.
---
NEWS | 1 +
bin/segment/clumps.c | 6 +-----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/NEWS b/NEWS
index 5617bdd4..cd347055 100644
--- a/NEWS
+++ b/NEWS
@@ -166,6 +166,7 @@ See the end of the file for license conditions.
problematic option name; reported by Aaron Watkins.
bug #64431: gal_wcs_to_cd does not account for altlin==3. Reported by
Colin Orion Chandler.
+ bug #64541: Segment's --keepmaxnearriver has no effect.
diff --git a/bin/segment/clumps.c b/bin/segment/clumps.c
index d0664a71..d20b21e6 100644
--- a/bin/segment/clumps.c
+++ b/bin/segment/clumps.c
@@ -852,11 +852,7 @@ clumps_det_keep_true_relabel(struct clumps_thread_params
*cltprm)
touching a river or not. */
istouching=0;
GAL_DIMENSION_NEIGHBOR_OP(cltprm->topinds[i], ndim, dsize,
- ndim, dinc,
- {
- if(clabel[nind]==0)
- istouching=1;
- });
+ ndim, dinc, { if(clabel[nind]<1) istouching=1; });
/* If the peak isn't touching a river, then check its S/N and
if that is also good, give it a new label. */