gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 1e0cc1a0 43/69: PSF select-stars: changing def


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 1e0cc1a0 43/69: PSF select-stars: changing default values to not crash in make check
Date: Wed, 26 Jan 2022 12:39:13 -0500 (EST)

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

    PSF select-stars: changing default values to not crash in make check
    
    Until this commit, there were some parameters set to by default values that
    don't allow to run the make check without a crash. With this commit, I have
    changed them to be able to run the make check without any problem. Of
    course, this has to be corrected. Otherwise the script result will have no
    sense in some situations. The necessary fix is to not assume any value by
    default, and force the user to specify them. For example, axis ratio,
    magnitude, colum names for the coordinates, etc.
---
 bin/script/psf-create-select-stars.in | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/bin/script/psf-create-select-stars.in 
b/bin/script/psf-create-select-stars.in
index e185cd58..68be51af 100644
--- a/bin/script/psf-create-select-stars.in
+++ b/bin/script/psf-create-select-stars.in
@@ -41,8 +41,8 @@ set -e
 
 # Default parameter's values
 hdu=1
-min=19
-max=20
+min=-99
+max=99
 show=""
 quiet=""
 output=""
@@ -50,7 +50,7 @@ tmpdir=""
 catalog=""
 keeptmp=""
 segmented=""
-minaxisratio=0.9
+minaxisratio=0.1
 version=@VERSION@
 mindistdeg=0.015277778
 field="phot_g_mean_mag"
@@ -374,15 +374,15 @@ if [ x"$catalog" != x ]; then
     if [ "$check" = 1 ]; then
 
         # Make a file for output of 'asttable'.
-        query=$tmpdir/query.fits
-        if [ -f $query ]; then
+        catalog_magfiltered=$tmpdir/query.fits
+        if [ -f $catalog_magfiltered ]; then
             echo "External Cataloge already exists "
         else
             # Select stars with magnitude between minimum to maximum.
             asttable $catalog --range=$field,$min:$max --sort=$field \
                      --range=ra,$minraimg:$maxraimg \
                      --range=dec,$mindecimg:$maxdecimg \
-                     --output=$query $quiet
+                     --output=$catalog_magfiltered $quiet
 
             numstars=$(asttable $query -i | grep 'Number of rows' | awk 
'{print $4}')
             if [ "$numstars" = 0 ]; then
@@ -414,7 +414,6 @@ fi
 
 
 
-
 # Select stars with good parallax
 # -------------------------------
 #
@@ -423,11 +422,15 @@ fi
 # 'asttable' such as '--noblank', stars that have parallax larger than
 # three times the parallax-error are removed.
 goodparallax=$tmpdir/parallax-good.fits
-asttable $query -cra,dec -c$field \
-         --range=$field,$min:$max --colinfoinstdout --noblank=4 \
-        -c'arith parallax parallax abs \
-                  parallax_error 3 x lt nan where ' \
-        | asttable -cra,dec -c$field --output=$goodparallax $quiet
+if [ x"$parallax" != x ]; then
+    asttable $query -cra,dec -c$field \
+             --range=$field,$min:$max --colinfoinstdout --noblank=4 \
+             -c'arith parallax parallax abs \
+                      parallax_error 3 x lt nan where ' \
+             | asttable -cra,dec -c$field --output=$goodparallax $quiet
+else
+    cp $catalog $goodparallax
+fi
 
 
 
@@ -500,7 +503,7 @@ asttable $circular -cra,dec -c$field | while read r d mag; 
do
    numberneighbor=$tmpdir/"$r_$d"th-star-neighbor.fits
 
    # Find number of neighborhod for each star.
-   asttable $query -cra,dec -c$field \
+   asttable $catalog -cra,dec -c$field \
            -c'arith ra dec '$r' '$d' distance-on-sphere \
                      set-i i i '$mindistdeg' gt nan where' \
             --noblank=4 \



reply via email to

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