[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 8dab7b8: Cleaned up NoiseChisel's preparations
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 8dab7b8: Cleaned up NoiseChisel's preparations in ui.c |
Date: |
Thu, 3 May 2018 17:49:59 -0400 (EDT) |
branch: master
commit 8dab7b8a3b021fb4c2194215e49528a9c7ebe3cf
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
Cleaned up NoiseChisel's preparations in ui.c
The steps to check the input dataset have been moved from `ui_preparations'
to a new function `ui_preparations_read_input'.
---
bin/noisechisel/ui.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/bin/noisechisel/ui.c b/bin/noisechisel/ui.c
index ae74441..6b59a81 100644
--- a/bin/noisechisel/ui.c
+++ b/bin/noisechisel/ui.c
@@ -518,15 +518,12 @@ ui_prepare_tiles(struct noisechiselparams *p)
+/* Read the input image and do the basic checks */
static void
-ui_preparations(struct noisechiselparams *p)
+ui_preparations_read_input(struct noisechiselparams *p)
{
float *f;
- /* Prepare the names of the outputs. */
- ui_set_output_names(p);
-
-
/* Read the input as a single precision floating point dataset. */
p->input = gal_array_read_one_ch_to_type(p->inputname, p->cp.hdu,
GAL_TYPE_FLOAT32,
@@ -566,6 +563,20 @@ ui_preparations(struct noisechiselparams *p)
"your analysis, please ignore this warming message.\n"
"--------------------------",
p->inputname, p->cp.hdu, p->inputname, p->inputname, p->cp.hdu);
+}
+
+
+
+
+
+static void
+ui_preparations(struct noisechiselparams *p)
+{
+ /* Prepare the names of the outputs. */
+ ui_set_output_names(p);
+
+ /* Read the input datasets and do the basic checks.*/
+ ui_preparations_read_input(p);
/* If a convolved image was given, read it in. Otherwise, read the given
kernel. */
@@ -586,15 +597,12 @@ ui_preparations(struct noisechiselparams *p)
else
ui_prepare_kernel(p);
-
/* Check for blank values to help later processing. */
gal_blank_present(p->input, 1);
-
/* Prepare the tessellation. */
ui_prepare_tiles(p);
-
/* Allocate space for the over-all necessary arrays. */
p->binary=gal_data_alloc(NULL, GAL_TYPE_UINT8, p->input->ndim,
p->input->dsize, p->input->wcs, 0,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master 8dab7b8: Cleaned up NoiseChisel's preparations in ui.c,
Mohammad Akhlaghi <=