[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master ad7fb58 26/32: Central coordinates of the crop
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master ad7fb58 26/32: Central coordinates of the cropped image |
Date: |
Wed, 24 Feb 2021 22:36:19 -0500 (EST) |
branch: master
commit ad7fb58e3eb1805f9c0e4009eae45900b987a10f
Author: Zahra Sharbaf <zahra.sharbaf2@gmail.com>
Commit: Zahra Sharbaf <zahra.sharbaf2@gmail.com>
Central coordinates of the cropped image
Until now, to do an efficient process, at the beginning of the script, we
cropped the input image based on the specified coordinates and maximum
radius and then continue the process on the cropped image.
With this commit, the definition of the central coordinates after cropping
the image changed. Whit this change, the script be usable for the star in
the image's border, and in a case which we have the half star to calculate
radial profile.
---
bin/script/radial-profile.in | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/bin/script/radial-profile.in b/bin/script/radial-profile.in
index 210bc72..fef9d8e 100644
--- a/bin/script/radial-profile.in
+++ b/bin/script/radial-profile.in
@@ -413,15 +413,19 @@ if [ z$output = zdefault ]; then
output="$defaultname.fits"; fi
# of that string, and convert to the cropped coordinate system. Note that
# because FITS pixel couting starts from 1, we need to subtract '1'.
crop=$tmpdir/crop.fits
-cropwidth=$(echo $rmax | awk '{print $1*2}')
+cropwidth=$(echo $rmax | awk '{print $1*2+1}')
astcrop $inputs --hdu=$hdu --center=$x,$y --mode=img \
--width=$cropwidth --output=$crop
dxy=$(astfits $crop -h1 \
| grep ICF1PIX \
| sed -e"s/'/ /g" -e's/\:/ /g' -e's/,/ /' \
| awk '{print $3-1, $5-1}')
-x=$(echo "$x $dxy" | awk '{print $1-$2}')
-y=$(echo "$y $dxy" | awk '{print $1-$3}')
+echo "x:$x"
+echo "y:$y"
+echo "cropwidth: $cropwidth"
+echo "dxy: $dxy"
+x=$(echo "$x $cropwidth $dxy" | awk '{if($1>int($2/2)) print $1-$3; else print
int($2/2)+$1-int($1)}')
+y=$(echo "$y $cropwidth $dxy" | awk '{if($1>int($2/2)) print $1-$4; else print
int($2/2)+$1-int($1)}')
@@ -433,6 +437,8 @@ y=$(echo "$y $dxy" | awk '{print $1-$3}')
# The apertures image is genrated using MakeProfiles with the parameters
# previously specified in the ascii file.
apertures=$tmpdir/apertures.fits
+echo "x:$x"
+echo "y:$y"
echo "$rmax $x $y 7 $rmax 1 $p $Q $rmax 1" \
| astmkprof --background=$crop --backhdu=1 --mforflatpix \
--mode=$mode --clearcanvas --type=int16 \
@@ -444,6 +450,7 @@ echo "$rmax $x $y 7 $rmax 1 $p $Q $rmax 1" \
+
# Obtain the radial profile
# -------------------------
#
@@ -616,6 +623,7 @@ fi
# ---------------------
#
# If the user has specified this option, temporal files will be removed.
+k=0
if [ $k = 1 ]; then
rm $crop \
$aprofile \
- [gnuastro-commits] master ebab496 15/32: Book: changed the place of radial profile script documentation, (continued)
- [gnuastro-commits] master ebab496 15/32: Book: changed the place of radial profile script documentation, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 6400ca4 16/32: Some minor correction in description, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 4f3d70d 20/32: Binning data in some case, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master b36c21f 17/32: astscript-radial-profile: modification to use $ instead of c in Table, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master e24caa6 07/32: astscript-radial-profile: user can now specify output column names, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master e1ded16 11/32: Book: minor typos and corrections in radial profile script examples, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 87d68b0 12/32: astscript-radial-profile: removing --rmin option because it is not used, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master aec3057 13/32: Book: describing most important options of radial profile script, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 1b505d1 21/32: Binning the S/N column, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 4294506 32/32: astscript-radial-profile: polished the script and book, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master ad7fb58 26/32: Central coordinates of the cropped image,
Mohammad Akhlaghi <=
- [gnuastro-commits] master d085379 22/32: Radial-profile script documentation, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 8089ea3 27/32: astscript-radial-profile: Samaeh's changes included, conflicts fixed, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 04a8bec 29/32: Book: simplifying documentation of astscript-radial-profile, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 362819c 30/32: astscript-radial-profile: fixed bug when creating the temporal directory, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master c9647b5 31/32: Imported work on the radial profile script, minor conflict fixed, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 1072b2b 02/32: astscript-radial-profile: added the option -b for binning the data, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 87f5383 23/32: astscript-radial-profile: minor corrections of previous commits, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master e41c2e4 24/32: astscript-radial-profile: sigma clip parameters for measurements added, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 337e46d 18/32: The half-light radii, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 2df5a22 19/32: Signal to noise ratio for each radius, Mohammad Akhlaghi, 2021/02/24