By default, PyXPlot expects datafiles to be in a simple plaintext format which is described in Section 3.8. Input filters provide a mechanism by which datafiles in arbitrary formats can be read into PyXPlot. For each filter, a filename wildcard is supplied, and the filter is then applied to all datafiles whose filenames match this wildcard. For example, by default PyXPlot has five input filters installed, as the show filters command reveals:
set filter "*.fits" "/usr/local/lib/pyxplot/pyxplot_fitshelper" set filter "*.gz" "/bin/gunzip -c" set filter "*.log" "/usr/local/lib/pyxplot/pyxplot_timehelper" set filter "ftp://*" "/usr/bin/wget -O -" set filter "http://*" "/usr/bin/wget -O -"
Each filter takes the form of a program which is launched by PyXPlot whenever a datafile with matching filename is read. The program is passed the filename of the datafile as a command line argument immediately following any arguments specified in the filter’s definition. It is then expected to return the data contained in the file to PyXPlot in plaintext format using its stdout stream. Any errors which such a program returns to stderr are passed to the user as error messages.
The above set of filters allows PyXPlot to read data from gzipped plaintext datafiles, data tables in FITS format, and from datafiles available over the web via HTTP or FTP. Finally, a filter is provided for converting textual dates in log files into numbers representing days, months and years. To add to this list of filters, it is necessary to write a short program or shell script, and the simple filters provided in PyXPlot’s source code for .log and .fits files may provide a useful model.