surfit based on Tcl scripting language, so first of all you must start tclsh. It means that you must have Tcl installed on your computer.
After that you can load libsurfit shared library (or dll) with command:
$ load libsurfit[info sharedlibextension] |
Under Windows this command can be simplified:
$ load libsurfit |
Under Unix you can type
$ load libsurfit.so |
If libsurfit was succesfully loaded into memory, you would see the license text:
|
A common error received by first-time users is the following:
|
This error is generated because the dynamic linker can't locate the libsurfit.so library. When shared libraries are loaded, the system normally only checks a few standard locations such as /usr/lib and /usr/local/lib. To fix this problem, there are several things you can do. First, you can set the LD_LIBRARY_PATH environment variable to include the directory with libsurfit library. If setting LD_LIBRARY_PATH, be aware that setting this variable can introduce a noticeable performance impact on all other applications that you run. To set it only for Tcl, you might want to do this instead:
|
Finally, you can use a command such as ldconfig to add additional search paths to the default system configuration (this requires root access and you will need to read the man pages).
This error is generated because system can't locate the libsurfit.dll library. To fix this probelm you must set the PATH environment variable to the directory with libsurfit.dll:
(Windows 95/98/Me): The search path in Windows is normally specified in the autoexec.bat file, which is typically located in the root directory (c:\). To add the surfit installation directory to your search path do the following from an MS-DOS Prompt Window:
edit c:\autoexec.batPATH C:\DOS;C:\WINDOWS;C:\NETWORK;C:\NAV
;"c:\program files\surfit-2.1\bin"
This assumes that you have installed surfit (libsurfit.dll) in the c:\program files\surfit-2.1\bin directory. If you have installed it in another directory, verify that you have entered an appropriate path. The leading semicolon is only necessary if there is not already a semicolon specified at the end of the "PATH" line. path"c:\program files\surfit-2.1\bin"
To examine data, already loaded use mem_info command.
The pnts_read command reads formatted text files containing interpolation scattered data points coordinates. The text file should organized as a rectangular table of numbers, separated by blanks, with one row per line, and an equal number of elements in each row. For example, outside of surfit, create a text file containing these four lines:
|
Store the file under the name points.txt Then the command
|
reads the file and creates the points dataset. This dataset contains 4 points with X,Y and Z coordinates placed in first, second and third columns. If points.txt consists of only 3 columns:
|
then the command arguments can be truncated:
|
You can get some info about points datasets with following commands:
|
Here you can browse all commands for points.
surfit supports several types of curves:
| curve | 2D piecewise linear curve | |
| area | polygonal region | |
| contour | 3D piecewise linear curve |
The curves reading commands read formatted text files containing coordinates of curve nodes. The text file should organized as a rectangular table of numbers, separated by blanks, with one row per line, and an equal number of elements in each row. For example, outside of surfit, create a text file curve.txt containing these lines:
|
To read curve from file curve.txt use command:
|
surfaces can be loaded from Surfer GRD-ASCII and surfit datafile format. To load surface from Surfer GRD-ASCII file use the command:
|
To load surface from surfit datafile use the command:
|
Here you can browse all commands for surfaces.
surfit uses equdistant grid for gridding procedures. This grid can be described with only 6 parameters:
|
In most cases you can use grid command with only 2 parameters to specify cell sizes:
|
surfit automatically produces grid with cells of specified size. This grid will cover all data objects, loaded into memory.
Gridding methods produce a regularly spaced, rectangular array of Z values from regularly and irregularly spaced XYZ data. The term "irregularly spaced" means that the points follow no particular pattern over the extent of the map, so there are many "holes" where data are missing. Gridding fills in these holes by extrapolating or interpolating Z values at those locations where no data exists.
For each data, loaded into surfit memory you can specify gridding rule, which describes how to use your data in surfit gridding algorithm".
Gridding procedure consists of 4 steps:
After gridding procedure result saves as new surface named with map_name variable value. You can export it to Surfer GRD-ASCII format with command surf_save_grd or to surfit datafile with command surf_save. Also you can save your results into surfit datafile with all other data in memory by command file_save.
The simplest way to visualise your results is to use funner program. This program can be founded here: www.gridding.info. funner accepts both Surfer GRD-ASCII and surfit datafiles.
Funner window screenshot
Also you can select file from command line:
|
surfit: open source gridding and contouring software.