[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 1b505d1 21/32: Binning the S/N column
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 1b505d1 21/32: Binning the S/N column |
Date: |
Wed, 24 Feb 2021 22:36:18 -0500 (EST) |
branch: master
commit 1b505d162368d80e81d96ce10681ab06d8c7b8fa
Author: Zahra Sharbaf <zahra.sharbaf2@gmail.com>
Commit: Zahra Sharbaf <zahra.sharbaf2@gmail.com>
Binning the S/N column
With this commit, the way to do binning the column with S/N data has been
changed.
---
bin/script/radial-profile.in | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/bin/script/radial-profile.in b/bin/script/radial-profile.in
index b192ecc..e243369 100644
--- a/bin/script/radial-profile.in
+++ b/bin/script/radial-profile.in
@@ -401,15 +401,26 @@ astmkcatalog $aperturesfits -h1 --valuesfile=$inputs
--valueshdu=$hdu \
# is possible to bin the data. It is done in any case, if the user set the
# default value of binning variable($b) except 1, because the binning will
# be equal to 1 so the output binned will be the same as the input. To do
-# the binning of the data, a small Awk script is used. Since the Awk script
-# will print the columns as float values, it is necessary to change the
-# headers. To do that, Sed is used to replace all ocurrences of i32 to f32.
+# the binning of the data, a small Awk script is used.Because of the
+# behavior of signal to noise ratio isn't linear. We used the different
+# way to do binning the S/N column. Since the Awk script will print the
+# columns as float values, it is necessary to change the headers. To do
+# that, Sed is used to replace all ocurrences of i32 to f32.
bprofile=$(echo $output | sed -e"s|.fits|_binned.fits|g")
if [ $b != 1 ]; then
asttable $fprofile \
| awk -v b=$b '/^#/{print} BEGIN { N = b }
{ for (i = 1; i <= 2; i++) sum[i] += $i}
{ for (i = 3; i == 3; i++) sum[i] += $i ** 2}
+ {if (i != 3)
+ {
+ N = b
+ }
+ else
+ {
+ N = b ** 0.5
+ }
+ }
NR % N == 0 { for (i = 1; i <= NF; i++)
{
printf("%.6f%s",sum[i]/N, ( i == NF) ? "\n" : " ")
@@ -480,7 +491,7 @@ cat $aprofile | asttable -o$output
#
# The half-light or 'effective' radius as the radius within which half of
# the object's luminosity is contained.
-halfoflight=$(asttable $output | awk '{if(max<$2){max=$2}}END{print max/2}')
+halfoflight=$(asttable $output | awk 'NR>=3{if(max<$2){max=$2}}END{print
max/2}')
radius=$(asttable $output \
| awk '{if('$(echo $halfoflight)'<=$2){line=$1;light=$2}}END{print
line}')
echo "Half-Light-Radii: $radius pixels from the center of the object"
- [gnuastro-commits] master 2f2970f 09/32: Adding Vim .swp temporal files to .gitignore, (continued)
- [gnuastro-commits] master 2f2970f 09/32: Adding Vim .swp temporal files to .gitignore, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 3fcd49a 10/32: astscript-radial-profile: setting name and version from the compilation, Mohammad Akhlaghi, 2021/02/24
- [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 <=
- [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, 2021/02/24
- [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