gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 8be4edd7 18/39: Zeropoint: a bug about the mag


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 8be4edd7 18/39: Zeropoint: a bug about the magnitude range
Date: Wed, 19 Apr 2023 12:18:24 -0400 (EDT)

branch: master
commit 8be4edd7211022e80b6c5871cc954661932ddc5e
Author: Elham Saremi <saremi_elham@yahoo.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Zeropoint: a bug about the magnitude range
    
    Until now, if the user used the option --magnituderange with two values
    minimum and maximum of magnitude, there was no problem. But if the user
    didn't determine this range, an error is encountered. While this option is
    not mandatory.
    
    With this commit, the bug is fixed. The bug was related to setting minimum
    and maximum magnitude on the header of output while there was no condition
    for when users don't use the range.
---
 bin/script/zeropoint.mk | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/bin/script/zeropoint.mk b/bin/script/zeropoint.mk
index 6fd16433..c8dc76d5 100644
--- a/bin/script/zeropoint.mk
+++ b/bin/script/zeropoint.mk
@@ -270,8 +270,12 @@ $(zeropoint): $(aperzeropoint)
        astfits $@.fits --write=ZPAPER,"$$bestaper","Best aperture."
        astfits $@.fits --write=ZPVALUE,"$$bestzp","Best zeropoint."
        astfits $@.fits --write=ZPSTD,"$$beststd","Best standard deviation of 
zeropoint."
-       astfits $@.fits --write=MAGMIN,"$$magmin","Minimum magnitude for 
obtaining zeropoint."
-       astfits $@.fits --write=MAGMAX,"$$magmax","Maximum magnitude for 
obtaining zeropoint."
+
+#      If the user requested a certain magnitude range, add minmag and maxmag 
to header.
+       if [ x"$(magrange)" != x ]; then
+         astfits $@.fits --write=MAGMIN,"$$magmin","Minimum magnitude for 
obtaining zeropoint."
+         astfits $@.fits --write=MAGMAX,"$$magmax","Maximum magnitude for 
obtaining zeropoint."
+       fi
 
        if [ x"$(keepzpap)" = x ]; then
 



reply via email to

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