[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 \
- [gnuastro-commits] master 86ac2dd1 42/69: PSF select-stars: corrected bug in checking the catalog-image overlap, (continued)
- [gnuastro-commits] master 86ac2dd1 42/69: PSF select-stars: corrected bug in checking the catalog-image overlap, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master cf58a078 62/69: PSF select-stars: give the default value to the two variables, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master db2d55be 37/69: PSF select-stars: changing some variable names to follow conventions, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master cd14a366 44/69: PSF select-stars: including the make check step for this script, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 85648ac3 45/69: PSF select-stars: The script has been changed for use in general scenario, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 0facf365 16/69: Book: adding documentation of 'psf-model-scattered-light' script, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master b1e3da80 34/69: PSF junction: fixed bug when centering the different parts of the PSF, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 7c398567 36/69: Book: Correct the some parts of the making the PSF, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master b82adcfc 46/69: Book: some essential option was add to astscript-psf-select-stars section, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master ff3bb03f 38/69: PSF select-stars: removing not used options and polishing the comments, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master b5525411 48/69: PSF select-stars: delete the value of some options and ask them from the user,
Mohammad Akhlaghi <=
- [gnuastro-commits] master 075bc680 58/69: PSF select-stars: remove the stars that have stars., Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 9aae5f5c 65/69: Book: Edits to the tutorial on creating the extended PSF, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master b1e2eb54 68/69: Book: Extended PSF tutorial moved to Tutorials chapter, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 9db9e205 11/69: PSF junction: new script for joining two PSF images, Mohammad Akhlaghi, 2022/01/26