taskGNU Astronomy Utilities - Tasks: task #16075, Arithmetic operator to load files...


You are not allowed to post comments on this tracker with your current authentication level.

task #16075: Arithmetic operator to load files from a file

Submitter:  Mohammad Akhlaghi <makhlaghi>
Submitted:  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 Assigned to:  None
Percent Complete:  0% Open/Closed:  Open
Effort:  0.00

Mon 18 Apr 2022 10:14:32 AM UTC, comment #2: 

I'm working on task #16096 currently, so this task is open for someone to take up !

Jash Shah <jash_shah>
Wed 06 Apr 2022 09:05:16 PM UTC, comment #1: 

Hey, Mohammed. I think I can try to implement this feature next after task #16073. It's tougher than the previous task and will help me in getting to know the codebase more while I prepare my proposal for GSoC !
It would be great if you could assign it to me.

Jash Shah <jash_shah>
Fri 12 Nov 2021 01:16:52 AM UTC, original submission:  

Currently, Arithmetic needs its input files to be listed on the command-line within the Reverse polish notation. 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.

Mohammad Akhlaghi <makhlaghi>
Group administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jash_shah (Posted a comment)
  • -email is unavailable- added by makhlaghi (Submitted the item)
  • -email is unavailable- added by makhlaghi

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-11-12 makhlaghi Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code