gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 65f6633 3/3: Radial profile: subtracting 1 pix


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 65f6633 3/3: Radial profile: subtracting 1 pixel to have the centered radius at 0
Date: Thu, 15 Jul 2021 15:03:27 -0400 (EDT)

branch: master
commit 65f6633b32eba4ad76e4bb0f6493d70022db154b
Author: Raul Infante-Sainz <infantesainz@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Radial profile: subtracting 1 pixel to have the centered radius at 0
    
    Until this commit, when undersampling or oversampling the radial profile,
    the output radial profile started at Radius = 1. However, in order to have
    the central value at Radius = 0, it is necessary to subtract to all radii
    the value 1. This was properly done when no undersampling nor oversampling
    was requested. With this commit, this bug has been corrected. Now, all the
    output radial profiles start at Radius = 0 (central pixel value). In
    addition to this, the option -z has been added to be able to use the short
    version of --zeropoint.
---
 bin/script/radial-profile.in | 21 +++++++++++----------
 doc/gnuastro.texi            |  1 +
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/bin/script/radial-profile.in b/bin/script/radial-profile.in
index c78e3eb..0b37f24 100755
--- a/bin/script/radial-profile.in
+++ b/bin/script/radial-profile.in
@@ -49,6 +49,7 @@ zeropoint=""
 sigmaclip=""
 measuretmp=""
 oversample=""
+undersample=""
 positionangle=0
 version=@VERSION@
 scriptname=@SCRIPT_NAME@
@@ -95,7 +96,7 @@ $scriptname options:
   -Q, --axisratio=FLT     Axis ratio for ellipse profiles (A/B).
   -p, --positionangle=FLT Position angle for ellipse profiles.
   -s, --sigmaclip=FLT,FLT Sigma-clip multiple and tolerance.
-      --zeropoint=FLT     Zeropoint magnitude of input dataset.
+  -z, --zeropoint=FLT     Zeropoint magnitude of input dataset.
 
  Output:
   -o, --output            Output table with the radial profile.
@@ -104,9 +105,8 @@ $scriptname options:
   -m, --measure=STR       Measurement operator (mean, sigclip-mean, etc.).
   -v, --oversample        Oversample for higher resolution radial profile.
   -u, --undersample=INT   Undersample for lower resolution radial profile.
-      --instd=FLT/STR     Sky standard deviation as a single number or as the
-                          filename containing the dataset with different values
-                          per pixel.
+      --instd=FLT/STR     Sky standard deviation per pixel, as a single number
+                          or as the filename.
       --stdhdu=STR        HDU/extension of the sky standard deviation image.
 
  Operating mode:
@@ -216,8 +216,9 @@ do
         -s|--sigmaclip)     sigmaclip="$2";                            check_v 
"$1" "$sigmaclip";  shift;shift;;
         -s=*|--sigmaclip=*) sigmaclip="${1#*=}";                       check_v 
"$1" "$sigmaclip";  shift;;
         -s*)                sigmaclip=$(echo "$1"  | sed -e's/-s//');  check_v 
"$1" "$sigmaclip";  shift;;
-        --zeropoint=*)      zeropoint="${1#*=}";                       check_v 
"$1" "$zeropoint";  shift;;
-        --undersample=*)    undersample="${1#*=}";                     check_v 
"$1" "$undersample";  shift;;
+        -z|--zeropoint)     zeropoint="$2";                            check_v 
"$1" "$zeropoint";  shift;shift;;
+        -z=*|--zeropoint=*) zeropoint="${1#*=}";                       check_v 
"$1" "$zeropoint";  shift;;
+        -z*)                zeropoint=$(echo "$1"  | sed -e's/-z//');  check_v 
"$1" "$zeropoint";  shift;;
 
         # Output parameters
         -k|--keeptmp)     keeptmp=1; shift;;
@@ -630,11 +631,11 @@ astmkcatalog $apertures -h1 --valuesfile=$values 
--valueshdu=1 --ids \
 restcols=$(astfits $cat -h1 \
                | awk '/^TFIELDS/{for(i=2;i<=$3;++i) printf "-c%d ", i}')
 if [ x"$oversample" != x ]; then
-    asttable $cat -c'arith OBJ_ID float32 '$oversample' /' $restcols \
-             -o$output --colmetadata=ARITH_2,RADIUS,pix,"Radial distance"
+    asttable $cat -c'arith OBJ_ID float32 '$oversample' / 1 -' $restcols \
+             -o$output --colmetadata=ARITH_3,RADIUS,pix,"Radial distance"
 elif [ x"$undersample" != x ]; then
-    asttable $cat -c'arith OBJ_ID float32 '$undersample' x' $restcols \
-             -o$output --colmetadata=ARITH_2,RADIUS,pix,"Radial distance"
+    asttable $cat -c'arith OBJ_ID float32 '$undersample' x 1 -' $restcols \
+             -o$output --colmetadata=ARITH_3,RADIUS,pix,"Radial distance"
 else
     asttable $cat -c'arith OBJ_ID float32 1 -' $restcols -o$output \
              --colmetadata=1,RADIUS,pix,"Radial distance"
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 44060ad..ef7face 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -22041,6 +22041,7 @@ To see the default value of this option in MakeCatalog, 
you can run this command
 $ astmkcatalog -P | grep " sigmaclip "
 @end example
 
+@item -z FLT
 @item --zeropoint=FLT
 The Zeropoint of the input dataset.
 This is necessary when you request measurements like Magnitude, or Surface 
brightness.



reply via email to

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