gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master cf6335a6 18/69: PSF stamp: enabling the use of


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master cf6335a6 18/69: PSF stamp: enabling the use of sigma-clip parameters
Date: Wed, 26 Jan 2022 12:39:10 -0500 (EST)

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

    PSF stamp: enabling the use of sigma-clip parameters
    
    Until this commit, the option for using sigma-clip parameters was
    available. However, it was not set properly inside of the script. In
    practice that means that the option was not used. With this commit, this
    bug has been fixed and now it is possible to use sigma-clip parameters when
    using the script 'psf-create-make-stamp'.
---
 bin/script/psf-create-make-stamp.in | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/bin/script/psf-create-make-stamp.in 
b/bin/script/psf-create-make-stamp.in
index 1782fe70..70d5d7b9 100644
--- a/bin/script/psf-create-make-stamp.in
+++ b/bin/script/psf-create-make-stamp.in
@@ -472,15 +472,18 @@ fi
 #
 # Generate the radial profile of the stamp, since it has been already
 # centered on the center of the object, it is not necessary to give the
-# center coordinates. If the user specifies a maximum radius, use it.
+# center coordinates. If the user specifies a maximum radius, use it. If
+# the user specifies sigma clip parameters, use them.
 radialprofile=$tmpdir/rprofile-$objectid.fits
-if [ x"$rmax" != x ]; then
-  maximumradius="--rmax=$rmax"
-else
-  maximumradius=""
+if [ x"$rmax" != x ]; then maximumradius="--rmax=$rmax"
+else                       maximumradius=""
+fi
+if [ x"$sigmaclip" = x ]; then finalsigmaclip=""
+else                           finalsigmaclip="--sigmaclip=$sigmaclip";
 fi
 astscript-radial-profile $cropped_masked --hdu=1 $maximumradius \
-                         --measure=$normop --output=$radialprofile $quiet
+                         --measure=$normop $finalsigmaclip \
+                         --output=$radialprofile $quiet
 
 
 
@@ -490,10 +493,14 @@ astscript-radial-profile $cropped_masked --hdu=1 
$maximumradius \
 # -------------------------------
 #
 # The normalization value is computed from the radial profile in between
-# the two radius specified by the user.
+# the two radius specified by the user. In this case, the option to give
+# sigmaclip parameters to 'aststatistics' is different.
+if [ x"$sigmaclip" = x ]; then finalsigmaclip=""
+else                           finalsigmaclip="--sclipparams=$sigmaclip";
+fi
 normvalue=$(asttable $radialprofile $quiet \
                      --range=1,$normradiusmin,$normradiusmax \
-                     | aststatistics --column=2 --$normop --quiet)
+                     | aststatistics --column=2 --$normop $finalsigmaclip -q)
 
 
 



reply via email to

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