gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 453b0e81 1/2: MakeCatalog and Segment: first H


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 453b0e81 1/2: MakeCatalog and Segment: first HDU name changed to INPUT-NO-SKY
Date: Thu, 10 Aug 2023 12:01:51 -0400 (EDT)

branch: master
commit 453b0e8154e25f74204a8a83ee4e25b30f41c8e8
Author: Sepideh Eskandarlou <sepideh.eskandarlou@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    MakeCatalog and Segment: first HDU name changed to INPUT-NO-SKY
    
    Until now, the name of the first extension of Segment's output was 'INPUT'.
    But this does not convey that by default Segment expects the sky to be
    already subtracted (if not, the '--sky' should be used).
    
    On the other hand, until now, in MakeCatalog the name of default values HDU
    ('--valueshdu') is a number ('1'). However, the default value for the other
    input HDUs are clear names (guiding the user on what is expected). This was
    because until now MakeCatalog assumed the first extension is values
    file. While in some cases maybe the first extension should not be used for
    values, therefore the result that will obtained from MakeCatalog are going
    to be wrong (without any descriptive error).
    
    With this commit, first of all the name of first extension of Segment's
    output is changed from 'INPUT' to 'INPUT-NO-SKY'. Finally, the default
    values HDU in MakeCatalog has changed to a descriptive name
    ('INPUT-NO-SKY').
---
 NEWS                            | 12 ++++++++++++
 bin/mkcatalog/astmkcatalog.conf | 26 +++++++++++++-------------
 bin/segment/segment.c           |  2 --
 bin/segment/ui.c                |  8 ++++++--
 doc/gnuastro.texi               |  6 +++---
 5 files changed, 34 insertions(+), 20 deletions(-)

diff --git a/NEWS b/NEWS
index f6ef4b1f..5617bdd4 100644
--- a/NEWS
+++ b/NEWS
@@ -123,6 +123,18 @@ See the end of the file for license conditions.
     --sigclip-mean-sb       SIGCLIP_MEAN_SB        SIGCLIP-MEAN-SB
     --sigclip-mean-sb-delta SIGCLIP_MEAN_SB_DELTA  SIGCLIP-MEAN-SB-ERR
     --------------------------------------------------------------
+  - The default extension name for the values image ('--valueshdu') is now
+    'INPUT-NO-SKY'. Until now, it was simply '1' (without any hint on what
+    what is expected by default). Recall that if the sky is not subtracted
+    from the values image you can use '--sky' for MakeCatalog to subtract
+    it before the measurements. Implemented by Sepideh Eskandarlou.
+
+  Segment
+  - The default name of the first extension of Segment's output is now
+    'INPUT-NO-SKY', until now, it was 'INPUT'. This was necessary because
+    the first extension of the output is not the exact input file (if a
+    value is given to '--sky' it will be subtracted from the input in the
+    first extension). Implemented by Sepideh Eskandarlou.
 
 ** Bugs fixed
   bug #64138: Arithmetic's mknoise-poisson only using first pixel value.
diff --git a/bin/mkcatalog/astmkcatalog.conf b/bin/mkcatalog/astmkcatalog.conf
index 4d938a8e..bca4c1ea 100644
--- a/bin/mkcatalog/astmkcatalog.conf
+++ b/bin/mkcatalog/astmkcatalog.conf
@@ -20,24 +20,24 @@
 # warranty.
 
 # Input:
- hdu          OBJECTS
- valueshdu          1
- clumpshdu     CLUMPS
- skyhdu           SKY
- stdhdu       SKY_STD
- zeropoint        0.0
- sigmaclip      3,0.2
+ hdu             OBJECTS
+ valueshdu  INPUT-NO-SKY
+ clumpshdu        CLUMPS
+ skyhdu              SKY
+ stdhdu          SKY_STD
+ zeropoint           0.0
+ sigmaclip         3,0.2
 
 # Output:
- sfmagnsigma        3
- sfmagarea          100
+ sfmagnsigma           3
+ sfmagarea           100
 
 # Upper limit magnitude:
