taskGNU Astronomy Utilities - Tasks: task #13579, Utility for table displaying and...


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

task #13579: Utility for table displaying and manipulation

Submitter:  Mohammad Akhlaghi <makhlaghi>
Submitted:  Mon 20 Apr 2015 12:12:27 PM UTC
Should Start On:  Sun 19 Apr 2015 03:00:00 PM UTC Should be Finished on:  Sun 19 Apr 2015 03:00:00 PM UTC
Category:  New program Priority:  3 - Low
Item Group:  None Status:  Done
Privacy:  Public Assigned to:  makhlaghi
Percent Complete:  100% Open/Closed:  Closed
Effort:  0.00

Wed 24 Aug 2016 10:46:39 PM UTC, comment #2: 

An initial version of the new `Table' utility was made and is now pushed into the main repo. Some simple tests have also been written for it and a section was added to the book, explaining everything with examples.

Operating on binary FITS tables is now as easy as plain text files, just replace `cat' with `asttable'. These examples are taken from the top of the "Invoking Table" section:

## Get the table column information (name, data type, or units)
$ asttable bintab.fits --information

## Only print those columns which have a name starting with "MAG_"
$ asttable bintab.fits --columns=^MAG_

## Only print the 2nd column, and the third column multiplied by 5
$ asttable bintab.fits | awk '@{print $2, 5*$3@}'

## Only print those rows with a value in the 10th column above 100000
$ asttable bintab.fits | awk '$10>10e5 @{print@}'

## Sort the output columns by the third column, save output
$ asttable bintab.fits | sort -k3 > output.txt

## Convert a plain text table to a binary FITS table
$ asttable plaintext.txt --output=inbinary.fits

Before starting to work on adding this new utility, I also made a general TEMPLATE utility. So it will be really easy to add future new utilities (just copy this directory and rename TEMPLATE everywhere in that directory).

Ofcourse table can still use a lot of work to become even better and more robust. But I couldn't put much more time now. I have made a lot of comments in the commit messages.

One thing I am really interested to solve, is to somehow define a good way to ready different types from a plain text table. For example if we can set an internal Gnuastro standard to specify column datatypes, names and units in the comments of a plain text table, then we can read a FITS binary table to a plain text file, do some operations on it and save it back as a binary file easily without the loss of information (like data types). Once we make a robust enough library for this, all the utilities can read and write their inputs and outputs to and from FITS tables if the user wants them too.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Sun 21 Aug 2016 05:29:34 PM UTC, comment #1: 

I am now working on adding this utility. Just a small note: as discussed in task #13551, currently I am working on the premis that it is better for this utility (which has greater control), to display tables and not ConvertType.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Mon 20 Apr 2015 12:12:27 PM UTC, original submission:  

A utility that for table manipulation. Note that converting a table to a plain text file should be done by ConvertType (task #13551).

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 makhlaghi (Submitted the item)

    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.


    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-08-24 makhlaghi StatusIn Progress Done
        Percent Complete10% 100%
        Open/ClosedOpen Closed
    2016-08-21 makhlaghi StatusPostponed In Progress
        Percent Complete0% 10%
        Assigned toNone makhlaghi

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code