Skip to content

Feature request: command-line tool to view binary tables #3022

Closed

Description

@astrofrog

As discussed in this Twitter conversation: https://twitter.com/alexavillaume/status/518096636313346049 - the world would be a better place if we all used binary tables instead of ASCII, but the issue is that ASCII tables are so damn convenient to view quickly. But what if we created a simple command-line script that basically uses Table.read to read in a binary table, then uses Table.more() to display it?

$ table-more mytable.xml
           col1            col2    col3    col4  ... col7  col8 col9 col10
------------------------- ------ ------- ------- ... ---- ----- ---- -----
SSTGLMC G000.0046+01.1431 0.0046  1.1432 265.299 ... 5.04  6.89 5.22     N
SSTGLMC G000.0106-00.7315 0.0106 -0.7314 267.127 ... 6.07    -- 5.17     Y
SSTGLMC G000.0110-01.0237  0.011 -1.0236 267.415 ...  6.3  8.34 6.32     N
SSTGLMC G000.0115-01.2781 0.0115  -1.278 267.666 ... 6.84   8.3 6.87     N
SSTGLMC G000.0127-01.2146 0.0127 -1.2146 267.604 ... 5.53  6.58 5.51     N
SSTGLMC G000.0177-01.8424 0.0177 -1.8423 268.229 ... 8.04  10.1 8.04     N
SSTGLMC G000.0371+01.6473 0.0371  1.6475 264.834 ...  5.2    --  4.7     Y
SSTGLMC G000.0408-00.7197 0.0408 -0.7196 267.134 ...  6.0 10.77 5.99     N
SSTGLMC G000.0540-00.7328  0.054 -0.7327 267.154 ... 6.91  8.09  6.9     N
SSTGLMC G000.0566-00.7363 0.0567 -0.7363 267.159 ...  7.9   9.4 7.83     N
SSTGLMC G000.0570+01.2494 0.0571  1.2495 265.228 ... 8.88 10.37 8.95     N

It could of course take options to specify the table ID/name in multi-table files. Could be pretty handy!

Activity

  1. embray commented on Oct 9, 2014

    @embray
    Member

    👍

    Actually, this is very related to an idea I've had mulling in my head for a long while to build a command-line tool for viewing FITS files--both the header and the data. Basically an extension of fitsheader to also show binary data. There are times where this would be very useful to me (often I just inspect FITS files in a hex editor but that's not always as convenient).

    So I might consider something a little broader than just tables, although tables should certainly play an important part in that.

  2. pllim commented on Oct 9, 2014

    @pllim
    Member

    For FITS table, in IRAF, there are the tprint and tdump commands.

  3. mhvk commented on Oct 9, 2014

    @mhvk
    Contributor

    For FITS more generally, there is HEASOFT's command-line tool fv. It does quite well with tables especially.

  4. saimn commented on Oct 13, 2017

    @saimn
    Contributor

    I was looking for a similar script, an alternative to ESO's dtfits script which is handy to get a quick view on a FITS file or grep a specific line. So I'm starting to write something, should be easy with Table :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions