[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 00b08df2 28/69: PSF stamp: add --saturation op
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 00b08df2 28/69: PSF stamp: add --saturation option for masking the saturated pixels |
Date: |
Wed, 26 Jan 2022 12:39:12 -0500 (EST) |
branch: master
commit 00b08df21521937218768ccb2eb5ac83ea7dbfec
Author: Sepideh Eskandarlou <sepideh.eskandarlou@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
PSF stamp: add --saturation option for masking the saturated pixels
Until now, just the main stars had been cropped and extra objects around
them masked and finally normalized it. Without considering the saturated
pixels in the center of stars. In this situation the user do the
normalization mistakenly, because in the normalization, the statistic value
in each radius, are obtained mistakenly.
In the mask step, two 'astarithmetic' had been used.
Now, in the mask step instead of two 'astarithmetic', one 'astarithmetic'
has been used. Which technicaly the mask step will be done faster.
If the user wants to mask the saturation pixels, he/she can use
'--saturation' option and then mask the saturated pixels and if the user
does not determined this option the saturated pixels are not masked.
---
bin/script/psf-create-make-stamp.in | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/bin/script/psf-create-make-stamp.in
b/bin/script/psf-create-make-stamp.in
index e3ad91ef..fc5fc1c1 100644
--- a/bin/script/psf-create-make-stamp.in
+++ b/bin/script/psf-create-make-stamp.in
@@ -49,6 +49,7 @@ output=""
tmpdir=""
axisratio=1
corewidth=""
+saturation=0
normradii=""
sigmaclip=""
stampwidth=""
@@ -100,6 +101,7 @@ $scriptname options:
for computing the normalization value.
-m, --mask=STR Segmentation image (sky = 0).
-M, --maskhdu=STR HDU/extension of the segmentation image.
+ -l, --saturation saturation limit for masking saturation pixels.
-w, --corewidth=INT Area width of the central object in pixels for
unmasking.
-S, --mask=STR Segmentation image (sky = 0).
-s, --maskhdu=STR HDU/extension of the segmentation image.
@@ -203,6 +205,9 @@ do
-h|--hdu) hdu="$2";
check_v "$1" "$hdu"; shift;shift;;
-h=*|--hdu=*) hdu="${1#*=}";
check_v "$1" "$hdu"; shift;;
-h*) hdu=$(echo "$1" | sed -e's/-h//');
check_v "$1" "$hdu"; shift;;
+ -l|--saturation) saturation="$2";
check_v "$1" "$saturation"; shift;shift;;
+ -l=*|--saturation=*) saturation="${1#*=}";
check_v "$1" "$saturation"; shift;;
+ -l*) saturation=$(echo "$1" | sed -e's/-l//');
check_v "$1" "$saturation"; shift;;
-n|--normradii) normradii="$2";
check_v "$1" "$normradii"; shift;shift;;
-n=*|--normradii=*) normradii="${1#*=}";
check_v "$1" "$normradii"; shift;;
-n*) normradii=$(echo "$1" | sed -e's/-n//');
check_v "$1" "$normradii"; shift;;
@@ -455,17 +460,24 @@ if [ x"$mask" != x ]; then
# Compute the label of the central object from the core cropped image.
centrallabel=$(aststatistics $cropped_core --median -q)
- # Unlabel the central object.
- cropped_unlabel=$tmpdir/cropped_unlabel-$objectid.fits
- astarithmetic $cropped_mask --hdu=1 \
- $cropped_mask --hdu=1 \
- $centrallabel eq 0 where --output=$cropped_unlabel $quiet
+ # Check if the user has determined the --saturation option.
+ if [ $saturation = 0 ]; then
+ mask_saturated=""
+ else
+ mask_saturated="i i $saturation gt nan where set-i"
+ fi
- # All objects that are not the central are masked here.
+ # Unlabel the central object and then mask everything else.
cropped_masked=$tmpdir/cropped_masked-$objectid.fits
- astarithmetic $cropped --hdu=1 \
- $cropped_unlabel --hdu=1 \
- 0 ne nan where --output=$cropped_masked $quiet
+ astarithmetic $cropped --hdu=1 set-i \
+ $cropped_mask --hdu=1 set-m \
+ \
+ $mask_saturated \
+ m m $centrallabel eq 0 where set-a \
+ a 0 ne set-mask \
+ \
+ i mask nan where \
+ --output=$cropped_masked $quiet
else
cropped_masked=$cropped
fi
- [gnuastro-commits] master 69a2e6ee 54/69: Book: correct some comments in the psf-create-select-stars, (continued)
- [gnuastro-commits] master 69a2e6ee 54/69: Book: correct some comments in the psf-create-select-stars, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master f42832f8 23/69: PSF stamp: allowingto use a position angle and axis ratio, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 2894b35a 32/69: PSF model: including the make check step for two PSF scripts, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master aae0d156 64/69: PSF tutorial: running of Segment on saturated images added, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 5fdd3a4a 31/69: PSF create: including the make check step for two PSF scripts, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master d6e6f9da 47/69: PSF flux-factor: correct the indentation, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 809be22b 67/69: Book: PSF construction tutorial, completed until the outer part, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 2b0b6294 56/69: PSF scripts: fixed two FAILS during make checks, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master f2a74d83 30/69: Book: fixing references and labels for the PSF scripts information, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master cf6335a6 18/69: PSF stamp: enabling the use of sigma-clip parameters, Mohammad Akhlaghi, 2022/01/26
- [gnuastro-commits] master 00b08df2 28/69: PSF stamp: add --saturation option for masking the saturated pixels,
Mohammad Akhlaghi <=
- [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, 2022/01/26