gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 85a5ad67 21/39: zeropoint: using single equal


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 85a5ad67 21/39: zeropoint: using single equal instead of the double for checking
Date: Wed, 19 Apr 2023 12:18:25 -0400 (EDT)

branch: master
commit 85a5ad676ad756ac1398f470f2dc007d06c4462c
Author: Zohreh Ghaffari <zoh.ghaffari@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    zeropoint: using single equal instead of the double for checking
    
    Until now, in checking the '--keepzpap', we used the double equal sign
    ('=='), which can cause errors in some shells. Because they intterpret it
    as pattern matching.
    
    With this commit, this problem is fixed by using the single equal sign.
---
 bin/script/zeropoint.mk | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bin/script/zeropoint.mk b/bin/script/zeropoint.mk
index c8dc76d5..9f326012 100644
--- a/bin/script/zeropoint.mk
+++ b/bin/script/zeropoint.mk
@@ -247,6 +247,7 @@ $(zeropoint): $(aperzeropoint)
 
 #      Obtained the zeropoint and zeropoint std of each apertures.
        zp=$(subst .fits,-tmp.txt,$@)
+
        echo "# Column 1: APERTURE  [arcsec,f32,]" > $$zp
        echo "# Column 2: ZEROPOINT [mag,f32,]"  >> $$zp
        echo "# Column 3: ZPSTD     [mag,f32,]"  >> $$zp
@@ -263,6 +264,7 @@ $(zeropoint): $(aperzeropoint)
          magmax=$$(echo "$(magrange)" | sed 's\,\ \' | awk '{print $$2}')
        fi
        asttable $$zp --output=$@.fits
+
        bestaper=$$(asttable $$zp --sort=ZPSTD --head=1 --column=APERTURE)
        bestzp=$$(asttable $$zp --sort=ZPSTD --head=1  --column=ZEROPOINT)
        beststd=$$(asttable $$zp --sort=ZPSTD --head=1  --column=ZPSTD)
@@ -286,7 +288,8 @@ $(zeropoint): $(aperzeropoint)
             check=$$(echo $$a \
                           | awk -vb=$$bestaper \
                                 '$$1>b-1e-6 && $$1<b+1e-6{print "yes"}')
-            if [ x$$check == xyes ]; then bestaperstr=$$a; fi
+            if [ x$$check = xyes ]; then bestaperstr=$$a; fi
+
           done
 
 #         Move the main table to the output and copy the Mag-vs-Zeroppoint



reply via email to

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