gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master f58c3211 08/69: PSF model: checking that a PSF


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master f58c3211 08/69: PSF model: checking that a PSF image is given for computing flux factor
Date: Wed, 26 Jan 2022 12:39:09 -0500 (EST)

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

    PSF model: checking that a PSF image is given for computing flux factor
    
    Until this commit, the script that computes the flux factor was not
    checking if a PSF image was given. This was causing the script to crash and
    it took to me a while to notice that error.  With this commit, I have added
    a check to ensure that a PSF image is provided with the option '--psf'. If
    the user does not provide it, the script will crash and warn about this
    problem with a good message.
---
 bin/script/psf-model-flux-factor.in | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/bin/script/psf-model-flux-factor.in 
b/bin/script/psf-model-flux-factor.in
index 6781a505..b438f0dc 100644
--- a/bin/script/psf-model-flux-factor.in
+++ b/bin/script/psf-model-flux-factor.in
@@ -286,6 +286,13 @@ if [ x"$inputs" = x ]; then
     exit 1
 fi
 
+# If a PSF image (--psf) is not given at all.
+if [ x"$psf" = x ]; then
+    echo "$scriptname: no PSF image provided."
+    echo "A PSF image has to be specified with --psf or -p."
+    exit 1
+fi
+
 # If a stamp width (--stampwidth) is not given at all.
 if [ x"$stampwidth" = x ]; then
     echo "$scriptname: no stamp width provided."



reply via email to

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