GNU Astronomy Utilities - Tasks: task #15193, Fits program sort many files based...
You are not allowed to post comments on this tracker with your current authentication level.
task #15193: Fits program sort many files based on keyword value
Submitter: | Mohammad Akhlaghi <makhlaghi> | ||
Submitted: | Mon 25 Feb 2019 05:38:52 PM UTC | ||
Should Start On: | Mon 25 Feb 2019 12:00:00 AM UTC | Should be Finished on: | Mon 25 Feb 2019 12:00:00 AM UTC |
Category: | Fits | Priority: | 5 - Normal |
Item Group: | Enhancement | Status: | Postponed |
Privacy: | Public | Assigned to: | None |
Percent Complete: | 0% | Open/Closed: | Open |
Effort: | 0.00 |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
Carbon-Copy List
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 |
---|---|---|---|---|---|
2019-02-25 | makhlaghi | Carbon-Copy | - | Added -email is unavailable- |
Powered by Savane 3.13-d3ae.
Corresponding source code
Currently the Fits program only works on one file. However, in many situations, it can also be useful on many files. For example when we have a collection of FITS files that we would like to sort or select based on the values of a specific keyword.
Implementing such an operation on many files can easily be done with a shell `for' loop for example and the existing Fits program.
However, doing it internally with the FITS program is both faster and much more convenient.
What I currently have in mind is something like the commands below. The first will print the list of input file names, but sorted by the value to the KEYRING keyword. The second will only print the files that have a given `value' to the `KEYNAME' keyword, and the third will only list those files that have a value in the requested range.
Of course, we'll have to check if the value's format is a number, string, or date to define how it is sorted.
One common target for such an operation will be date-related keywords: for example to sort all the files in the given directory by observing date. CFITSIO writes the date in FITS files with its special format (`YYYY-MM-DDThh:mm:ss.ddd'). And fortunately CFITIO has functions to parse this string (in particular `fits_str2time').
Usually this scenario comes up when data come from a single source, therefore they are usually similarly formatted. So, I think the same extension (given to `--hdu') can be assumed in all the files. We have to see if its necessary to allow differing extensions in such contexts.
This task came up after a discussion with Raúl Infante-Sainz.