gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master b5525411 48/69: PSF select-stars: delete the v


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master b5525411 48/69: PSF select-stars: delete the value of some options and ask them from the user
Date: Wed, 26 Jan 2022 12:39:14 -0500 (EST)

branch: master
commit b55254115a73158419b64993810dd97c052fde7a
Author: Sepideh Eskandarlou <sepideh.eskandarlou@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    PSF select-stars: delete the value of some options and ask them from the 
user
    
    Until now, some options such as '--minaxisratio', '--mindistdeg', and
    'matchaperturedeg' had a value by default and if the user did not provide
    these values the script had been working. While these options are essential
    values in 'astscript-create-select-stars' script and if the user does not
    provide these options the script worked with the by default values and get
    the mistake results. And in some scenario may be the user do not want to
    select stars with good parallax, while in astqurey she/he should provide
    this column.
    
    With this commit, the value of these options removed. And if the user does
    not provide these options the script will be intterupt and print an
    error. And if the user do not want provide the stars with good parallax 
she/he
    can easily did not determined this '--parallaxanderrorcolumn' option.
---
 bin/script/psf-create-select-stars.in | 44 +++++++++++++++++++++++++++--------
 1 file changed, 34 insertions(+), 10 deletions(-)

diff --git a/bin/script/psf-create-select-stars.in 
b/bin/script/psf-create-select-stars.in
index e20d305f..cc9f42e7 100755
--- a/bin/script/psf-create-select-stars.in
+++ b/bin/script/psf-create-select-stars.in
@@ -41,7 +41,6 @@ set -e
 
 # Default parameter's values
 hdu=1
-show=""
 quiet=""
 output=""
 tmpdir=""
@@ -49,15 +48,15 @@ catalog=""
 keeptmp=""
 segmented=""
 racolumn="ra"
+mindistdeg=""
 deccolumn="dec"
-minaxisratio=0.1
+minaxisratio=""
 version=@VERSION@
 magnituderange=""
-mindistdeg=0.015277778
+matchaperturedeg=""
 field="phot_g_mean_mag"
 scriptname=@SCRIPT_NAME@
 parallaxanderrorcolumn=""
-matchaperturedeg=3.0/3600
 dataset="gaia --dataset=edr3"
 
 
@@ -319,18 +318,41 @@ fi
 
 # Check if the parallax and parallax error column does not provided, the
 # script print an error.
-if [ $parallaxanderrorcolumn = 0 ]; then
-    parallax_and_error=""
+if [ x$parallaxanderrorcolumn = x ]; then
+    columnquery=$racolumn,$deccolumn,$field
 else
     nmparallax=$(echo $parallaxanderrorcolumn | awk 'BEGIN{FS=","}END{print 
NF}')
     if [ x$nmparallax != x2 ]; then
         echo "$scriptname: '--parallaxanderrorcolumn' (or '-p') only take two 
values, while $nmparallax were given."
         exit 1
     else
-        parallax_and_error=$(echo $parallaxanderrorcolumn)
+        columnquery=$racolumn,$deccolumn,$field,$parallaxanderrorcolumn
     fi
 fi
 
+# Check if the minimum axis ratio does not provided, the script print
+# an error.
+if [ x$minaxisratio = x ]; then
+    echo "$scriptname: The minimum axis ratio does not provided."
+    echo "$scriptname: The '--minaxisratio' (or '-Q') should be provided."
+    exit 1
+fi
+
+# Check if the user does not provided minimum axis ratio, the script will
+# be intterupted.
+if [ x$mindistdeg = x ]; then
+    echo "$scriptname: The minimum distance in degree for finding the number 
of neighbor does not provided. "
+    echo "$scriptname: The '--mindistdeg' (or '-M') should be provided."
+    exit 1
+fi
+
+# Check
+if [ x$matchaperturedeg = x ]; then
+    echo "$scriptname: The aperture for matching cordinate in catalog with 
clumps does not provided."
+    echo "$scripname: The '--matchaperturedeg' (or '-a') should be provided."
+    exit 1
+fi
+
 
 
 # Basic parameters: magnitude range, parallax and parallax_error.
@@ -339,6 +361,8 @@ fi
 # Obtain the magnitude range from the command line arguments.
 minmag=$(echo "$magnituderange" | awk 'BEGIN{FS=","} {print $1}')
 maxmag=$(echo "$magnituderange" | awk 'BEGIN{FS=","} {print $2}')
+
+# Obtain the parallax and parallax_error columns name.
 parallax=$(echo "$parallaxanderrorcolumn" \
                      | awk 'BEGIN{FS=","} {print $1}')
 parallax_error=$(echo "$parallaxanderrorcolumn" \
@@ -457,8 +481,8 @@ else
     else
        # Download the catalog with the necessary parameters.
         astquery $dataset --output=$catalog_magfiltered --overlapwith=$inputs 
--hdu=$hdu \
-                 --column=$racolumn,$deccolumn,$field,$parallax_and_error \
-                --range=$field,$minmag:$maxmag --sort=$field $quiet
+                 --column=$columnquery --range=$field,$minmag:$maxmag \
+                 --sort=$field $quiet
     fi
 fi
 
@@ -473,7 +497,7 @@ fi
 # 'asttable' such as '--noblank', stars that have parallax larger than
 # three times the parallax-error are removed.
 goodparallax=$tmpdir/parallax-good.fits
-if [ x"$parallax_and_error" != x ]; then
+if [ x"$parallaxanderrorcolumn" != x ]; then
     asttable $catalog_magfiltered -c$racolumn,$deccolumn -c$field \
              --range=$field,$minmag:$maxmag --colinfoinstdout --noblank=4 \
              -c'arith '$parallax' '$parallax' abs \



reply via email to

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