gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 86ac2dd1 42/69: PSF select-stars: corrected bu


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 86ac2dd1 42/69: PSF select-stars: corrected bug in checking the catalog-image overlap
Date: Wed, 26 Jan 2022 12:39:13 -0500 (EST)

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

    PSF select-stars: corrected bug in checking the catalog-image overlap
    
    Until this commit, there was an error when checking the overlapping between
    the objects of the catalog and the border of the input image. The problem
    was basically that the condition was checking if the objects were outside
    of the image, but it has to be in completely the contrary: we want the
    catalog of objects to be within the image. So, the minimum RA/DEC of the
    catalog has to be _larger_ than the minimum RA/DEC of the image. In the
    same way, the maximum RA/DEC of the catalog has to be _smaller_ than the
    minimum RA/DEC of the image. I discovered this problem when trying to
    include the make checks for this script.
    
    With this commit, this bug has been fixed by changing the conditions in
    this check.
---
 bin/script/psf-create-select-stars.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/script/psf-create-select-stars.in 
b/bin/script/psf-create-select-stars.in
index 37727001..e185cd58 100644
--- a/bin/script/psf-create-select-stars.in
+++ b/bin/script/psf-create-select-stars.in
@@ -367,7 +367,7 @@ if [ x"$catalog" != x ]; then
     # Check if the catalog overlap the image or not.
     check=$(echo $minraimg $minracatalog $mindecimg $mindeccatalog \
                  $maxraimg $maxracatalog $maxdecimg $maxdeccatalog \
-                 | awk '{print ($1 >= $2 && $3 >= $4 && $5 <= $6 && $7 <= 
$8)}')
+                 | awk '{print ($1 <= $2 && $3 <= $4 && $5 >= $6 && $7 >= 
$8)}')
 
     # If catalog overlap the image, select stars with magnitudes between
     # the minimum and maximum values.



reply via email to

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