[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 4452bd8: NoiseChisel and Statistics: warning o
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 4452bd8: NoiseChisel and Statistics: warning on bad --meanmedqdiff values |
Date: |
Mon, 24 May 2021 19:59:17 -0400 (EDT) |
branch: master
commit 4452bd86cb35cbaac8117a1f85646d7ca57c05d5
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
NoiseChisel and Statistics: warning on bad --meanmedqdiff values
Until now, there was only a warning for a bad value to this option with the
Statistics program and it was missing in NoiseChisel. Furthermore, the
error message in Statistics didn't really describe the problem sufficiently
for a user who doesn't know that this option is.
With this commit, if the given value is larger than 0.5, NoiseChisel or
Statistics will crash with a very descriptive error message. Also, if the
value is larger than 0.3, a warning is printed, informing the user that
this is not a natural value and may be too much.
---
bin/noisechisel/ui.c | 30 +++++++++++++++++++++++++-----
bin/statistics/ui.c | 22 ++++++++++++++++++----
2 files changed, 43 insertions(+), 9 deletions(-)
diff --git a/bin/noisechisel/ui.c b/bin/noisechisel/ui.c
index f303215..b728f4a 100644
--- a/bin/noisechisel/ui.c
+++ b/bin/noisechisel/ui.c
@@ -289,11 +289,31 @@ ui_read_check_only_options(struct noisechiselparams *p)
'0.0001'. We were thus fully confused with the output (an extremely
low value) and thought its a bug, while it wasn't! */
if(p->snquant<0.1)
- fprintf(stderr, "\nWARNING: Value of '--snquant' ('-c') is %g. Note "
- "that this is not a contamination rate (where lower is "
- "better), it is a purity rate (where higher is better). If you "
- "intentionally asked for such a low purity level, please "
- "ignore this warning\n\n", p->snquant);
+ error(EXIT_SUCCESS, 0, "\nWARNING: Value of '--snquant' ('-c') is "
+ "%g. Note that this is not a contamination rate (where lower "
+ "is better), it is a purity rate (where higher is better). If "
+ "you intentionally asked for such a low purity level, please "
+ "ignore this warning\n\n", p->snquant);
+
+ /* Make sure a reasonable value is given to '--meanmedqdiff'. */
+ if(p->meanmedqdiff>0.5)
+ error(EXIT_FAILURE, 0, "%g is not acceptable for '--meanmedqdiff'! "
+ "This option is the quantile-difference between the quantile "
+ "of the mean and 0.5 (the quantile of the median). Since the "
+ "range of quantile is from 0.0 to 1.0, the maximum difference "
+ "can therefore be 0.5. For more on this option, please see "
+ "the \"Quantifying signal in a tile\" section of the Gnuastro "
+ "book (with this command: 'info gnuastro \"Quantifying "
+ "signal in a tile\"'", p->meanmedqdiff);
+ if(p->meanmedqdiff>0.3 && p->cp.quiet==0)
+ error(EXIT_SUCCESS, 0, "WARNING: %g is very high for "
+ "'--meanmedqdiff'! This option is the quantile-difference "
+ "between the quantile of the mean and 0.5 (the quantile of "
+ "the median). For more on this option, please see the "
+ "\"Quantifying signal in a tile\" section of the Gnuastro "
+ "book (with this command: 'info gnuastro \"Quantifying "
+ "signal in a tile\"'. To suppress this warning, please use "
+ "the '--quiet' option", p->meanmedqdiff);
}
diff --git a/bin/statistics/ui.c b/bin/statistics/ui.c
index fc771e9..ed6bb38 100644
--- a/bin/statistics/ui.c
+++ b/bin/statistics/ui.c
@@ -430,11 +430,25 @@ ui_read_check_only_options(struct statisticsparams *p)
"'--interpmetric' and '--interpnumngb' are mandatory when "
"requesting Sky measurement ('--sky')");
- /* If mode and median distance is a reasonable value. */
+ /* Make sure a reasonable value is given to '--meanmedqdiff'. */
if(p->meanmedqdiff>0.5)
- error(EXIT_FAILURE, 0, "%f not acceptable for '--meanmedqdiff'. It "
- "cannot take values larger than 0.5 (quantile of median)",
- p->meanmedqdiff);
+ error(EXIT_FAILURE, 0, "%g is not acceptable for '--meanmedqdiff'! "
+ "This option is the quantile-difference between the quantile "
+ "of the mean and 0.5 (the quantile of the median). Since the "
+ "range of quantile is from 0.0 to 1.0, the maximum difference "
+ "can therefore be 0.5. For more on this option, please see "
+ "the \"Quantifying signal in a tile\" section of the Gnuastro "
+ "book (with this command: 'info gnuastro \"Quantifying "
+ "signal in a tile\"'", p->meanmedqdiff);
+ if(p->meanmedqdiff>0.3 && p->cp.quiet==0)
+ error(EXIT_SUCCESS, 0, "WARNING: %g is very high for "
+ "'--meanmedqdiff'! This option is the quantile-difference "
+ "between the quantile of the mean and 0.5 (the quantile "
+ "of the median). For more on this option, please see the "
+ "\"Quantifying signal in a tile\" section of the Gnuastro "
+ "book (with this command: 'info gnuastro \"Quantifying "
+ "signal in a tile\"'. To suppress this warning, please use "
+ "the '--quiet' option", p->meanmedqdiff);
/* If a kernel name has been given, we need the HDU. */
if(p->kernelname && gal_fits_file_recognized(p->kernelname)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master 4452bd8: NoiseChisel and Statistics: warning on bad --meanmedqdiff values,
Mohammad Akhlaghi <=