This module contains two parts: The first is a generic (EPICS-independent) library implementing one- and two-dimensional interpolation tables, including procedures to load and store them from a file system. The second is an EPICS record type specifically designed to make it easy to do conversion via interpolation table and other means. The cvtRecord uses the csm library to achieve conversion via tables.
You can download a release from the links in the table below, or get the latest development version via darcs:
darcs get http://www-csr.bessy.de/control/SoftDist/csm/repo/csm
You can also browse the repository.
Version EPICS Release Filename Release Notes 4.3 220.127.116.11 csm-4.3.tar.gz Changes since R4-2 4.2 18.104.22.168 csm-4.2.tar.gz Changes since R4-1 4.1 22.214.171.124 csm-4.1.tar.gz Changes since R4-0 4.0 126.96.36.199 csm-4.0.tar.gz Changes since R3-6 3.7 188.8.131.52 csm-3.7.tar.gz Changes since R3-6 3.6 184.108.40.206 csm-3.6.tar.gz Changes since R3-5 3.5 220.127.116.11 csm-3.5.tar.gz Changes since R3-4 3.4 18.104.22.168 csm-3.4.tar.gz Changes since R3-3 3.3 22.214.171.124 csm-3.3.tar.gz Changes since R3-2 3.2 126.96.36.199 csm-3.2.tar.gz n/a
There are two kinds of table files accepted by the csm library: one-dimensional and two-dimensional. For both formats the file consists of a number of lines; each line must not be longer than 1023 bytes (including the line terminator(s)) for two-dimensional tables and 127 bytes for one-dimensional tables.
Lines that are empty (i.e. consist only of white space), or start with a ‘#’ byte (possibly preceded by white space) are silently ignored.
All other lines should consist of two or more elements, separated by (any positive amount of) white space (including tabs). Leading and trailing white space is ignored. The number of elements per line must not be greater than 512 for two-dimensional tables, and 2 for on-dimensional tables.
Elements are whatever scanf accepts when given the “%lf” format specifier, i.e. standard C floating point literals.
A one-dimensional table specifies a function of with one parameter. It must have exactly two elements per line. The first element is the X coordinate, the second the Y coordinate. The csm library has functions to convert in both directions (see csm_x and csm_y).
A two-dimensional table specifies a function with two parameters. The first line and the first column specify the XY-grid. The first line must have exactly one element less than the remaining lines; it specifies the Y coordinates of the grid. The first column (i.e. the first elements of the remaining lines) specify the X coordinates of the grid, while the remaining elements specify the value (Z coordinate) at the corresponding point in the grid (see csm_z).
Lines and columns can be specified in any order. Particularly, there is no need to specify them in ascending or descending order. However, for one-dimensional tables, the result is only well-defined if the table actually defines a function in the specified direction. That is, equal input coordinates should map to equal output coordinates. Also, for non-monotonic functions, csm_x is not the inverse of csm_y.
If you have any problems with this module, send a mail to one of the authors.