[Top][All Lists]

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

[gnuastro-commits] master 9279a32d: MakeCatalog: warning will be printed

From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 9279a32d: MakeCatalog: warning will be printed for small values to --upnum
Date: Sun, 10 Jul 2022 11:12:39 -0400 (EDT)

branch: master
commit 9279a32d8856d4a8a82d72253ea9175809e95649
Author: Mohammad Akhlaghi <>
Commit: Mohammad Akhlaghi <>

    MakeCatalog: warning will be printed for small values to --upnum
    Until now, when the value given to '--upnum' was smaller than 20,
    MakeCatalog would abort since the result of all upper-limit measurements
    will not be reliable. However, in some contexts, the upper-limit
    measurements aren't relevant and the user wants the random positions for
    other things (like using '--checkuplim' to get positions where there is no
    signal for completeness tests).
    With this commit, instead of aborting, MakeCatalog will print an
    informative warning to let the user know that the upper-limit measurements
    won't be reliable, and it will continue with the rest of the processing. As
    a result, when we want a small number of random positions, MakeCatalog can
    be used.
    This was suggested by S. Zahra Hosseini Shahisavandi and Ignacio Trujillo.
 NEWS                         | 10 ++++++++++
 bin/mkcatalog/ui.c           |  8 +++++---
 doc/announce-acknowledge.txt |  2 ++
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 7261b6ce..cdeccb2c 100644
--- a/NEWS
+++ b/NEWS
@@ -134,6 +134,16 @@ See the end of the file for license conditions.
    --skystd: new name for old '--std', see description of '--std' above.
    --sfmagnsigma: default value changed to 3 (more commonly used).
    --sfmagarea: default value set to 100 arcsec^2 (more commonly used).
+   --upnum: MakeCatalog won't abort when '--upnum' is too small (less than
+     20). '--upnum' defines the number of random positions for upper-limit
+     measurements, so when its too small, the statistical precision of the
+     result will badly affected and MakeCatalog would abort with an error
+     message. However, in some scenarios (for example when the positions of
+     the random apertures from '--checkuplim' are needed) the actual
+     upper-limit measurements aren't relevant! So from this version,
+     instead of aborting MakeCatalog, it prints a warning and
+     continues. This was suggested by S. Zahra Hosseini Shahisavandi and
+     Ignacio Trujillo.
    - The string identifier for custom radial profiles is now called
diff --git a/bin/mkcatalog/ui.c b/bin/mkcatalog/ui.c
index 519b1871..a9385b4c 100644
--- a/bin/mkcatalog/ui.c
+++ b/bin/mkcatalog/ui.c
@@ -1731,9 +1731,11 @@ ui_preparations_upperlimit(struct mkcatalogparams *p)
   /* Check the number of random samples. */
-    error(EXIT_FAILURE, 0, "%zu not acceptable as '--upnum'. The minimum "
-          "acceptable number of random samples for the upper limit "
-          "magnitude is %d", p->upnum, MKCATALOG_UPPERLIMIT_MINIMUM_NUM);
+    error(EXIT_SUCCESS, 0, "WARNING: %zu (value given to '--upnum') will "
+          "produce unreliable upper-limit measurements. This warning will "
+          "be printed for '--upnum' values less than %d. You can suppress "
+          "this warning by adding '--quiet' to your command", p->upnum,
   /* Check if sigma-clipping parameters have been given. */
   if( isnan(p->upsigmaclip[0]) )
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index 30b159e9..8085d11a 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -6,6 +6,7 @@ Hilderic Browne
 Sepideh Eskandarlou
 Sílvia Farras
 Craig Gordon
+S. Zahra Hosseini Shahisavandi
 Teet Kuutma
 Jeremy Lim
 Juan Miro
@@ -14,6 +15,7 @@ Ignacio Ruiz Cejudo
 Manuel Sánchez-Benavente
 Elham Saremi
 Peter Teuben
+Ignacio Trujillo

reply via email to

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