gnuastro-devel
[Top][All Lists]
Advanced

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

[gnuastro-devel] [task #15193] Fits program sort many files based on key


From: Mohammad Akhlaghi
Subject: [gnuastro-devel] [task #15193] Fits program sort many files based on keyword value
Date: Mon, 25 Feb 2019 12:38:53 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0

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

                 Summary: Fits program sort many files based on keyword value
                 Project: GNU Astronomy Utilities
            Submitted by: makhlaghi
            Submitted on: 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
        Percent Complete: 0%
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                  Effort: 0.00

    _______________________________________________________

Details:

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. 

++
astfits *.fits --sortby=KEYNAME 
astfits *.fits --onlywith=KEYNAME,value
astfits *.fits --onlyrange=KEYNAME,starting_value,ending_value
--

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
<https://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/c_user/node51.html> 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.




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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