gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 3ffa2d9: NoiseChisel: produces output when the


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 3ffa2d9: NoiseChisel: produces output when there are no detected pixels
Date: Sat, 30 Nov 2019 17:26:04 -0500 (EST)

branch: master
commit 3ffa2d9f25c2b0069f55fac3159b89a62103700e
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    NoiseChisel: produces output when there are no detected pixels
    
    Until now, when NoiseChisel didn't detect any pixels, it just printed a
    message and wouldn't not make any output file. This was very inconvenient
    in general scripts.
    
    With this commit, an output will be created and the binary image will only
    have a value of zero. As a result, the Sky and Sky standard deviation
    extensions will be measured over all the tiles.
---
 NEWS                          |  8 ++++++++
 bin/noisechisel/noisechisel.c | 30 ++++++++----------------------
 2 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/NEWS b/NEWS
index 51c4a5f..bcc5c73 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,14 @@ See the end of the file for license conditions.
      NaN. Until now, the corresponding program/library would abort,
      printing the problematic string and its location.
 
+  NoiseChisel:
+   - Until now, when NoiseChisel didn't detect any pixels, it just printed
+     a message and wouldn't not make any output file. This was very
+     inconvenient in general scripts. From now on, in this scenario, an
+     output file will be created and the detection map will only have a
+     value of zero. As a result, the Sky and Sky standard deviation
+     extensions will be measured over all the tiles.
+
 ** Bugs fixed
   bug #57300: MakeCatalog memory crash when input dataset has units.
   bug #57301: MakeCatalog using river sum instead of mean times by clump area.
diff --git a/bin/noisechisel/noisechisel.c b/bin/noisechisel/noisechisel.c
index 1227e06..d585d39 100644
--- a/bin/noisechisel/noisechisel.c
+++ b/bin/noisechisel/noisechisel.c
@@ -248,28 +248,14 @@ noisechisel(struct noisechiselparams *p)
   /* Remove false detections. */
   detection(p);
 
-  /* If we have any detections, find the Sky value and subtract it from the
-     input and convolved images. */
-  if(p->numdetections)
-    {
-      /* Find the final Sky and Sky STD values. */
-      sky_and_std(p, p->skyname);
+  /* Find the final Sky and Sky STD values. */
+  sky_and_std(p, p->skyname);
 
-      /* Abort if the user only wanted to see until this point.*/
-      if(p->skyname && !p->continueaftercheck)
-        ui_abort_after_check(p, p->skyname, NULL,
-                             "derivation of final Sky (and its STD) value");
+  /* Abort if the user only wanted to see until this point.*/
+  if(p->skyname && !p->continueaftercheck)
+    ui_abort_after_check(p, p->skyname, NULL,
+                         "derivation of final Sky (and its STD) value");
 
-      /* Write the output. */
-      noisechisel_output(p);
-    }
-  else
-    {
-      if(p->cp.quiet)
-        error(0, 0, "no output file created: no detections could found "
-              "in `%s' with given parameters", p->inputname);
-      else
-        gal_timing_report(NULL, "NO OUTPUT FILE CREATED (try with "
-                          "`--checkdetection' to see why)", 1);
-    }
+  /* Write the output. */
+  noisechisel_output(p);
 }



reply via email to

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