[Top][All Lists]

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

[gnuastro-commits] master 8c5acf15: radial-profile: --stdhdu to MakeCata

From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 8c5acf15: radial-profile: --stdhdu to MakeCatalog only if given STD image
Date: Tue, 28 Jun 2022 11:19:55 -0400 (EDT)

branch: master
commit 8c5acf156a39ea44ca3d93e8d13ca9230ae1cd58
Author: Raul Infante-Sainz <>
Commit: Mohammad Akhlaghi <>

    radial-profile: --stdhdu to MakeCatalog only if given STD image
    Until now, the standard deviation (STD) hdu was 1 by default ('--stdhdu=1'
    was directly passed to MakeCatalog). So, if no '--instd' was given to the
    radial profile script (and therefore no STD crop image was created),
    MakeCatalog would use first hdu of the values image as the standard
    deviation image!
    As a result of this, when a requested measurement column needed the
    standard deviation image and the user had forgot to use '--instd', the
    radial profile script would set MakeCatalog to use the values file as the
    standard deviation!
    With this commit, the '--stdhdu=1' option is only passed to MakeCatalog
    when an '--instd' file has been given to the radial profile script. Note
    that we do crop the standard deviation image before calling MakeCatalog, so
    like the values image, its HDU is always one.
    This fix was done with the help of Mohammad Akhlaghi.
    This fixes bug #62678.
 NEWS                         | 3 ++-
 bin/script/ | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 2273e39c..672e7c0e 100644
--- a/NEWS
+++ b/NEWS
@@ -169,7 +169,8 @@ See the end of the file for license conditions.
   bug #62662: Table crashes when column arithmetic is applied after adding
               rows from another file (with '--catrowfile').
   bug #62674: Column arithmetic can't use columns from --catcolumnfile.
+  bug #62678: Radial profile script using values image instead of STD image
+              when '--instd' not used. Found and fixed by Raul Infante-Sainz.
diff --git a/bin/script/ b/bin/script/
index f07ec62a..c537cfbc 100644
--- a/bin/script/
+++ b/bin/script/
@@ -541,7 +541,7 @@ else
      # When 'instd' is a file, put the 'valuesstd' as the option value
      # (which has been warped/cropped and created in the previous section).
      if [ -f "$instd" ]; then
-         finalinstd="--instd=$valuesstd"
+         finalinstd="--instd=$valuesstd --stdhdu=1"
      # When 'instd' is a number, simply give the number as the value.
@@ -696,9 +696,9 @@ fi
 # elliptical apertures) and the original input image for measuring the
 # values.
-astmkcatalog $apertures -h1 --valuesfile=$values --valueshdu=1 --ids \
+astmkcatalog $apertures --hdu=1 --valuesfile=$values --valueshdu=1 --ids \
              $finalinstd $finalmeasure $finalsigmaclip $finalzp \
-            --stdhdu=1 --output=$cat $quiet
+            --output=$cat $quiet

reply via email to

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