- Götz Pfeiffer (HZB)
- wrote the csm library
- Ben Franksen (HZB)
- wrote the cvtRecord

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 3.14.12.2 csm-4.3.tar.gzChanges since R4-24.2 3.14.12.2 csm-4.2.tar.gzChanges since R4-14.1 3.14.12.2 csm-4.1.tar.gzChanges since R4-04.0 3.14.12.2 csm-4.0.tar.gzChanges since R3-63.7 3.14.12.2 csm-3.7.tar.gzChanges since R3-63.6 3.14.8.2 csm-3.6.tar.gzChanges since R3-53.5 3.14.8.2 csm-3.5.tar.gzChanges since R3-43.4 3.14.8.2 csm-3.4.tar.gzChanges since R3-33.3 3.14.8.2 csm-3.3.tar.gzChanges since R3-23.2 3.14.8.2 csm-3.2.tar.gzn/a

For the csm library, have a look at the Doxygen generated API docs,
otherwise see *cvt - The Convert Record*.

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.