[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 3cc85d96 34/39: astscript-zeropoint: new optio
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 3cc85d96 34/39: astscript-zeropoint: new option --matchradius added |
Date: |
Wed, 19 Apr 2023 12:18:27 -0400 (EDT) |
branch: master
commit 3cc85d963eb872525f4ed7c1f97b206b1d9905da
Author: Raul Infante-Sainz <infantesainz@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
astscript-zeropoint: new option --matchradius added
Until this commit, when matching with the reference catalog, a fixed
matching distance (0.2 arcsec) was considered. However, it is not good to
have such important parameter fixed. In some situations it would be
necessary to change this parameter.
With this commit, the possibility of changing this matching distance has
been added. Now the zero point script has an option, -s/--matchradius, to
modify that parameter.
---
bin/script/zeropoint.in | 20 +++++++++++++-------
bin/script/zeropoint.mk | 3 ++-
doc/gnuastro.texi | 6 ++++++
3 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/bin/script/zeropoint.in b/bin/script/zeropoint.in
index 966684b0..6730ffcc 100644
--- a/bin/script/zeropoint.in
+++ b/bin/script/zeropoint.in
@@ -60,6 +60,7 @@ racolumn="RA"
referencezp=""
referencehdu=""
deccolumn="DEC"
+matchradius=0.2
magnituderange=""
magcolumn="MAGNITUDE"
version=@VERSION@magmg
@@ -97,12 +98,13 @@ $scriptname options:
-d, --deccolumn=STR Declination (Dec) column name of the ref.
catalog.
-m, --magcolumn=STR Magnitude column name of the ref. catalog.
-M, --magnituderange=FLT,FLT Range of the magnitude to be considered.
+ -s, --matchradius=FLT Matching distance with the ref. catalog.
-R, --reference=STR[,STR] Image(s) considered as the reference(s).
-z, --referencezp=FLT[,FLT] Zero point(s) of the reference image(s).
-H, --referencehdu=STR/INT HDU/Extension name(s) or number(s) the ref.
images.
- -a, --aperarcsec=FLT[,FLT] Aperture radius (in arco seconds).
- -K, --keepzpap Keep a zero point for each aperture in a
different HDU.
+ -a, --aperarcsec=FLT[,FLT] Aperture radius (in arco seconds) for
photometry.
+ -K, --keepzpap Keep the zero point from each aperture in a
different HDU.
-j, --jobs=INT Number of threads; maximum jobs with no arg.
Output:
@@ -275,6 +277,9 @@ do
-m|--magcolumn) magcolumn="$2";
check_v "$1" "$magcolumn"; shift;shift;;
-m=*|--magcolumn=*) magcolumn="${1#*=}";
check_v "$1" "$magcolumn"; shift;;
-m*) magcolumn=$(echo "$1" | sed -e's/-m//');
check_v "$1" "$magcolumn"; shift;;
+ -s|--matchradius) matchradius="$2";
check_v "$1" "$matchradius"; shift;shift;;
+ -s=*|--matchradius=*) matchradius="${1#*=}";
check_v "$1" "$matchradius"; shift;;
+ -s*) matchradius=$(echo "$1" | sed -e's/-s//');
check_v "$1" "$matchradius"; shift;;
-M|--magnituderange) magnituderange="$2";
check_v "$1" "$magnituderange"; shift;shift;;
-M=*|--magnituderange=*) magnituderange="${1#*=}";
check_v "$1" "$magnituderange"; shift;;
@@ -492,11 +497,12 @@ fi
#
# Basic parameters.
config=$tmpdir/zeropoint.conf
-echo "input = $inputs" > $config
-echo "output = $output" >> $config
-echo "hduinput = $hdu" >> $config
-echo "zpinput = 0" >> $config
-echo "tmpdir = $tmpdir" >> $config
+echo "zpinput = 0" > $config
+echo "input = $inputs" >> $config
+echo "hduinput = $hdu" >> $config
+echo "output = $output" >> $config
+echo "tmpdir = $tmpdir" >> $config
+echo "matchradius = $matchradius" >> $config
# Magnitude range. Empty string if not provided.
if [ x$magnituderange = x ]; then
diff --git a/bin/script/zeropoint.mk b/bin/script/zeropoint.mk
index b8ff6942..06d22674 100644
--- a/bin/script/zeropoint.mk
+++ b/bin/script/zeropoint.mk
@@ -183,8 +183,9 @@ $(magdiff): $(tmpdir)/%-magdiff.fits: $(tmpdir)/%-cat.fits \
match=$(subst .fits,-match.fits,$@)
input=$(tmpdir)/input-$(word 2,$(subst -, ,$*))-cat.fits
astmatch $$ref --hdu=1 $$input --hdu2=1 \
- --ccol1=RA,DEC --ccol2=RA,DEC --aperture=0.2 \
+ --ccol1=RA,DEC --ccol2=RA,DEC \
--outcols=aMAGNITUDE,bMAGNITUDE \
+ --aperture=$(matchradius) \
--output=$$match
# Subtract the reference catalog mag from input catalog's mag.
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 0ccd7aae..a2c63365 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -30026,6 +30026,12 @@ Magnitude column name of the reference catalog.
@itemx --reference=STR,[STR]
Reference image or images which based on the zeropoint of the input image will
be estimated.
+@item -s FLT
+@itemx --matchradius=FLT
+Matching radius in arc seconds.
+The searching distance to match sources with the reference catalog.
+By default it is 0.2 arcsec.
+
@item -z FLT,[FLT]
@itemx --referencezp=FLT,[FLT]
Zeropoint of the reference image or images.
- [gnuastro-commits] master 88b4c298 23/39: Book: tutorial of zero point; subsection catalog reference, (continued)
- [gnuastro-commits] master 88b4c298 23/39: Book: tutorial of zero point; subsection catalog reference, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master aeb507b8 22/39: Book: correct the info format menus, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 069e12f4 24/39: Zeropoint: a bug about the matching of reference and main catalog, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master c4af3dfc 25/39: Book: tutorial of zero point; completing the catalog reference, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 536052fb 35/39: astscript-zeropoint: writting all receipes as in one shell, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 96137885 09/39: Zeropoint: keep Mag-vs-Zeropoint for best aperture in output, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 151e8bfc 20/39: Book: editing zero point estimation section, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 85a5ad67 21/39: zeropoint: using single equal instead of the double for checking, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master ea82d80a 29/39: Book: Use suggestive instead of imperative word, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 4bf867d3 26/39: Book: open imge by 'zscale' scale and options are written as code format, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 3cc85d96 34/39: astscript-zeropoint: new option --matchradius added,
Mohammad Akhlaghi <=
- [gnuastro-commits] master 83e74d09 38/39: astscript-zeropoint: the name of some options are modified, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 21cd71bf 39/39: astscript-zeropoint: edits for merging into master branch, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 0fabd68e 30/39: Zeropoint: add an option for doing many jobs and check overlapping, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 0e982706 33/39: astscript-zeropoint: polishing and improving the comments of the scripts, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master fcf00960 37/39: astscript-zeropoint: Content of temorary file have been removed, Mohammad Akhlaghi, 2023/04/19