gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master f5bb42c: Statistics prepares FITS keywords of


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master f5bb42c: Statistics prepares FITS keywords of configuration when necessary
Date: Sat, 11 Aug 2018 18:37:42 -0400 (EDT)

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

    Statistics prepares FITS keywords of configuration when necessary
    
    Until now, Statistics would prepare the input configuration as FITS
    keywords in any situtation. But `ui_add_to_single_value' isn't yet prepared
    and in those cases, there is no output file any way. So this is an extra
    step and would cause a crash.
    
    With this commit, the keywords containing the input configuration are only
    written when necessary.
---
 bin/statistics/ui.c | 12 ++++++++----
 tests/during-dev.sh |  8 ++++----
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/bin/statistics/ui.c b/bin/statistics/ui.c
index e9f3f31..9ba99b9 100644
--- a/bin/statistics/ui.c
+++ b/bin/statistics/ui.c
@@ -949,10 +949,6 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
statisticsparams *p)
   gal_options_print_state(&p->cp);
 
 
-  /* Prepare all the options as FITS keywords to write in output later. */
-  gal_options_as_fits_keywords(&p->cp);
-
-
   /* Check that the options and arguments fit well with each other. Note
      that arguments don't go in a configuration file. So this test should
      be done after (possibly) printing the option values. */
@@ -961,6 +957,14 @@ ui_read_check_inputs_setup(int argc, char *argv[], struct 
statisticsparams *p)
 
   /* Read/allocate all the necessary starting arrays. */
   ui_preparations(p);
+
+
+  /* Prepare all the options as FITS keywords to write in output
+     later. Note that in some modes, there is no output file, and
+     `ui_add_to_single_value' isn't yet prepared. */
+  if( (p->singlevalue && p->ontile) || p->sky || p->histogram \
+      || p->cumulative)
+    gal_options_as_fits_keywords(&p->cp);
 }
 
 
diff --git a/tests/during-dev.sh b/tests/during-dev.sh
index 5948b2d..7a52e82 100755
--- a/tests/during-dev.sh
+++ b/tests/during-dev.sh
@@ -70,7 +70,7 @@
 # space characters in them, quote the full value
 numjobs=8
 builddir=build
-outdir=~/.tmp
+outdir=
 
 
 # Set the utility name, along with its arguments and options. NOTE, for
@@ -80,9 +80,9 @@ outdir=~/.tmp
 # script, and once for the utility. In such cases it might be easier to
 # just add the argument/option to the final script that runs the utility
 # rather than these variables.
-utilname=match
-arguments="positions-1.txt positions-2.txt"
-options="--aperture=0.5 --log --output=match-positions.fits"
+utilname=
+arguments=
+options=
 
 
 



reply via email to

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