next up previous contents index
Next: Polymorphic Flat Database Up: Computational Geometry and Layer Previous: Operations   Contents   Index


Spatial Parameter Tables

(int) ReadSPtable(filename)
This function reads a specification file for a spatial parameter table. A spatial parameter table is a two dimensional array of floating point values, which can be accessed via x-y coordinate pairs. The user can define any number of such tables, each of which is given a unique identifying keyword. Tables remain defined until explicitly destroyed, or until ClearAll is called.

The tables are input through a file, which uses the following format:

keyword X DX NX Y DY NY
X Y value
...

Blank lines and lines that begin with punctuation are ignored. There is one ``header'' line with the following entries:

keyword
Arbitrary word for identification. An existing database with the same identifier will be replaced.
X
Reference coordinate in microns.
DX
Grid spacing in X direction, in microns, must be > 0.
NX
Number of grid cells in X direction, must be > 0.
Y
Reference coordinate in microns.
DY
Grid spacing in Y direction, in microns, must be > 0.
NY
Number of grid cells in Y direction, must be > 0.

The header line is followed by data lines that supply a value to the cells. The X,Y given in microns specifies the cell. A second access to a cell will simply overwrite the data value for that cell. Unwritten cells will have a zero value.

The function returns 1 on success, 0 otherwise with an error message available from the GetError function.

(int) NewSPtable(name, x0, dx, nx, y0, dy, ny)
This will create a new, empty spatial parameter table in memory, replacing any existing table with the same name. The first argument is a string giving a short name for the table. The table origin is at x0, y0 (in microns). The unit cell size is given by dx, dy in microns, and the number of cells along x and y is nx, ny.

The function returns 1 on success, 0 otherwise, with a message available from GetError.

(int) WriteSPtable(name)
This will write the named spatial parameter table to a file. The return value is 1 on success, 0 otherwise, with an error message available from GetError.

(int) ClearSPtable(name)
This will destroy the spatial parameter table whose keyword matches the string given. If a numeric 0 (NULL) or a null string is passed, all spatial parameter tables will be destroyed. The return value is the number of tables destroyed.

(int) FindSPtable(name, array)
This function returns 1 if a spatial parameter table with the given name exists in memory, 0 otherwise. The array is an array of size 6 or larger, or the constant 0. If an array name is passed, and the named table exists, the array is filled in with the following table parameters:

array[0] origin x in microns
array[1] x spacing in microns
array[2] row size
array[3] origin y in microns
array[4] y spacing in microns
array[5] column size

(real) GetSPdata(name, x, y)
This function returns the value from the spatial parameter table keyed by name, at coordinate x,y given in microns. If x,y is out of range, 0 is returned. The function fails (halts execution) if the table can't be found.

(int) SetSPdata(name, x, y, value)
This function will set the data cell corresponding to x,y (in microns) of the named spatial parameter table to the value. The return value is 1 if successful, 0 if x,y is out of range, or some other error occurs. The function fails (halts execution) if the table can't be found.


next up previous contents index
Next: Polymorphic Flat Database Up: Computational Geometry and Layer Previous: Operations   Contents   Index
Stephen R. Whiteley 2024-09-29