gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master f4b66f0 2/3: astscript-ds9-region: now properl


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master f4b66f0 2/3: astscript-ds9-region: now properly using --hdu
Date: Thu, 29 Apr 2021 19:46:11 -0400 (EDT)

branch: master
commit f4b66f05a62fce1598f78e998fdb8be4dab04b2f
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    astscript-ds9-region: now properly using --hdu
    
    Until now, even though the '--hdu' option value was being read by this
    script, its value was never used when reading the input FITS file!
    
    With this commit, we now use the '--hdu' option any time that we read the
    input from a file (not stdin).
    
    I also noticed that the short version of the '--help' option in the output
    of '--help' itself was mistakenly written as '-h' (similar to '--hdu')! It
    has been corrected to the proper value ('-?'). Then I had a look at the
    other scripts and noticed this problem existed in all of them! So they are
    all corrected now.
---
 bin/script/ds9-region.in     | 14 ++++++++------
 bin/script/radial-profile.in |  2 +-
 bin/script/sort-by-night.in  |  2 +-
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/bin/script/ds9-region.in b/bin/script/ds9-region.in
index 3c55243..7e6945e 100644
--- a/bin/script/ds9-region.in
+++ b/bin/script/ds9-region.in
@@ -94,7 +94,7 @@ $scriptname options:
       --command="STR"     DS9 command to run after making region.
 
  Operating mode:
-  -h, --help              Print this help list.
+  -?, --help              Print this help list.
       --cite              BibTeX citation for this program.
   -V, --version           Print program version.
 
@@ -302,7 +302,9 @@ if [ x$mode = x"wcs" ]; then unit="\""; else unit=""; fi
 # Write the metadata in the output.
 printf "# Region file format: DS9 version 4.1\n" > $out
 printf "# Created by $scriptname (GNU Astronomy Utilities) $version\n" >> $out
-printf "# Input file: $input (hdu $hdu)\n" >> $out
+if [ x"$input" = x ]; then printf "# Input from stdin\n" >> $out
+else          printf "# Input file: $input (hdu $hdu)\n" >> $out
+fi
 printf "# Columns: $col\n" >> $out
 if [ x"$namecol" != x ]; then
     printf "# Region name (or label) column: $namecol\n" >> $out
@@ -320,13 +322,13 @@ else                        printf "image\n" >> $out;   fi
 if [ x"$namecol" = x ]; then
     if [ x"$input" = x ]; then
         cat /dev/stdin \
-            | asttable $input --column=$col \
+            | asttable --column=$col \
             | while read a b; do \
                   printf "circle(%g,%g,%g%s)\n" \
                          $a $b $radius $unit >> $out; \
               done
     else
-        asttable $input --column=$col \
+        asttable $input --hdu=$hdu --column=$col \
             | while read a b; do \
                   printf "circle(%g,%g,%g%s)\n" \
                          $a $b $radius $unit >> $out; \
@@ -335,13 +337,13 @@ if [ x"$namecol" = x ]; then
 else
     if [ x"$input" = x ]; then
         cat /dev/stdin \
-            | asttable $input --column=$col --column=$namecol \
+            | asttable --column=$col --column=$namecol \
             | while read a b c; do \
                   printf "circle(%g,%g,%g%s) # text={%g}\n" \
                          $a $b $radius $unit $c >> $out; \
               done
     else
-        asttable $input --column=$col --column=$namecol \
+        asttable $input --hdu=$hdu --column=$col --column=$namecol \
             | while read a b c; do \
                   printf "circle(%g,%g,%g%s) # text={%g}\n" \
                          $a $b $radius $unit $c >> $out; \
diff --git a/bin/script/radial-profile.in b/bin/script/radial-profile.in
index a89eb29..e16eb99 100644
--- a/bin/script/radial-profile.in
+++ b/bin/script/radial-profile.in
@@ -100,7 +100,7 @@ $scriptname options:
   -v, --oversample        Oversample for higher resolution radial profile.
 
  Operating mode:
-  -h, --help              Print this help list.
+  -?, --help              Print this help list.
       --cite              BibTeX citation for this program.
   -q, --quiet             Don't print the list.
   -V, --version           Print program version.
diff --git a/bin/script/sort-by-night.in b/bin/script/sort-by-night.in
index 5e8cade..37f82c6 100644
--- a/bin/script/sort-by-night.in
+++ b/bin/script/sort-by-night.in
@@ -94,7 +94,7 @@ $scriptname options:
   -p, --prefix=STR        Prefix for outputs of '--copy' and '--link'.
 
  Operating mode:
-  -h, --help              Print this help list.
+  -?, --help              Print this help list.
       --cite              BibTeX citation for this program.
   -q, --quiet             Don't print the list.
   -V, --version           Print program version.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]