gnuastro-devel
[Top][All Lists]
Advanced

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

[task #16075] Arithmetic operator to load files from a file


From: Mohammad Akhlaghi
Subject: [task #16075] Arithmetic operator to load files from a file
Date: Thu, 11 Nov 2021 20:16:53 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0

URL:
  <https://savannah.gnu.org/task/?16075>

                 Summary: Arithmetic operator to load files from a file
                 Project: GNU Astronomy Utilities
            Submitted by: makhlaghi
            Submitted on: Fri 12 Nov 2021 01:16:52 AM UTC
         Should Start On: Fri 12 Nov 2021 12:00:00 AM UTC
   Should be Finished on: Fri 12 Nov 2021 12:00:00 AM UTC
                Category: Arithmetic
                Priority: 5 - Normal
              Item Group: Enhancement
                  Status: None
                 Privacy: Public
        Percent Complete: 0%
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                  Effort: 0.00

    _______________________________________________________

Details:

Currently, Arithmetic needs its input files to be listed on the command-line
within the Reverse polish notation
<https://www.gnu.org/software/gnuastro/manual/html_node/Reverse-polish-notation.html>.
This is easy to use when the number of files is limited.

However, when there are hundreds/thousands of files to stack (for example with
the 'sigclip-mean'), it can become inconvenient. Especially when the full path
of each file needs to be mentioned. In some cases, this can even exceed the
maximum allowed space for a command (which you can check with 'getconf
ARG_MAX', on GNU Bash, its 2097152 bytes).

Of course, users can easily define shell hacks (like using shell variables
within a loop), but it is more convenient if a list of files (with the number
of files) can be loaded directly.

On the other hand, all the operators that take many inputs, first need to
"pop" the number of inputs, then start loading them.

So to simplify the process, we can have a new operator in Arithmetic that will
load a plain-text file (with file-names inside of it: one file per line),
count how many non-commented lines there are, and then load all the images (in
the given order) onto Arithmetic's Reverse-polish stack. And on top of the
stack, it will place the total number of files. 

For example if someone wants to stack all the FITS images in 'images.txt' by
using the sigma-clipped mean of each pixel, they can simply use the command
below (assuming the operator is called 'loadlist'):


astarithmetic images.txt loadlist 5 0.2 sigclip-mean


This task was suggested by Jesús Varela.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/task/?16075>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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