[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master a841d3f2 02/39: zeropoint: catalogs can be use
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master a841d3f2 02/39: zeropoint: catalogs can be used as reference |
Date: |
Wed, 19 Apr 2023 12:18:21 -0400 (EDT) |
branch: master
commit a841d3f299652ba7d373631b4f96c752e2ec59b7
Author: Sepideh Eskandarlou <sepideh.eskandarlou@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
zeropoint: catalogs can be used as reference
Until now, in the 'zeropoint.mk' file if the user had an image as input and
one (or more than one) image as refrence, s/he could obtain the zeropoint
of the input image based on the zeropoint of the refrence image. But if the
user had an image as input and a catalog as refrence and wanted calculate
the zeropoint of the image, this option did not exist in the Make file.
With this commit, this option is added to the Makefile. Now user can based
on the zeropoint of a catalog (as a refrence) can calculate the zeropoint
of the input image.
---
.../{zeropoint-img-img-cat.conf => zeropoint.conf} | 23 ++++++++-------
.../{zeropoint-img-img-cat.mk => zeropoint.mk} | 33 ++++++++++++++++++----
2 files changed, 41 insertions(+), 15 deletions(-)
diff --git a/bin/script/zeropoint-img-img-cat.conf b/bin/script/zeropoint.conf
similarity index 51%
rename from bin/script/zeropoint-img-img-cat.conf
rename to bin/script/zeropoint.conf
index 6c796b00..184ea67e 100644
--- a/bin/script/zeropoint-img-img-cat.conf
+++ b/bin/script/zeropoint.conf
@@ -4,20 +4,23 @@
# Input
-ref1 = indir/sdss-1.fits
-ref2 = indir/sdss-2.fits
-ref1hdu = 0
-ref2hdu = 0
-refnumber = 1 2
-ref1zp = 22.5
-ref2zp = 22.5
-input = indir/jplus.fits
-inputhdu = 1
+##ref1 = indir/sdss-1.fits
+##ref2 = indir/sdss-2.fits
+##ref1hdu = 0
+##ref2hdu = 0
+##ref1zp = 22.5
+##ref2zp = 22.5
+ref1 = indir/cat.fits
+ref1hdu = 1
+refnumber = 1
+reftype = img cat
+input = indir/jplus.fits
+inputhdu = 1
# Output
tmpdir = build
# Analysis paramaters For 'aper-arcsec' in the script convet the comma into
# space (the user should give: --aperarcsec=2,3,3.5,...).
-aper-arcsec = 2 3 3.5 4 4.5 5 6 7
+aper-arcsec = 2 3 3.5 4 4.5 5 6 7 10 20
magrange =
diff --git a/bin/script/zeropoint-img-img-cat.mk b/bin/script/zeropoint.mk
similarity index 90%
rename from bin/script/zeropoint-img-img-cat.mk
rename to bin/script/zeropoint.mk
index 0ea326c5..6a32ce68 100644
--- a/bin/script/zeropoint-img-img-cat.mk
+++ b/bin/script/zeropoint.mk
@@ -40,7 +40,7 @@ all: final
.SHELLFLAGS = -ec
# Include configure files.
-include zeropoint-img-img-cat.conf
+include zeropoint.conf
@@ -58,7 +58,7 @@ $(tmpdir):; mkdir $@
# Use Gaia catalog and only keep the objects with good parallax (to
# confirm that they are stars).
stars=$(tmpdir)/gaia.fits
-$(stars): $(indir)/$(input) | $(zpdir)
+$(stars): $(indir)/$(input) | $(tmpdir)
# Download from Gaia.
raw=$(subst .fits,-raw.fits,$@)
@@ -94,8 +94,12 @@ $(stars): $(indir)/$(input) | $(zpdir)
# radius 5.1 pixels. To calculate the pixel size I have to use the big
# origin image before cropping
inputzp=0
-allrefs=$(foreach i, $(refnumber), ref$(i))
-aperture=$(foreach i,input $(allrefs), \
+ifeq ($(reftype),img)
+gencat=$(foreach i, $(refnumber), ref$(i))
+else
+gencat=
+endif
+aperture=$(foreach i,input $(gencat), \
$(foreach a,$(aper-arcsec), \
$(tmpdir)/$(i)-$(a)-cat.fits))
$(aperture): $(tmpdir)/%-cat.fits: $(stars)
@@ -135,6 +139,25 @@ $(aperture): $(tmpdir)/%-cat.fits: $(stars)
+# Prepare the catalog for comparing in different apperture.
+cataper=$(foreach a,$(aper-arcsec), \
+ $(tmpdir)/ref1-$(a)-cat.fits)
+$(cataper): $(tmpdir)/ref1-%-cat.fits: $(tmpdir)/input-%-cat.fits
+
+ asttable $(ref1) -cRA,DEC -cMAGNITUDE \
+ | cat -n \
+ | asttable --output=$@ \
+ --colmetadata=1,OBJ_ID,int32,"Id of object." \
+ --colmetadata=2,RA,float64,"Right Assencion." \
+ --colmetadata=3,DEC,float64,"Declination." \
+ --colmetadata=4,MAGNITUDE,float32,"Magnitude."
+
+
+
+
+
+
+
# Calculate magnitude differences
# -------------------------------
@@ -143,13 +166,13 @@ $(aperture): $(tmpdir)/%-cat.fits: $(stars)
# magnitude in the catalog. Then subtract the reference mag from input
# mag. Finally, the final target has two columns of reference mag and
# subtracted mag.
+allrefs=$(foreach i, $(refnumber), ref$(i))
magdiff=$(foreach r,$(allrefs), \
$(foreach a,$(aper-arcsec), \
$(tmpdir)/$(r)-$(a)-magdiff.fits))
$(magdiff): $(tmpdir)/%-magdiff.fits: $(tmpdir)/%-cat.fits \
$(tmpdir)/input-$$(word 2,$$(subst -, ,%))-cat.fits
-
# Find the matching objects in both catalogs. Note that the
# labels are the same so we don't need to use RA,Dec
ref=$(tmpdir)/$*-cat.fits
- [gnuastro-commits] master 17b5fa81 36/39: Book: simplifying and polishing the zero point script tutorial, (continued)
- [gnuastro-commits] master 17b5fa81 36/39: Book: simplifying and polishing the zero point script tutorial, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 7769e279 07/39: zeropoint: new options for magnitude and keeping the results are added, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master a1c7a277 16/39: Book: tutorial of zero point; select the best aperture, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 1a987e04 19/39: Book: tutorial of zero point; using keepzpap and completion of results, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master a3c0f0e2 31/39: Zeropoint: optimize the script for overlaping check, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 156da6c7 28/39: Book: Increase readability and correction, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master d8402f1a 32/39: Book: some command and some tips is added to better recognition, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 6ff43d00 05/39: Zeropoint: script for estimating the zeropoint of an image, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 76c8a482 03/39: Zeropoint: add a script for bing it on Gnuastro, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master dddb483f 01/39: zeropoint: First make file for obtainaing the zeropoint photometry, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master a841d3f2 02/39: zeropoint: catalogs can be used as reference,
Mohammad Akhlaghi <=
- [gnuastro-commits] master 2c027224 08/39: Zeropoint: change the output file, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master ea79c2ba 14/39: Book: tutorial of zero point; removing the sky and running the script, Mohammad Akhlaghi, 2023/04/19
- [gnuastro-commits] master 48edcd91 13/39: Book: tutorial of zero point; preparing images for using the script, Mohammad Akhlaghi, 2023/04/19
- [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