gnuastro-commits
[Top][All Lists]
Advanced

[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



reply via email to

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