[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master e24caa6 07/32: astscript-radial-profile: user
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master e24caa6 07/32: astscript-radial-profile: user can now specify output column names |
Date: |
Wed, 24 Feb 2021 22:36:15 -0500 (EST) |
branch: master
commit e24caa62da8330667854c446fe1a2058d9f97e19
Author: Raul Infante-Sainz <infantesainz@gmail.com>
Commit: Raul Infante-Sainz <infantesainz@gmail.com>
astscript-radial-profile: user can now specify output column names
Until this commit, the output column names were `radius', and `op',
where `op' was the operator used for computing the measured values over
the different apertures (`--measure=op'). However, when trying to
operate with the output table (in which the column names were `radius'
and `median'), Table program crashed. My guess is that it was because
the column name `median' was interpreted as the operator `median'. But,
in any case it is good to be able to specify the output column names of
the radial profile table.
With this commit, two parameters (`--iname' or `-i', and `--jname' or
`-j') have been added. They correspond with the output column names for
the radius and measured values, respectively. If the user does not
specify the name of the first column (`-i'), the name will be `radius'.
If the user does not specify the name of the second column (`-j'), the
name will be the operator (`--measure') with the letter `v' at the
beginning. For example, if the operator for computing the measured
values is `--measure=mean', the column name will be `vmean'.
---
bin/script/radial-profile.in | 42 ++++++++++++++++++++++++++++++++++++------
1 file changed, 36 insertions(+), 6 deletions(-)
diff --git a/bin/script/radial-profile.in b/bin/script/radial-profile.in
index 19c3e16..8a9bd08 100644
--- a/bin/script/radial-profile.in
+++ b/bin/script/radial-profile.in
@@ -45,6 +45,8 @@ w=1
k=1
X="1 x"
Y="1 x"
+i="radius"
+j="v"
quiet=0
prefix=./
version=0.11
@@ -100,6 +102,8 @@ $scriptname options:
-c, --ccatalog=STR Configuration file for astmkcatalog.
-X, --xarith=STR Operation for the first column of radial profile.
-Y, --yarith=STR Operation for the second column of the radial
profile.
+ -i, --iname=STR Name for the first column of radial profile.
+ -j, --jname=STR Name for the isecond column of radial profile.
Output:
-k, --keeptemp Keep temporal/auxiliar files.
@@ -233,6 +237,12 @@ do
-Y|--yarith) Y="$2"; check_v "$1" "$Y";
shift;shift;;
-Y=*|--yarith=*) Y="${1#*=}"; check_v "$1" "$Y";
shift;;
-Y*) Y=$(echo "$1" | sed -e's/-Y//'); check_v "$1" "$Y";
shift;;
+ -i|--iname) i="$2"; check_v "$1" "$i";
shift;shift;;
+ -i=*|--iname=*) i="${1#*=}"; check_v "$1" "$i";
shift;;
+ -i*) i=$(echo "$1" | sed -e's/-i//'); check_v "$1" "$i";
shift;;
+ -j|--jname) j="$2"; check_v "$1" "$j";
shift;shift;;
+ -j=*|--jname=*) j="${1#*=}"; check_v "$1" "$j";
shift;;
+ -j*) j=$(echo "$1" | sed -e's/-j//'); check_v "$1" "$j";
shift;;
# Output parameters
-k|--keeptemp) k=0; shift;;
@@ -403,13 +413,33 @@ asttable $fprofile \
# arcsecs with the --X option. The same happen with the measured column
# (--Y). They are strings that will be used in the Table program for operate
# appropiately the different columns. But before this, the necessary
-# metadata information is saved in a temporal file. The metadata consists in
-# the column names (radius and $m), column units (modified), column type
-# (float32), and comment (here it is said how the columns have been
-# modified.
+# metadata information is saved in a temporal file.
+
+# The metadata consists in the column names and comment about the
+# modification by the operation. First column is the radius in pixels, the
+# name of this column is set by the parameter --i (set to radius by
+# default). Second column is the measured values, the name of this column is
+# set by the parameter --j (set to v by default). If the user does not give
+# a name for the second column, the output name will be the combination of
+# the default and the operator used for measuring in the apertures. For
+# example, if the user choose the mean to make the measure (--measure or -m)
+# and do not specify any name for the output column (--jname or -j), the
+# output column name will be: vmean. The reason of adding the character v to
+# the operator is because it may happen that in later step, the user will
+# use the column value with the Table program. If this is the case, the
+# program will crash because it will mix the name of the operator with the
+# name of the column.
+
+# Column names
+xcolname=$i
+ycolname=$j
+if [ z$j = zv ]; then
+ ycolname=$j$m
+fi
+
aprofile=$(echo $output | sed -e"s|.fits|_arith.fits|g")
-echo "# Column 1: radius [modified,f32,] Binned $b and modified with arith $X"
> $aprofile
-echo "# Column 2: $m [modified,f32,] Binned $b and modified with arith $Y" >>
$aprofile
+echo "# Column 1: $xcolname [modified,f32,] Binned $b and arith $X" > $aprofile
+echo "# Column 2: $ycolname [modified,f32,] Binned $b and arith $Y" >>
$aprofile
# Make the appropiate operation over the two columns of the radial profile
# and add it to the temporal file with the meta-data.
- [gnuastro-commits] master dd4f925 06/32: astscript-radial-profile: adding documentation to the GNUASTRO book, (continued)
- [gnuastro-commits] master dd4f925 06/32: astscript-radial-profile: adding documentation to the GNUASTRO book, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 5e84045 04/32: astscript-radial-profile: allowing to manipulate the final profile, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 82f8176 08/32: astscript-radial-profile: adding usage example to GNUASTRO book, Mohammad Akhlaghi, 2021/02/24
- [gnuastro-commits] master 0634f04 14/32: Book: describing remaining options of radial profile script, Mohammad Akhlaghi, 2021/02/24
- [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 <=
- [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, 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