gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master cc5ef0b 2/2: NoiseChisel will print error with


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master cc5ef0b 2/2: NoiseChisel will print error with no good pseudo-detections
Date: Tue, 6 Jun 2017 08:53:20 -0400 (EDT)

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

    NoiseChisel will print error with no good pseudo-detections
    
    If the input parameters aren't good, it can happen that no
    pseudo-detections are found. In this case, with this commit, NoiseChisel
    will abort and explain the reason (along with a possible discussion on the
    causes).
---
 bin/noisechisel/detection.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/bin/noisechisel/detection.c b/bin/noisechisel/detection.c
index b302b64..a8df736 100644
--- a/bin/noisechisel/detection.c
+++ b/bin/noisechisel/detection.c
@@ -697,6 +697,15 @@ detection_pseudo_real(struct noisechiselparams *p)
   sn=detection_sn(p, worklab, numpseudo, 0, "PSEUDOS-FOR-SN");
 
 
+  /* A small sanity check */
+  if(sn->size==0)
+    error(EXIT_FAILURE, 0, "no pseudo-detections could be found over the "
+          "sky region to estimate an S/N. Please adjust parameters like "
+          "`--dthresh', `--detsnminarea', or make sure that there actually "
+          "is sufficient sky area after initial detection. You can use "
+          "`--checkdetection' to see every step until this point");
+
+
   /* Get the S/N quantile and report it if we are in non-quiet mode. */
   quant=gal_statistics_quantile(sn, p->detquant, 1);
   p->detsnthresh = *((float *)(quant->array));



reply via email to

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