[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master b1e3da80 34/69: PSF junction: fixed bug when c
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master b1e3da80 34/69: PSF junction: fixed bug when centering the different parts of the PSF |
Date: |
Wed, 26 Jan 2022 12:39:12 -0500 (EST) |
branch: master
commit b1e3da80b2f4bb9a16331cd4bf33564cce863135
Author: Raul Infante-Sainz <infantesainz@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
PSF junction: fixed bug when centering the different parts of the PSF
Until this commit, when merging two different parts of the PSF the center
of the final merged PSF was not the correct one. In addition to this, also
the image used for masking the inner part of the outer PSF, and the outer
part of the inner PSF, was not properly constructed. With this commit,
both problems have been solved. By changing the way the center of the PFS
and the mask profile, now the final PSF has the correct center position and
the junction is also done in the proper radius.
---
bin/script/psf-create-junction.in | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/bin/script/psf-create-junction.in
b/bin/script/psf-create-junction.in
index f4eedef7..fc481a6e 100644
--- a/bin/script/psf-create-junction.in
+++ b/bin/script/psf-create-junction.in
@@ -348,11 +348,9 @@ ypsfcenter=$(astarithmetic $ypsfaxis 2 / --quiet)
#
# In order to allocate the PSF into the center coordinates provided by the
# user, it is necessary to compute the appropiate offsets along the X and Y
-# axis. After that, the PSF image is warped using that offsets. Note that
-# in order to account for a 1 pixel offset, it is necessary to subtract the
-# value 1.
-xdiff=$(astarithmetic $xcenter $xpsfcenter - 1.0 - --quiet)
-ydiff=$(astarithmetic $ycenter $ypsfcenter - 1.0 - --quiet)
+# axis. After that, the PSF image is warped using that offsets.
+xdiff=$(astarithmetic $xcenter $xpsfcenter - --quiet)
+ydiff=$(astarithmetic $ycenter $ypsfcenter - --quiet)
coretranslated=$tmpdir/"$bname_core"_translated.fits
astwarp $core --translate=$xdiff,$ydiff \
@@ -371,7 +369,9 @@ astwarp $core --translate=$xdiff,$ydiff \
# PSF or scattered light field model would not be possible. Here, this
# cropping is done.
xrange=$(echo "$xdiff $xaxis $xcenter" \
- | awk '{if($1<0) \
+ | awk '{if($1==0) \
+ {min=0; max=$2-1;} \
+ else if($1<0) \
{i=int($1); \
d=-1*i+1; \
min=d; max=$2+d-1;} \
@@ -380,7 +380,9 @@ xrange=$(echo "$xdiff $xaxis $xcenter" \
printf "%d:%d", min, max}')
yrange=$(echo "$ydiff $yaxis $ycenter" \
- | awk '{if($1<0) \
+ | awk '{if($1==0) \
+ {min=0; max=$2-1;} \
+ else if($1<0) \
{i=int($1); \
d=-1*i+1; \
min=d; max=$2+d-1;} \
@@ -426,7 +428,9 @@ astarithmetic $corecropped --hdu=1 set-i \
# As a consequence, the final image will be the sum of these two masked
# images.
maskimage=$tmpdir/mask-image.fits
-echo "1 $xcenter $ycenter 5 $radius 1 $positionangle $axisratio 1 1" \
+xcentmask=$(astarithmetic $xcenter 1 + --quiet)
+ycentmask=$(astarithmetic $ycenter 1 + --quiet)
+echo "1 $xcentmask $ycentmask 5 $radius 1 $positionangle $axisratio 1 1" \
| astmkprof --background=$corefluxscaled \
--mode=img \
--clearcanvas \
@@ -457,13 +461,13 @@ echo "1 $xcenter $ycenter 5 $radius 1 $positionangle
$axisratio 1 1" \
# 0 0 C C 0 0
# 0 0 0 0 0 0
-outer_masked=$tmpdir/"$bname_outer"_masked.fits
+outer_masked=$tmpdir/"$bname_outer"_outermasked.fits
astarithmetic $inputs --hdu=1 set-psfouter \
$maskimage --hdu=1 set-mask \
psfouter mask 1 eq 0 where --output=$outer_masked $quiet
-core_masked=$tmpdir/"$bname_core"_masked.fits
+core_masked=$tmpdir/"$bname_core"_coremasked.fits
astarithmetic $corefluxscaled --hdu=1 set-psfinner \
$maskimage --hdu=1 set-mask \
psfinner mask 1 ne 0 where --output=$core_masked $quiet
- [gnuastro-commits] master 00b08df2 28/69: PSF stamp: add --saturation option for masking the saturated pixels, (continued)
- [gnuastro-commits] master 00b08df2 28/69: PSF stamp: add --saturation option for masking the saturated pixels, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 2718494e 19/69: PSF stamp: allowing to run the script without making normalization, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master da6eea59 33/69: Scripts: changing 'wcstoimg' to 'wcs-to-img' in several scripts, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 50fd424f 66/69: PSF tutorial: adding information to choose proper --normradii values, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 86ac2dd1 42/69: PSF select-stars: corrected bug in checking the catalog-image overlap, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master cf58a078 62/69: PSF select-stars: give the default value to the two variables, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master db2d55be 37/69: PSF select-stars: changing some variable names to follow conventions, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master cd14a366 44/69: PSF select-stars: including the make check step for this script, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 85648ac3 45/69: PSF select-stars: The script has been changed for use in general scenario, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 0facf365 16/69: Book: adding documentation of 'psf-model-scattered-light' script, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master b1e3da80 34/69: PSF junction: fixed bug when centering the different parts of the PSF,
Mohammad Akhlaghi <=
- [gnuastro-commits] master 7c398567 36/69: Book: Correct the some parts of the making the PSF, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master b82adcfc 46/69: Book: some essential option was add to astscript-psf-select-stars section, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master ff3bb03f 38/69: PSF select-stars: removing not used options and polishing the comments, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master b5525411 48/69: PSF select-stars: delete the value of some options and ask them from the user, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 075bc680 58/69: PSF select-stars: remove the stars that have stars., Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 9aae5f5c 65/69: Book: Edits to the tutorial on creating the extended PSF, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master b1e2eb54 68/69: Book: Extended PSF tutorial moved to Tutorials chapter, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 9db9e205 11/69: PSF junction: new script for joining two PSF images, Mohammad Akhlaghi, 2022/01/26