[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 5d5fd95 106/113: NoiseChisel: independent test
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 5d5fd95 106/113: NoiseChisel: independent test of input's dimensions |
Date: |
Fri, 16 Apr 2021 10:34:02 -0400 (EDT) |
branch: master
commit 5d5fd95237a3d651f853f9996d1115e7121e71ac
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
NoiseChisel: independent test of input's dimensions
Until now there was no independent test of dimensionality after NoiseChisel
read the input dataset. As a result, when the input's dimensions were not
acceptable, it would crash with a suggested bug in the `ui_ngb_check'
function.
With this commit, immediately after reading the input, NoiseChisel checks
is dimension independently. So the bug report of `ui_ngb_check' is
reasonable.
---
bin/noisechisel/ui.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/bin/noisechisel/ui.c b/bin/noisechisel/ui.c
index a26270f..ac259c4 100644
--- a/bin/noisechisel/ui.c
+++ b/bin/noisechisel/ui.c
@@ -586,8 +586,15 @@ ui_preparations_read_input(struct noisechiselparams *p)
if(p->input->name==NULL)
gal_checkset_allocate_copy("INPUT", &p->input->name);
- /* Check the values of dimention-related options. */
+ /* Check the dimensions of the input. */
ndim=p->input->ndim;
+ if(ndim!=2 && ndim!=3)
+ error(EXIT_FAILURE, 0, "%s: is a %zu dimensional dataset, only 2D "
+ "or 3D datasets are currently supported",
+ gal_fits_name_save_as_string(p->inputname, p->cp.hdu), ndim);
+
+ /* Check the neighbor options and if the given values correspond to the
+ input's dimensions. */
ui_ngb_check(p->holengb, "holengb", ndim);
ui_ngb_check(p->erodengb, "erodengb", ndim);
ui_ngb_check(p->openingngb, "openingngb", ndim);
- [gnuastro-commits] master 88935ae 073/113: Dataset pointers initialized to NULL in upperlimit_write_check, (continued)
- [gnuastro-commits] master 88935ae 073/113: Dataset pointers initialized to NULL in upperlimit_write_check, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master d02c999 079/113: Recent work in master imported, conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 4021652 078/113: Imported recent work in master, conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 8d64628 081/113: Recent work in master imported, minor conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 800c769 082/113: Imported all the work in master, conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master ac91655 084/113: Imported recent work in master, no conflicts, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master d57e0e6 087/113: New spectrum measurement from 3D inputs in MakeCatalog, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master a8428fe 088/113: Imported recent work in master, conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 175354f 095/113: All MakeCatalog spectrums set to NaN when no measurement was done, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master fe0e594 097/113: Imported recent work in master, no conflicts, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 5d5fd95 106/113: NoiseChisel: independent test of input's dimensions,
Mohammad Akhlaghi <=
- [gnuastro-commits] master ee4bf1e 069/113: Imported recent work from master, Segment's 3D kernels added, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 2c6c7e0 076/113: Imported recent work, no conflicts, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master e2aba57 083/113: Recent work in master imported, conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master e92fd9c 039/113: Merged recent work in master, conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 54b099d 043/113: Neighbors options doc generalized for different dimensions, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 5cd3c1e 044/113: Recent work in master merged, small conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 1b0046b 051/113: Recent additions in master imported here, no conflicts, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master b1ea932 054/113: Separate Segment program now available in 3D, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master f537368 066/113: Segment's default 3D configuration file in tarball, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 133e277 071/113: Imported recent work from master, conflicts fixed, Mohammad Akhlaghi, 2021/04/16