gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master df2e996: NoiseChisel: --checksn includes pseud


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master df2e996: NoiseChisel: --checksn includes pseudos that are right on area limit
Date: Tue, 16 Nov 2021 11:26:29 -0500 (EST)

branch: master
commit df2e996ae0e52642447107e8d7fbb80e34a2f9d1
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    NoiseChisel: --checksn includes pseudos that are right on area limit
    
    Until now, when the user ran NoiseChisel with '--checksn' (to see the list
    of pseudo-detection S/Ns that are used to determine the final true/false
    S/N threshold), the output table wouldn't contain the those
    pseudo-detections that had exactly the area given to '--snminarea'! Only
    pseudos that were larger than that area were included in the table.
    
    With this commit, the problematic part of the code has been found and
    fixed. In short, instead of using '>=' (greater equal), I was using '>'
    (greater than)! In the process, the debugging part of the code (that is
    commented) was also updated to be more generically usable.
    
    This bug was found by Raúl Infante-Sainz.
    
    This fixes bug #61493.
---
 NEWS                        |  2 ++
 bin/noisechisel/detection.c | 17 +++++++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/NEWS b/NEWS
index 672f51b..54c3080 100644
--- a/NEWS
+++ b/NEWS
@@ -84,6 +84,8 @@ See the end of the file for license conditions.
   bug #61462: Crash on FITS binary table colums with repeat of 0.
   bug #61490: Extra columns in the metadata causes crash in plain-text
               tables, found by Zohre Ghaffari.
+  bug #61493: NoiseChisel's --checksn not showing pseudos equal to
+              --snminarea (only larger ones), found by Raúl Infante-Sainz.
 
 
 
diff --git a/bin/noisechisel/detection.c b/bin/noisechisel/detection.c
index 66154dd..4af4864 100644
--- a/bin/noisechisel/detection.c
+++ b/bin/noisechisel/detection.c
@@ -626,13 +626,14 @@ detection_sn(struct noisechiselparams *p, gal_data_t 
*worklab, size_t num,
 
 
   /* A small sanity check.
-  {
-    size_t i;
-    for(i=1;i<num+1;++i)
-      printf("%zu (%u): %-5zu %-13.3f %-13.3f %-13.3f %-13.3f\n", i, flag[i],
-             area[i], brightness[i], pos[i*pcols], pos[i*pcols+1],
-             pos[i*pcols+2]);
-  }
+  if(s0d1D2==1)
+    {
+      size_t i;
+      for(i=1;i<num+1;++i)
+        printf("%zu (%u): %-5zu %-13.3f %-13.3f %-13.3f %-13.3f\n",
+               i, dlab ? flag[i] : 255, area[i], brightness[i],
+               pos[i*pcols], pos[i*pcols+1], pos[i*pcols+2]);
+    }
   */
 
 
@@ -663,7 +664,7 @@ detection_sn(struct noisechiselparams *p, gal_data_t 
*worklab, size_t num,
   for(i=1;i<tablen;++i)
     {
       ave=brightness[i]/area[i];
-      if( area[i]>p->snminarea && ave>0.0f && pos[i*pcols]>0.0f )
+      if( area[i]>=p->snminarea && ave>0.0f && pos[i*pcols]>0.0f )
         {
           /* Get the flux weighted center coordinates. */
           for(j=0;j<ndim;++j)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]