[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 2718494e 19/69: PSF stamp: allowing to run the
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 2718494e 19/69: PSF stamp: allowing to run the script without making normalization |
Date: |
Wed, 26 Jan 2022 12:39:10 -0500 (EST) |
branch: master
commit 2718494e84d1d3ced16f1b4e2b89d064c182bd21
Author: Raul Infante-Sainz <infantesainz@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
PSF stamp: allowing to run the script without making normalization
Until this commit, when running the script 'psf-create-make-stamp', it
would abort as soon as the user doesn't provide a normalization radii with
the option '--normradii'. The reason is that this script is desired to
obtain normalized stamps of stars. However, it could be possible that the
user want the stamps without making the normalization. For example,
because there is any other methodology for making the normalization. But at
the same time, it would be good to have this script running in order to
obtain the stamps (center the star, mask nearby objects, etc.). With this
commit, necessary changes have been included with the goal of running this
script without having to specify a ring of normalization. Internally, it
won't compute the radial profile and the normalization value will be set to
1.0.
---
bin/script/psf-create-make-stamp.in | 68 ++++++++++++++++++-------------------
1 file changed, 33 insertions(+), 35 deletions(-)
diff --git a/bin/script/psf-create-make-stamp.in
b/bin/script/psf-create-make-stamp.in
index 70d5d7b9..f7208b2d 100644
--- a/bin/script/psf-create-make-stamp.in
+++ b/bin/script/psf-create-make-stamp.in
@@ -296,9 +296,8 @@ fi
# If a normalization range is not given at all.
if [ x"$normradii" = x ]; then
- echo "$scriptname: no rign of normalization provided."
- echo "$scriptname: values to '--normradii' ('-n') should be provided."
- exit 1
+ echo "$scriptname: no ring of normalization provided."
+ echo "$scriptname: the stamp won't be normalized."
else
nnormradii=$(echo $normradii | awk 'BEGIN{FS=","}END{print NF}')
if [ x$nnormradii != x2 ]; then
@@ -467,40 +466,39 @@ fi
-# Compute the radial profile
-# --------------------------
+# Compute the radial profile and the normalization value
+# ------------------------------------------------------
#
-# 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. If
-# the user specifies sigma clip parameters, use them.
-radialprofile=$tmpdir/rprofile-$objectid.fits
-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 $finalsigmaclip \
- --output=$radialprofile $quiet
-
-
-
-
-
-# Compute the normalization value
-# -------------------------------
-#
-# The normalization value is computed from the radial profile in between
-# 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";
+# Only if the the user has specified a ring of normalization (--normradii).
+# Otherwise set the normalization value equal to 1.0 (no normalization).
+if [ x"$normradiusmin" != x ] && [ x"$normradiusmax" != x ]; then
+ # 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. If
+ # the user specifies sigma clip parameters, use them.
+ radialprofile=$tmpdir/rprofile-$objectid.fits
+ 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 $finalsigmaclip \
+ --output=$radialprofile $quiet
+
+ # The normalization value is computed from the radial profile in between
+ # 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 $finalsigmaclip
-q)
+else
+ normvalue=1.0
fi
-normvalue=$(asttable $radialprofile $quiet \
- --range=1,$normradiusmin,$normradiusmax \
- | aststatistics --column=2 --$normop $finalsigmaclip -q)
- [gnuastro-commits] master f42832f8 23/69: PSF stamp: allowingto use a position angle and axis ratio, (continued)
- [gnuastro-commits] master f42832f8 23/69: PSF stamp: allowingto use a position angle and axis ratio, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 2894b35a 32/69: PSF model: including the make check step for two PSF scripts, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master aae0d156 64/69: PSF tutorial: running of Segment on saturated images added, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 5fdd3a4a 31/69: PSF create: including the make check step for two PSF scripts, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master d6e6f9da 47/69: PSF flux-factor: correct the indentation, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 809be22b 67/69: Book: PSF construction tutorial, completed until the outer part, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 2b0b6294 56/69: PSF scripts: fixed two FAILS during make checks, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master f2a74d83 30/69: Book: fixing references and labels for the PSF scripts information, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master cf6335a6 18/69: PSF stamp: enabling the use of sigma-clip parameters, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 00b08df2 28/69: PSF stamp: add --saturation option for masking the saturated pixels, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 2718494e 19/69: PSF stamp: allowing to run the script without making normalization,
Mohammad Akhlaghi <=
- [gnuastro-commits] master da6eea59 33/69: Scripts: changing 'wcstoimg' to 'wcs-to-img' in several scripts, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 50fd424f 66/69: PSF tutorial: adding information to choose proper --normradii values, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 86ac2dd1 42/69: PSF select-stars: corrected bug in checking the catalog-image overlap, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master cf58a078 62/69: PSF select-stars: give the default value to the two variables, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master db2d55be 37/69: PSF select-stars: changing some variable names to follow conventions, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master cd14a366 44/69: PSF select-stars: including the make check step for this script, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 85648ac3 45/69: PSF select-stars: The script has been changed for use in general scenario, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 0facf365 16/69: Book: adding documentation of 'psf-model-scattered-light' script, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master b1e3da80 34/69: PSF junction: fixed bug when centering the different parts of the PSF, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 7c398567 36/69: Book: Correct the some parts of the making the PSF, Mohammad Akhlaghi, 2022/01/26