Shell Utilities
The apps/awkies/ directory contains lightweight Bash/AWK scripts for
quick manipulation of text-based data files. They operate on
whitespace-delimited matrices and are useful for pre- and post-processing
data outside of Python.
getrange.x
Compute per-dimension ranges of a sample matrix.
Given an \(N \times d\) data file, this script prints a \(d \times 2\) range table (min, max per column). An optional cushion fraction expands each range by a specified fraction of its width.
Usage:
getrange.x samples.dat # exact ranges
getrange.x samples.dat 0.05 # 5 % cushion on each side
Arguments:
Argument |
Description |
|---|---|
|
Whitespace-delimited data file (\(N \times d\)). |
|
Optional fraction (default 0) to pad each range symmetrically. |
scale.x
Scale matrix data between a given parameter domain and \([-1, 1]^d\).
Reads an \(N \times d\) data file and a \(d \times 2\) domain
file (one min max row per dimension), then scales each column to
or from the unit hypercube.
Usage:
scale.x input.dat to domain.dat output.dat # [-1,1] -> domain
scale.x input.dat from domain.dat output.dat # domain -> [-1,1]
Arguments:
Argument |
Description |
|---|---|
|
Input data file. |
|
Direction: |
|
Domain file (\(d\) rows, 2 columns: min and max). |
|
Output file for the scaled data. |
transpose.x
Transpose a whitespace-delimited matrix file.
Reads an \(N \times d\) file and writes a \(d \times N\) file to standard output.
Usage:
transpose.x matrix.dat > matrix_T.dat