funtbl(1)

✨ NAME ✨

funtbl β€” bestie, this little icon extracts a table out of your Funtools ASCII output πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

funtable [-c cols] [-h] [-n table] [-p prog] [-s sep] <iname>

🌸 DESCRIPTION 🌸

okay so first things first, bestie: this program has been DEPRECATED πŸ’€ It got retired in favor of the ASCII text processing support that lives in funtools now. The glow-up version: you can just do fundisp on funtools ASCII output files (and specify the table using bracket notation) to pull out tables and columns. No cap. So yeah, funtbl is giving legacy energy, but we still love her.

The funtbl script extracts a specified table (and btw, it comes without the header and comments, so don't come for her) from a funtools ASCII output file and writes the result straight to standard output. Slay.

🫢 the args, one by one

  • The first non-switch argument is the ASCII input file name β€” i.e. the saved output from funcnts, fundisp, funhist, etc.
  • If no filename is specified at all? She reads stdin. Simple as that. ✨

πŸ‘‘ the switches

  • -n β€” picks which table to extract, and heads up, tables are numbered starting from 1. The default is to extract the first table.
  • -c β€” a space-delimited list of column numbers to output. So like, -c "1 3 5" will extract the first three odd-numbered columns. The default is to extract all columns.
  • -s β€” the separator string that gets put between columns. The default is a single space.
  • -h β€” says "yes please add column names as a header line before the data gets output". Without this switch, no header is prepended. That's it, that's the whole vibe check.
  • -p β€” the program switch, lets you hand her an awk-like program to run instead of the default. And what's the default, you ask? It's host-specific and determined at build time. iykyk. 🧚
  • -T β€” outputs the data in rdb format, meaning a 2-row header of column names and dashes, with data columns separated by tabs. Iconic formatting choice honestly.
  • -help β€” prints out a message describing program usage. Very demure, very mindful. πŸ’…

🌈 example time (this is the fun part)

Say you've got the output from this funcnts command:

[sh] funcnts -sr snr.ev "ann 512 512 0 9 n=3"
# source
#   data file:        /proj/rd/data/snr.ev
#   arcsec/pixel:     8
# background
#   constant value:   0.000000
# column units
#   area:             arcsec**2
#   surf_bri:         cnts/arcsec**2
#   surf_err:         cnts/arcsec**2

# summed background-subtracted results
upto   net_counts     error   background    berror      area  surf_bri  surf_err
---- ------------ --------- ------------ --------- --------- --------- ---------
   1      147.000    12.124        0.000     0.000   1600.00     0.092     0.008
   2      625.000    25.000        0.000     0.000   6976.00     0.090     0.004
   3     1442.000    37.974        0.000     0.000  15936.00     0.090     0.002

# background-subtracted results
 reg   net_counts     error   background    berror      area  surf_bri  surf_err
---- ------------ --------- ------------ --------- --------- --------- ---------
   1      147.000    12.124        0.000     0.000   1600.00     0.092     0.008
   2      478.000    21.863        0.000     0.000   5376.00     0.089     0.004
   3      817.000    28.583        0.000     0.000   8960.00     0.091     0.003

# the following source and background components were used:
source_region(s)
----------------
ann 512 512 0 9 n=3

 reg       counts    pixels      sumcnts    sumpix
---- ------------ --------- ------------ ---------
   1      147.000        25      147.000        25
   2      478.000        84      625.000       109
   3      817.000       140     1442.000       249

So there are four tables in this output. To extract the last one, you can execute:

[sh] funcnts -s snr.ev "ann 512 512 0 9 n=3" βŽͺ funtbl -n 4
1 147.000 25 147.000 25
2 478.000 84 625.000 109
3 817.000 140 1442.000 249

And notice how the output got re-formatted so that only a single space separates each column, with no extraneous header or comment information? Yeah. That's the whole point. Clean. Minimal. Main character energy. ✨


Now say you want only columns 1, 2, and 4 from that last example β€” but with a header prepended and tabs between the columns. You'd run:

[sh] funcnts -s snr.ev "ann 512 512 0 9 n=3" βŽͺ funtbl -c "1 2 4" -h -n 4 -s "\t"
#reg    counts  sumcnts
1       147.000 147.000
2       478.000 625.000
3       817.000 1442.000

And of course, if that output was already saved into a file named foo.out, you get the exact same result by executing:

[sh] funtbl -c "1 2 4" -h -n 4 -s "\t" foo.out
#reg    counts  sumcnts
1       147.000 147.000
2       478.000 625.000
3       817.000 1442.000

Literally the same glow-up, just from a file instead of a pipe. πŸŽ€


πŸ“ SEE ALSO πŸ“

See funtools(7) for a list of Funtools help pages β€” go read the whole family of them, bestie, they're all right there. πŸ“š


k bye ily, this was funtbl(1) from the SAORD Documentation, version 1.4.5, dated April 14, 2011 πŸ’– stay deprecated and stay gorgeous πŸ’…

πŸ“¦ where this page comes from