gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master a23f703: NoiseChisel and Statistics: more gene


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master a23f703: NoiseChisel and Statistics: more generic --ignoreblankintiles
Date: Wed, 30 Jan 2019 08:12:13 -0500 (EST)

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

    NoiseChisel and Statistics: more generic --ignoreblankintiles
    
    Until now, NoiseChisel and Statistics had a `--ignoreblankinsky' option
    which would allow ignoring blank pixels in the tiled Sky and Sky standard
    deviation outputs. But it was not possible to specify the same thing for
    other tiled outputs. So the option name was generalized to
    `--ignoreblankintiles' and is now used in the creation of any tiled output.
---
 NEWS                          | 11 +++++++++++
 bin/noisechisel/args.h        |  8 ++++----
 bin/noisechisel/main.h        |  2 +-
 bin/noisechisel/noisechisel.c |  4 ++--
 bin/noisechisel/sky.c         |  8 ++++----
 bin/noisechisel/threshold.c   | 38 +++++++++++++++++++++-----------------
 bin/noisechisel/ui.h          |  2 +-
 bin/statistics/args.h         |  8 ++++----
 bin/statistics/main.h         |  2 +-
 bin/statistics/sky.c          | 20 ++++++++++----------
 bin/statistics/statistics.c   |  3 ++-
 bin/statistics/ui.h           |  2 +-
 doc/gnuastro.texi             | 36 ++++++++++++++++++++++--------------
 13 files changed, 84 insertions(+), 60 deletions(-)

diff --git a/NEWS b/NEWS
index 3290258..177e78a 100644
--- a/NEWS
+++ b/NEWS
@@ -70,6 +70,17 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
      on, this option measures the square root of the mean variance, or root
      mean square (the correct definition of the Sky standard deviation).
 
