gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master d69373b9 2/6: psf-stamp: keeping meta-data int


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master d69373b9 2/6: psf-stamp: keeping meta-data into the output image header
Date: Mon, 13 Jun 2022 11:18:50 -0400 (EDT)

branch: master
commit d69373b9b5c89b3e8164af40c4c41f7d186308cc
Author: Raul Infante-Sainz <infantesainz@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    psf-stamp: keeping meta-data into the output image header
    
    Until this commit, some useful meta-data used for constructing the stamp
    were not saved. But in some scenarios it is important to have that data
    because it is necessary in later steps.  More in particular, for this
    script it is useful to have the clump and objects labels that were used to
    not mask the object. Also the normalization value computed to divide the
    whole image.
    
    With this commit, that metadata is saved into the header of the output
    image. As a consequence, the user is now able to read that data from the
    header using the keywords 'OLABEL', 'CLABEL', and 'NORMVAL'.
---
 bin/script/psf-stamp.in | 18 +++++++++++++++++-
 doc/gnuastro.texi       |  5 +++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/bin/script/psf-stamp.in b/bin/script/psf-stamp.in
index 80d479b6..437a77a0 100644
--- a/bin/script/psf-stamp.in
+++ b/bin/script/psf-stamp.in
@@ -685,12 +685,28 @@ fi
 # will become 'float64' also, which will cause problems later when we want
 # to stack them together (some images will be 'float32', some 'float64').
 astarithmetic $cropped_masked --hdu=1 $normvalue float32 / \
-              --output=$output $quiet
+              float32 --output=$output $quiet
 
 
 
 
 
+# Keeping meta-data
+# -----------------
+#
+# Some meta-data are useful for later analysis and because of that, they
+# are kept into the header of the output file. The data kept are: object
+# and clump that were not masked and the normalization value. If not masks
+# were applied, then set the clump and object labels to 'none'.
+if [ x"$clab" = x ]; then clab="none"; fi
+if [ x"$olab" = x ]; then olab="none"; fi
+astfits $output --write=NORMVAL,$normvalue,"Normalization value" \
+                --write=CLABEL,$clab,"CLUMP label that was not masked" \
+                --write=OLABEL,$olab,"OBJECT label that was not masked"
+
+
+
+
 # Print warning. We are printing this warning here (at the end of the
 # script) because we dont want it to be mixed with the outputs of the
 # previus commands.
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index fcbfd1e2..fc94a36d 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -25847,6 +25847,9 @@ Clumps (within the central object) that are not the 
central clump.
 @end itemize
 The result is that all objects and clumps that contaminate the central source 
are masked, while the diffuse flux of the central object remains.
 The size of the region that is used for identifying the central clump/object 
label can be specified by the option @option{--corewidth}, see below.
+The non masked object and clump labels are kept into the header of the output 
image.
+The keywords are @code{CLABEL} and @code{OLABEL}.
+If no segmentation image is used, then their values are set to @code{none}.
 
 @item -w INT
 @itemx --corewidth=INT
@@ -25864,6 +25867,8 @@ The operator for measuring the values within the ring 
defined by the option @opt
 The operator given to this option will be directly passed to the radial 
profile script @file{astscript-radial-profile}, see @ref{Generate radial 
profile}.
 As a consequence, all MakeCatalog measurements (median, mean, sigclip-mean, 
sigclip-number, etc.) can be used here.
 For a full list of MakeCatalog's measurements, please run 
@command{astmkcatalog --help}.
+The final normalization value is saved into the header of the output image 
with the keyword @code{NORMVAL}.
+If no normalization is done, then the value is set to @code{1.0}.
 
 @item -Q FLT
 @itemx --axisratio=FLT



reply via email to

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