- upnum            100
- upsigmaclip    3,0.2
- upnsigma           1
+ upnum               100
+ upsigmaclip       3,0.2
+ upnsigma              1
 
 # Settings for other columns:
- spatialresolution  2
+ spatialresolution     2
 
 # Catalog columns:
diff --git a/bin/segment/segment.c b/bin/segment/segment.c
index ab593238..fd49eab0 100644
--- a/bin/segment/segment.c
+++ b/bin/segment/segment.c
@@ -1386,7 +1386,6 @@ segment_output(struct segmentparams *p)
   if(!p->rawoutput)
     gal_fits_img_write(p->input, p->cp.output, NULL, PROGRAM_NAME);
 
-
   /* The clump labels. */
   gal_fits_key_list_add(&keys, GAL_TYPE_FLOAT32, "CLUMPSN", 0,
                         &p->clumpsnthresh, 0, "Minimum S/N of true clumps",
@@ -1399,7 +1398,6 @@ segment_output(struct segmentparams *p)
   p->clabel->name=NULL;
   keys=NULL;
 
-
   /* The object labels. */
   if(!p->noobjects)
     {
diff --git a/bin/segment/ui.c b/bin/segment/ui.c
index 95a65588..bb254189 100644
--- a/bin/segment/ui.c
+++ b/bin/segment/ui.c
@@ -422,9 +422,13 @@ ui_prepare_inputs(struct segmentparams *p)
                                             p->input->dsize,
                                             p->input->wcs);
 
-  /* Set the name. */
+
+  /* Set the name (the sky will be subtracted here in 'ui.c' before any
+     processing. We want the name to be similar to be descriptive and
+     remind the user that the sky (which may be given to Segment) has been
+     subtracted (this is also the same name in NoiseChisel's output). */
   if(p->input->name) free(p->input->name);
-  gal_checkset_allocate_copy("INPUT", &p->input->name);
+  gal_checkset_allocate_copy("INPUT-NO-SKY", &p->input->name);
 
 
   /* Check for blank values to help later processing.  */
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 1297b054..a1883c6c 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -6081,7 +6081,7 @@ You can do this using Arithmetic in a command like below.
 For easy reading of the command, we will define the shell variable @code{i} 
for the image name and save the output in @file{masked.fits}.
 
 @example
-$ in="r_segmented.fits -hINPUT"
+$ in="r_segmented.fits -hINPUT-NO-SKY"
 $ clumps="r_segmented.fits -hCLUMPS"
 $ astarithmetic $in $clumps 0 gt nan where -oclumps-masked.fits
 @end example
@@ -20700,7 +20700,7 @@ For example, let's assume that you have set 
@ref{NoiseChisel} and @ref{Segment}
 With the command below on Segment's output, you will have a smaller image that 
only contains the sky-subtracted input pixels corresponding to object 263.
 
 @example
-$ astarithmetic seg.fits -hINPUT seg.fits -hOBJECTS \
+$ astarithmetic seg.fits -hINPUT-NO-SKY seg.fits -hOBJECTS \
                 263 ne nan where trim --output=obj-263.fits
 @end example
 
@@ -27071,7 +27071,7 @@ $ astfits image_segmented.fits -h0 | grep -i snquant
 
 @cindex DS9
 @cindex SAO DS9
-By default, besides the @code{CLUMPS} and @code{OBJECTS} extensions, Segment's 
output will also contain the (technically redundant) input dataset and the sky 
standard deviation dataset (if it was not a constant number).
+By default, besides the @code{CLUMPS} and @code{OBJECTS} extensions, Segment's 
output will also contain the (technically redundant) sky-subtracted input 
dataset (@code{INPUT-NO-SKY}) and the sky standard deviation dataset 
(@code{SKY_STD}, if it was not a constant number).
 This can help in visually inspecting the result when viewing the images as a 
``Multi-extension data cube'' in SAO DS9 for example, (see @ref{Viewing FITS 
file contents with DS9 or TOPCAT}).
 You can simply flip through the extensions and see the same region of the 
image and its corresponding clumps/object labels.
 It also makes it easy to feed the output (as one file) into MakeCatalog when 
you intend to make a catalog afterwards (see @ref{MakeCatalog}.



reply via email to

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