gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 4d958380 1/2: Convolve: check images written t


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 4d958380 1/2: Convolve: check images written to directory of output, not input
Date: Tue, 1 Oct 2024 20:17:54 -0400 (EDT)

branch: master
commit 4d9583808ca1eb70cb554e68bd37ff901bc48f92
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Convolve: check images written to directory of output, not input
    
    Until now, when a check image was requested of Convolve, it was created in
    the running directory, and based on the name of the input, not in the
    output directory and based on the name of the output (as is expected in all
    Gnuastro programs).
    
    With this commit, this un-expected behavior is fixed. Also, in the
    description of Convolve's '--makekernel' option, we now directly point to
    the tutorial on building the extended PSF and the old list of how to use a
    bright star to build the PSF is removed.
    
    This fixes bug #66280.
---
 NEWS              |  2 ++
 bin/convolve/ui.c | 15 ++++++++++-----
 doc/gnuastro.texi | 22 +++-------------------
 3 files changed, 15 insertions(+), 24 deletions(-)

diff --git a/NEWS b/NEWS
index 2853aa2e..0f1337e2 100644
--- a/NEWS
+++ b/NEWS
@@ -39,6 +39,8 @@ See the end of the file for license conditions.
     (smaller than a pixel even after accounting for the truncation
     factor). Reported by Alejandro Camazón Pinilla.
 
+  - bug #66280: Convolve's check images not in same directory as output.
+
 
 
 
diff --git a/bin/convolve/ui.c b/bin/convolve/ui.c
index 6852f8ad..05669e6c 100644
--- a/bin/convolve/ui.c
+++ b/bin/convolve/ui.c
@@ -660,22 +660,27 @@ ui_preparations(struct convolveparams *p)
     }
 
 
-  /* Set the output name if the user hasn't set it. */
+
+  /* Set the output name if the user hasn't set it. When the output name is
+     given (possibly with directory information), the check images will
+     also be put in that same directory.*/
   if(cp->output==NULL)
     cp->output=gal_checkset_automatic_output(cp, p->filename, outsuffix);
+  else
+    cp->keepinputdir=1;
   gal_checkset_writable_remove(cp->output, p->filename, 0, cp->dontdelete);
   if(p->checkfreqsteps)
     {
-      p->freqstepsname=gal_checkset_automatic_output(cp, p->filename,
+      p->freqstepsname=gal_checkset_automatic_output(cp, cp->output,
                                                      "_freqsteps.fits");
-      gal_checkset_writable_remove(p->freqstepsname, p->filename, 0,
+      gal_checkset_writable_remove(p->freqstepsname, cp->output, 0,
                                    cp->dontdelete);
     }
   if(cp->tl.checktiles)
     {
-      cp->tl.tilecheckname=gal_checkset_automatic_output(cp, p->filename,
+      cp->tl.tilecheckname=gal_checkset_automatic_output(cp, cp->output,
                                                          "_tiled.fits");
-      gal_checkset_writable_remove(cp->tl.tilecheckname, p->filename, 0,
+      gal_checkset_writable_remove(cp->tl.tilecheckname, cp->output, 0,
                                    cp->dontdelete);
     }
 }
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index aca4dda7..979e677d 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -25491,25 +25491,9 @@ Noise has large frequencies which can make the result 
less reliable for the high
 So all the frequencies which have a spectrum smaller than the value given to 
the @option{minsharpspec} option in the sharper input image are set to zero and 
not divided.
 This will cause the wings of the final kernel to be flatter than they would 
ideally be which will make the convolved image result unreliable if it is too 
high.
 
-Some notes to on how to prepare your two input PSFs.
-Note that these (and several other issues that relate to an accurate 
estimation of the PSF) are practically described in the following tutorial: 
@ref{Building the extended PSF}.
-
-@itemize
-@item
-Choose a bright (unsaturated) star and use a region box (with Crop for 
example, see @ref{Crop}) that is sufficiently above the noise.
-
-@item
-Mask all background sources that may be nearby (you can use Segment's clumps, 
see @ref{Segment}).
-
-@item
-Use Warp (see @ref{Warp}) to warp the pixel grid so the star's center is 
exactly on the center of the central pixel in the cropped image.
-This will certainly slightly degrade the result, however, it is necessary.
-If there are multiple good stars, you can shift all of them, then normalize 
them (so the sum of each star's pixels is one) and then take their average to 
decrease this effect.
-
-@item
-The shifting might move the center of the star by one pixel in any direction, 
so crop the central pixel of the warped image to have a clean image for the 
deconvolution.
-@end itemize
-
+There is a complete tutorial in Gnuastro on how to build the (extended) PSF: 
@ref{Building the extended PSF}.
+Since the very extended PSF wings can be subtracted before matching (as 
described in that tutorial), for PSF-matching, you may not need the full 
extended PSF.
+It it is good to validate how large the PSF to match should be, based on the 
size of the sources you want to study: if it is a large nearby galaxy, you need 
a larger PSF, but if it is high redshift galxies, only the inner part of the 
tutorial above is enough.
 
 @item -c
 @itemx --minsharpspec



reply via email to

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