+  NoiseChisel:
+   --ignoreblankintiles: Until now `--ignoreblankinsky', would specify if
+     blank values should also be written into the tiled Sky and Sky
+     standard deviation outputs. But NoiseChisel can optionally produce
+     many more tiled outputs (for example with `--checkqthresh'). So the
+     option was renamed to `--ignoreblankintiles' to highlight that the
+     status of blank elements can be set in all tiled outputs.
+
+  Statistics:
+   --ignoreblankintiles: similar to same option in NoiseChisel.
+
 ** Bugs fixed
   bug #55313: Fits program writing --write values in reverse order
   bug #55333: Fits program crash when --write or --update have no value.
diff --git a/bin/noisechisel/args.h b/bin/noisechisel/args.h
index e572c57..a775377 100644
--- a/bin/noisechisel/args.h
+++ b/bin/noisechisel/args.h
@@ -137,13 +137,13 @@ struct argp_option program_options[] =
 
     /* Output options. */
     {
-      "ignoreblankinsky",
-      UI_KEY_IGNOREBLANKINSKY,
+      "ignoreblankintiles",
+      UI_KEY_IGNOREBLANKINTILES,
       0,
       0,
-      "Don't write input's blanks in the Sky output.",
+      "Don't write input's blanks in tiled output.",
       GAL_OPTIONS_GROUP_OUTPUT,
-      &p->ignoreblankinsky,
+      &p->ignoreblankintiles,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
       GAL_OPTIONS_NOT_MANDATORY,
diff --git a/bin/noisechisel/main.h b/bin/noisechisel/main.h
index 07867a8..be10387 100644
--- a/bin/noisechisel/main.h
+++ b/bin/noisechisel/main.h
@@ -52,7 +52,7 @@ struct noisechiselparams
   char                  *whdu;  /* Wide kernel HDU.                       */
 
   uint8_t  continueaftercheck;  /* Don't abort after the check steps.     */
-  uint8_t    ignoreblankinsky;  /* Ignore input's blank values.           */
+  uint8_t  ignoreblankintiles;  /* Ignore input's blank values.           */
   uint8_t           rawoutput;  /* Only detection & 1 elem/tile output.   */
   uint8_t               label;  /* Label detections that are connected.   */
 
diff --git a/bin/noisechisel/noisechisel.c b/bin/noisechisel/noisechisel.c
index 83c3d30..1227e06 100644
--- a/bin/noisechisel/noisechisel.c
+++ b/bin/noisechisel/noisechisel.c
@@ -184,7 +184,7 @@ noisechisel_output(struct noisechiselparams *p)
   /* Write the Sky image into the output */
   if(p->sky->name) free(p->sky->name);
   p->sky->name="SKY";
-  gal_tile_full_values_write(p->sky, &p->cp.tl, !p->ignoreblankinsky,
+  gal_tile_full_values_write(p->sky, &p->cp.tl, !p->ignoreblankintiles,
                              p->cp.output, NULL, PROGRAM_NAME);
   p->sky->name=NULL;
 
@@ -200,7 +200,7 @@ noisechisel_output(struct noisechiselparams *p)
   gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "MEDSTD", 0, &p->medstd, 0,
                         "Median raw tile standard deviation", 0,
                         p->input->unit);
-  gal_tile_full_values_write(p->std, &p->cp.tl, !p->ignoreblankinsky,
+  gal_tile_full_values_write(p->std, &p->cp.tl, !p->ignoreblankintiles,
                              p->cp.output, keys, PROGRAM_NAME);
   p->std->name=NULL;
 
diff --git a/bin/noisechisel/sky.c b/bin/noisechisel/sky.c
index bb2d091..78abfa2 100644
--- a/bin/noisechisel/sky.c
+++ b/bin/noisechisel/sky.c
@@ -210,10 +210,10 @@ sky_and_std(struct noisechiselparams *p, char *checkname)
     {
       p->sky->name="SKY";
       p->std->name="STD";
-      gal_tile_full_values_write(p->sky, tl, 1, checkname, NULL,
-                                 PROGRAM_NAME);
-      gal_tile_full_values_write(p->std, tl, 1, checkname, NULL,
-                                 PROGRAM_NAME);
+      gal_tile_full_values_write(p->sky, tl, !p->ignoreblankintiles,
+                                 checkname, NULL, PROGRAM_NAME);
+      gal_tile_full_values_write(p->std, tl, !p->ignoreblankintiles,
+                                 checkname, NULL, PROGRAM_NAME);
       p->sky->name=p->std->name=NULL;
     }
 
diff --git a/bin/noisechisel/threshold.c b/bin/noisechisel/threshold.c
index 11a56a6..47dcd19 100644
--- a/bin/noisechisel/threshold.c
+++ b/bin/noisechisel/threshold.c
@@ -300,12 +300,13 @@ threshold_interp_smooth(struct noisechiselparams *p, 
gal_data_t **first,
       (*first)->name="THRESH1_INTERP";
       (*second)->name="THRESH2_INTERP";
       if(third) (*third)->name="THRESH3_INTERP";
-      gal_tile_full_values_write(*first, tl, 1, filename, NULL, PROGRAM_NAME);
-      gal_tile_full_values_write(*second, tl, 1, filename, NULL,
-                                 PROGRAM_NAME);
+      gal_tile_full_values_write(*first, tl, !p->ignoreblankintiles,
+                                 filename, NULL, PROGRAM_NAME);
+      gal_tile_full_values_write(*second, tl, !p->ignoreblankintiles,
+                                 filename, NULL, PROGRAM_NAME);
       if(third)
-        gal_tile_full_values_write(*third, tl, 1, filename, NULL,
-                                   PROGRAM_NAME);
+        gal_tile_full_values_write(*third, tl, !p->ignoreblankintiles,
+                                   filename, NULL, PROGRAM_NAME);
       (*first)->name = (*second)->name = NULL;
       if(third) (*third)->name=NULL;
     }
@@ -340,13 +341,13 @@ threshold_interp_smooth(struct noisechiselparams *p, 
gal_data_t **first,
           (*first)->name="THRESH1_SMOOTH";
           (*second)->name="THRESH2_SMOOTH";
           if(third) (*third)->name="THRESH3_SMOOTH";
-          gal_tile_full_values_write(*first, tl, 1, filename, NULL,
-                                     PROGRAM_NAME);
-          gal_tile_full_values_write(*second, tl, 1, filename, NULL,
-                                     PROGRAM_NAME);
+          gal_tile_full_values_write(*first, tl, !p->ignoreblankintiles,
+                                     filename, NULL, PROGRAM_NAME);
+          gal_tile_full_values_write(*second, tl, !p->ignoreblankintiles,
+                                     filename, NULL, PROGRAM_NAME);
           if(third)
-            gal_tile_full_values_write(*third, tl, 1, filename, NULL,
-                                       PROGRAM_NAME);
+            gal_tile_full_values_write(*third, tl, !p->ignoreblankintiles,
+                                       filename, NULL, PROGRAM_NAME);
           (*first)->name = (*second)->name = NULL;
           if(third) (*third)->name=NULL;
         }
@@ -645,17 +646,20 @@ threshold_quantile_find_apply(struct noisechiselparams *p)
     {
       qprm.erode_th->name="QTHRESH_ERODE";
       qprm.noerode_th->name="QTHRESH_NOERODE";
-      gal_tile_full_values_write(qprm.erode_th, tl, 1, p->qthreshname, NULL,
-                                 PROGRAM_NAME);
-      gal_tile_full_values_write(qprm.noerode_th, tl, 1, p->qthreshname, NULL,
-                                 PROGRAM_NAME);
+      gal_tile_full_values_write(qprm.erode_th, tl,
+                                 !p->ignoreblankintiles,
+                                 p->qthreshname, NULL, PROGRAM_NAME);
+      gal_tile_full_values_write(qprm.noerode_th, tl,
+                                 !p->ignoreblankintiles,
+                                 p->qthreshname, NULL, PROGRAM_NAME);
       qprm.erode_th->name=qprm.noerode_th->name=NULL;
 
       if(qprm.expand_th)
         {
           qprm.expand_th->name="QTHRESH_EXPAND";
-          gal_tile_full_values_write(qprm.expand_th, tl, 1, p->qthreshname,
-                                     NULL, PROGRAM_NAME);
+          gal_tile_full_values_write(qprm.expand_th, tl,
+                                     !p->ignoreblankintiles,
+                                     p->qthreshname, NULL, PROGRAM_NAME);
           qprm.expand_th->name=NULL;
         }
     }
diff --git a/bin/noisechisel/ui.h b/bin/noisechisel/ui.h
index 7cd0bd4..542a54a 100644
--- a/bin/noisechisel/ui.h
+++ b/bin/noisechisel/ui.h
@@ -99,7 +99,7 @@ enum option_keys_enum
   UI_KEY_CHECKDETECTION,
   UI_KEY_CHECKSKY,
   UI_KEY_RAWOUTPUT,
-  UI_KEY_IGNOREBLANKINSKY,
+  UI_KEY_IGNOREBLANKINTILES,
 };
 
 
diff --git a/bin/statistics/args.h b/bin/statistics/args.h
index 1684c15..7fbd64b 100644
--- a/bin/statistics/args.h
+++ b/bin/statistics/args.h
@@ -548,13 +548,13 @@ struct argp_option program_options[] =
       GAL_OPTIONS_NOT_SET
     },
     {
-      "ignoreblankinsky",
-      UI_KEY_IGNOREBLANKINSKY,
+      "ignoreblankintiles",
+      UI_KEY_IGNOREBLANKINTILES,
       0,
       0,
-      "Don't write input's blanks in the Sky output.",
+      "Don't write input's blanks in the tiled output.",
       UI_GROUP_SKY,
-      &p->ignoreblankinsky,
+      &p->ignoreblankintiles,
       GAL_OPTIONS_NO_ARG_TYPE,
       GAL_OPTIONS_RANGE_0_OR_1,
       GAL_OPTIONS_NOT_MANDATORY,
diff --git a/bin/statistics/main.h b/bin/statistics/main.h
index 01ae40c..7e835cc 100644
--- a/bin/statistics/main.h
+++ b/bin/statistics/main.h
@@ -92,7 +92,7 @@ struct statisticsparams
   size_t       smoothwidth;  /* Width of flat kernel to smooth interpd.  */
   uint8_t         checksky;  /* Save the steps for deriving the Sky.     */
   double    sclipparams[2];  /* Muliple and parameter of sigma clipping. */
-  uint8_t ignoreblankinsky;  /* Ignore input's blank values.             */
+  uint8_t ignoreblankintiles;/* Ignore input's blank values.             */
 
 
   /* Internal */
diff --git a/bin/statistics/sky.c b/bin/statistics/sky.c
index 11b6b11..6d6a3fe 100644
--- a/bin/statistics/sky.c
+++ b/bin/statistics/sky.c
@@ -203,10 +203,10 @@ sky(struct statisticsparams *p)
     }
   if(p->checksky)
     {
-      gal_tile_full_values_write(p->sky_t, tl, 1, p->checkskyname, NULL,
-                                 PROGRAM_NAME);
-      gal_tile_full_values_write(p->std_t, tl, 1, p->checkskyname, NULL,
-                                 PROGRAM_NAME);
+      gal_tile_full_values_write(p->sky_t, tl, !p->ignoreblankintiles,
+                                 p->checkskyname, NULL, PROGRAM_NAME);
+      gal_tile_full_values_write(p->std_t, tl, !p->ignoreblankintiles,
+                                 p->checkskyname, NULL, PROGRAM_NAME);
     }
 
 
@@ -231,9 +231,9 @@ sky(struct statisticsparams *p)
     gal_timing_report(&t1, "All blank tiles filled (interplated).", 1);
   if(p->checksky)
     {
-      gal_tile_full_values_write(p->sky_t, tl, !p->ignoreblankinsky,
+      gal_tile_full_values_write(p->sky_t, tl, !p->ignoreblankintiles,
                                  p->checkskyname, NULL, PROGRAM_NAME);
-      gal_tile_full_values_write(p->std_t, tl, !p->ignoreblankinsky,
+      gal_tile_full_values_write(p->std_t, tl, !p->ignoreblankintiles,
                                  p->checkskyname, NULL, PROGRAM_NAME);
     }
 
@@ -255,9 +255,9 @@ sky(struct statisticsparams *p)
                           1);
       if(p->checksky)
         {
-          gal_tile_full_values_write(p->sky_t, tl, !p->ignoreblankinsky,
+          gal_tile_full_values_write(p->sky_t, tl, !p->ignoreblankintiles,
                                      p->checkskyname, NULL, PROGRAM_NAME);
-          gal_tile_full_values_write(p->std_t, tl, !p->ignoreblankinsky,
+          gal_tile_full_values_write(p->std_t, tl, !p->ignoreblankintiles,
                                      p->checkskyname, NULL, PROGRAM_NAME);
           if(!cp->quiet)
             printf("  - Check image written to `%s'.\n", p->checkskyname);
