gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 2ba96a9e: psf-scale-factor: --nocentering opti


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 2ba96a9e: psf-scale-factor: --nocentering option is added
Date: Wed, 7 Feb 2024 09:40:09 -0500 (EST)

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

    psf-scale-factor: --nocentering option is added
    
    Until now, in the script we had a configurable variable with name of
    'nocentering', but it did not exist in the options
    
    With this commit, this option is added and its definition is added in the
    Invoking section of the book.
---
 NEWS                           |  5 +++++
 bin/script/psf-scale-factor.sh |  5 +++++
 doc/gnuastro.texi              | 12 ++++++++++++
 3 files changed, 22 insertions(+)

diff --git a/NEWS b/NEWS
index e22cde1c..ca28681f 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,11 @@ See the end of the file for license conditions.
     short format of '-g'); similar to the same option in Arithmetic or
     ConvertType.
 
+*** astscript-psf-scale-factor
+  --nocentering: disable sub-pixel centering of the desired star before
+    finding the scale factor; added by Sepideh Eskandarlou and Raul
+    Infante-Sainz.
+
 ** Removed features
 ** Changed features
 *** All programs
diff --git a/bin/script/psf-scale-factor.sh b/bin/script/psf-scale-factor.sh
index 07804b85..a215e02f 100644
--- a/bin/script/psf-scale-factor.sh
+++ b/bin/script/psf-scale-factor.sh
@@ -9,6 +9,7 @@
 #   Raul Infante-Sainz <infantesainz@gmail.com>
 # Contributing author(s):
 #   Mohammad Akhlaghi <mohammad@akhlaghi.org>
+#   Sepideh Eskandarlou <sepideh.eskandarlou@gmail.com>
 # Copyright (C) 2021-2024 Free Software Foundation, Inc.
 #
 # Gnuastro is free software: you can redistribute it and/or modify it under
@@ -100,6 +101,8 @@ $scriptname options:
                           for computing the scaling factor value.
   -S, --segment=STR       Output of Segment (with OBJECTS and CLUMPS).
   -s, --sigmaclip=FLT,FLT Sigma-clip multiple and tolerance.
+  -d, --nocentering       Do not do the sub-pixel centering to new pix
+                          grid.
 
  Output:
   -t, --tmpdir            Directory to keep temporary files.
@@ -298,6 +301,8 @@ do
         -s|--sigmaclip)      sigmaclip="$2";                            
check_v "$1" "$sigmaclip";  shift;shift;;
         -s=*|--sigmaclip=*)  sigmaclip="${1#*=}";                       
check_v "$1" "$sigmaclip";  shift;;
         -s*)                 sigmaclip=$(echo "$1"  | sed -e's/-s//');  
check_v "$1" "$sigmaclip";  shift;;
+        -d|--nocentering)     nocentering=1; shift;;
+        -d*|--nocentering=*)  on_off_option_error --nocentering -d;;
 
         # Output parameters
         -k|--keeptmp)     keeptmp=1; shift;;
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 599bb13e..352ca308 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -35586,6 +35586,18 @@ This parameter is passed to Gnuastro's Crop program 
make a crop for further proc
 The positions along each dimension must be separated by a comma (@key{,}).
 The units of the coordinates are interpreted based on the value to the 
@option{--mode} option (see below).
 
+The given coordinate for the central value can have sub-pixel elements (for 
example, it falls on coordinate 123.4,567.8 of the input image pixel grid).
+In such cases, after cropping, this script will use Gnuastro's @ref{Warp} to 
shift (or translate) the pixel grid by @mymath{-0.4} pixels along the 
horizontal and @mymath{1-0.8=0.2} pixels along the vertical.
+Finally the newly added pixels (due to the warping) will be trimmed to have 
your desired coordinate exactly in the center of the central pixel of the 
output.
+This is very important (critical!) when you are constructing the central part 
of the PSF.
+But for the very far outer parts it may not too effective (should be checked), 
or the target object may have already been centered at the requested coordinate.
+In such cases, to avoid wasting time for the warping, you can simply use 
@option{--nocentering} to disable sub-pixel centering.
+
+@item -d
+@itemx --nocentering
+Do not do the sub-pixel centering to a new pixel grid.
+See the description of the @option{--center} option for more.
+
 @item -O STR
 @itemx --mode=STR
 Interpret the center position of the object (values given to 
@option{--center}) in image or WCS coordinates.



reply via email to

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