Convenient small tools for generic use.
- text file column operations
- eps to png conversion
- put eps figures on pages by latex
- integral of sequential data
- comparison of time series data
- gnuplot scripts
Dowload from [HERE].
Take a look at README.txt included in the package.
Contents of this package
Tools provided as Perl scripts
colop: do column operations on a text data file.
usage: colop <mode_specifier> [file] (or reads STDIN)
do column operations on a text data file.
there are several modes:
p <n> : pick n-th column from STDIN and print to STDOUT.
m <N> <n1> <n2>..: pick N columns: n1,n2.. from STDIN and print to STDOUT.
a <file> : append <file> to the right end of STDIN and print to STDOUT.
l <file> : append STDIN to the right end of <file> and print to STDOUT.
s <str> : put a string as an additional column to STDIN and print to STDOUT.
d <n> : delete n-th column of STDIN and print to STDOUT.
cs <N> <n1> <n2>..: print sum of columns to STDOUT.
cp <N> <n1> <n2>..: print product of columns to STDOUT.
cd <n1> <n2>: print <n1>-<n2> to STDOUT.
cf <n1> <n2>: print <n1>/<n2> to STDOUT.
columns are separated by blank(s).
eps2png: convert EPS files into PNG files.
usage: eps2png [-d N] <file> ...
convert EPS file(s) into PNG files with resolution N dpi
-d N : set resolution N dpi (default 240dpi)
(needs installation of ImageMagik)
texeps: make LaTeX source and PS including EPS file(s)
usage: texeps [-w width(in mm) | -h height(in mm)] [-n] [-t ..] <EPS file1> ..
options: -w <width> or -h <height> : specify image size on a page
-n : do not put image file names
-t <title> : put a title string at the head of the first page
-p : make PDF file and erase work dir/files without prompt
-pr <printer> : specify printer to print the result
-f <text_file> : insert the text file at the end
-help : show this message and exit
example: texeps -w 100 file1.eps file2.eps
texeps -w 85 -n file1.eps file2.eps (do not print file name)
-w 110 with 3:2 aspect images makes 3 images/page
-h 80 (with -n or not) also makes 3 images/page
-w 85 (with -n or not) makes 2 images in a line and hopefully
8 images/page
defaults: width=160
(needs installation of TeXLive)
Tools provided by Fortran source files (confirmed with GNU Fortran 9.x) (src/*)
-------
these are compiled like this:
cd src
make
look into Makefile for what it does.
-------
integral: calculate numerical integral of Y in terms of X
usage: integral <Xcol> <Ycol> <Xstart> <Xend> <file> [-o | -O <y0>]
<Xcol> <Ycol>: position of X and Y data columns (1,2..)
<Xstart> <Xend>: start and end of the range of X integrated
<file>: data file name (comment lines by # or empty lines are neglected)
options:
-o : give offset so as to make 0 the starting Y data
-O <y0> : give offset by the value
output goes to stdout
e.g. 1:time, 5:data -> integral 1 5 100 200 data.dat
NOTE: lines begining with # are ignored.
CAPACITY: data line length: 100000
number of data columns: 1000
comptsdata: compare two time series data
usage: compts [opts..] <sample_file> <col_t> <col_x> <ref_file> <col_t> <col_x>
options:
-m <mode> : specify comp time mode
(E: even division of N points (default), R: reference data time, A: arbitrary time
-n <N> : specify number of points for comparison for mode E or A (default 100)
-ts <time_start> : start time for comparison window
-te <time_end> : end time for comparison window
(if times are not given, use the range in sample/ref files
-tc <time_1> .. <time_N> : give N points of time for comparison for mode A
(-tc option should come after -n option)
-fsplt <factor> : sample time unit conversion factor
-fsplx <factor> : sample data unit conversion factor
-freft <factor> : reference time unit conversion factor
-frefx <factor> : reference data unit conversion factor
-tsft <time> : shift ref. data time (after unit conv.)
-v : verbose mode (show sample and reference data)
-h : print this message
output goes to stdout.
Gnuplot scripts (dot.gnuplot.d/*)
Gnuplot seeks scripts in a directory specified by the environmental variable
GNUPLOT_LIB. for example, add the Bash initialization script .bashrc the
following:
export GNUPLOT_LIB=$HOME/.gnuplot.d
and put the scripts dot.gnuplot.d/* into $HOME/.gnuplot.d/
then those script can be called from Gnuplot command line or a script.
ls_lw1, ls_lw2 : set the line styles
fo_* : set "term" and "output" for image file outputs like EPS, EMF or PNG.
a gnuplot script example using them is like this:
call "ls_lw1" # set width 1 line stiles (types,colors,point types)
plot sin(x) w lp ls 5 pn 20, cos(x) w lp ls 7 pn 20 # make a plot
call "fo-png" "test" "png" # output the same thing to test.png
END