@@ -277,9 +277,9 @@ sky(struct statisticsparams *p)
   p->sky_t->name="SKY";
   p->std_t->name="SKY_STD";
   p->cp.keepinputdir=keepinputdir;
-  gal_tile_full_values_write(p->sky_t, tl, !p->ignoreblankinsky, outname,
+  gal_tile_full_values_write(p->sky_t, tl, !p->ignoreblankintiles, outname,
                              NULL, PROGRAM_NAME);
-  gal_tile_full_values_write(p->std_t, tl, !p->ignoreblankinsky, outname,
+  gal_tile_full_values_write(p->std_t, tl, !p->ignoreblankintiles, outname,
                              NULL, PROGRAM_NAME);
   p->sky_t->name = p->std_t->name = NULL;
   gal_fits_key_write_filename("input", p->inputname, &p->cp.okeys, 1);
diff --git a/bin/statistics/statistics.c b/bin/statistics/statistics.c
index 606fbb1..c92ca8b 100644
--- a/bin/statistics/statistics.c
+++ b/bin/statistics/statistics.c
@@ -259,7 +259,8 @@ statistics_interpolate_and_write(struct statisticsparams *p,
     }
 
   /* Write the values. */
-  gal_tile_full_values_write(values, &cp->tl, 1, output, NULL, PROGRAM_NAME);
+  gal_tile_full_values_write(values, &cp->tl, !p->ignoreblankintiles,
+                             output, NULL, PROGRAM_NAME);
   gal_fits_key_write_filename("input", p->inputname, &p->cp.okeys, 1);
   gal_fits_key_write_config(&p->cp.okeys, "Statistics configuration",
                             "STATISTICS-CONFIG", output, "0");
diff --git a/bin/statistics/ui.h b/bin/statistics/ui.h
index de10940..de4782c 100644
--- a/bin/statistics/ui.h
+++ b/bin/statistics/ui.h
@@ -98,7 +98,7 @@ enum option_keys_enum
   UI_KEY_OUTLIERSCLIP,
   UI_KEY_SMOOTHWIDTH,
   UI_KEY_CHECKSKY,
-  UI_KEY_IGNOREBLANKINSKY,
+  UI_KEY_IGNOREBLANKINTILES,
   UI_KEY_SCLIPPARAMS,
 };
 
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 7160a02..4e61463 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -16181,13 +16181,17 @@ discontinuities do not show up in the final Sky 
values. The smoothing is
 done through convolution (see @ref{Convolution process}) with a flat
 kernel, so the value to this option must be an odd number.
 
address@hidden --ignoreblankinsky
-Don't set the input's blank pixels to blank in the output Sky and Sky
-standard deviation datasets. This is only applicable when the output has
-the same size as the input, in other words, when @option{--oneelempertile}
-isn't called. By default, blank values in the input (commonly on the edges
-which are outside the survey/field area) will be set to blank in the output
-Sky and Sky standard deviation also.
address@hidden --ignoreblankintiles
+Don't set the input's blank pixels to blank in the tiled outputs (for
+example Sky and Sky standard deviation extensions of the output). This is
+only applicable when the tiled output has the same size as the input, in
+other words, when @option{--oneelempertile} isn't called.
+
+By default, blank values in the input (commonly on the edges which are
+outside the survey/field area) will be set to blank in the tiled outputs
+also. But in other scenarios this default behavior is not desired: for
+example if you have masked something in the input, but want the tiled
+output under that also.
 
 @item --checksky
 Create a multi-extension FITS file showing the steps that were used to
@@ -17157,13 +17161,17 @@ NoiseChisel will abort once its desired extensions 
have been written. With
 NoiseChisel to continue with the rest of the processing, even after the
 requested check files are complete.
 
address@hidden --ignoreblankinsky
-Don't set the input's blank pixels to blank in the output Sky and Sky
-standard deviation datasets. This is only applicable when the output has
-the same size as the input, in other words, when @option{--oneelempertile}
-isn't called. By default, blank values in the input (commonly on the edges
-which are outside the survey/field area) will be set to blank in the output
-Sky and Sky standard deviation also.
address@hidden --ignoreblankintiles
+Don't set the input's blank pixels to blank in the tiled outputs (for
+example Sky and Sky standard deviation extensions of the output). This is
+only applicable when the tiled output has the same size as the input, in
+other words, when @option{--oneelempertile} isn't called.
+
+By default, blank values in the input (commonly on the edges which are
+outside the survey/field area) will be set to blank in the tiled outputs
+also. But in other scenarios this default behavior is not desired: for
+example if you have masked something in the input, but want the tiled
+output under that also.
 
 @item -l
 @itemx --label



reply via email to

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