spec

Software for Diffraction

2.4.6. - Data Handling and Plotting Functions



array_op(cmd, arr [, args ...])
Performs operations on the array based on the following values for cmd:


"fill"
Fills the array arr with values. For a two-dimensional array,
array_op("fill", arr, u, v)
produces for each element
arr[i][j] = u × i +  v × j
With subarrays, i and j refer to the subarray index. Also, i and j always increase, even for reversed subarrays, so
array_op("fill", arr[-1:0][-1:0], 1, 1)
fills arr in reverse order.

"contract"
For args u and v, returns a new array with dimensions contracted by a factor of u in rows and v in columns. Elements of the new array are formed by averaging every u elements of each row with every v elements of each column. If there are leftover rows or columns, they are averaged also.

"min" or "gmin"
Returns the minimum value contained in the array.

"max" or "gmax"
Returns the maximum value contained in the array.

"i_at_min" or "i_at_gmin"
Returns the index number of the minimum value of the array. For a two-dimensional array dimensioned as D[N][M], the index number of element D[i][j] is (i × M) + j. If arr is a subarray, the index is with respect to the full array, although the minimum is the minimum value in the specified subarray.

"i_at_max" or "i_at_gmax"
Returns the index number of the maximum value of the array. See "i_at_min" for subarray considerations.

"row_at_min" or "rmin"
Returns the row number containing the minimum value of the array. If arr is a subarray, the row is with respect to the full array, although the minimum is the minimum value in the specified subarray.

"row_at_max" or "rmax"
Returns the row number containing the maximum value of the array. If arr is a subarray, the row is with respect to the full array, although the maximum is the maximum value in the specified subarray.

"col_at_min" or "cmin"
Returns the column number containing the minimum value of the array. If arr is a subarray, the column is with respect to the full array, although the minimum is the minimum value in the specified subarray.

"col_at_max" or "cmax"
Returns the column number containing the maximum value of the array. If arr is a subarray, the column is with respect to the full array, although the maximum is the maximum value in the specified subarray.

"i_<=_value"
Returns the index number of the nearest element of the array with a value at or less than u. For a two-dimensional array dimensioned as D[N][M], the index number of element D[i][j] is (i × M) + j. Unlike "i_at_min", "i_at_max", etc., if arr is a subarray, the index is with respect to the subarray.

"i_>=_value"
Returns the index number of the nearest element of the array with a value at or greater than u, starting from the last element. For a two-dimensional array dimensioned as D[N][M], the index number of element D[i][j] is (i × M) + j. Unlike "i_at_min", "i_at_max", etc., if arr is a subarray, the index is with respect to the subarray.

"fwhm"
Requires two array arguments, each representing a single row or single column. Returns the full-width in the first array at half the maximum value of the second array.

"cfwhm"
Requires two array arguments, each representing a single row or single column. Returns the center of the full-width in the first array at half the maximum value of the second array.

"uhmx"
Requires two array arguments, each representing a single row or single column. Returns the value in the first array corresponding to half the maximum value in the second array and at a higher index.

"lhmx"
Requires two array arguments, each representing a single row or single column. Returns the value in the first array corresponding to half the maximum value in the second array and at a lower index.

"com"
Requires two array arguments, each representing a single row or single column. Returns the center of mass in the first array with respect to the second array. The value is the sum of the products of each element of the first array and the corresponding element of the second array, divided by the number of points.

"x_at_min"
Requires two array arguments, each representing a single row or single column. Returns the element in the first array that corresponds to the minimum value in the second array.

"x_at_max"
Requires two array arguments, each representing a single row or single column. Returns the element in the first array that corresponds to the maximum value in the second array.

"sum" or "gsum"
Returns the sum of the elements of the array. If there is a third argument greater than zero, the array is considered as a sequence of frames, with the third argument the number of rows in each frame. The return value is a new array with that number of rows and the same number of columns as the original array. Each element of the returned array is the sum of the corresponding elements of each frame. For example, if the original array is dimensioned as data[N][M], the return value for
arr = array_op("sum", data, R)
is a new array of dimension arr[N/R][M], where each element arr[i][j] is the sum of k from 0 to R - 1 of data[i + k × N / R][j].

"sumsq"
Returns the sum of the squares of the elements of the array. If there is a third argument and it is greater than zero, the interpretation is the same as above for "sum", except the elements in the returned array are sums of squares of the elements in the original array.

"transpose"
Returns a new array of the same type with the rows and columns switched.

"updated?"
Returns nonzero if the data in the array has been accessed for writing since the last check, otherwise returns zero.

"rows"
Returns the number of rows in the array.

"cols"
Returns the number of columns in the array.

"row_wise"
With a nonzero third argument, forces the array_dump(), array_fit(), array_pipe(), array_plot() and array_read() functions to treat the array as row-wise, meaning each row corresponds to a data point. With only two arguments, returns nonzero if the array is already set to row-wise mode.

"col_wise"
As above, but sets or indicates the column-wise sense of the array.

"sort"
Returns an ascending sort of the array.

"swap"
Swaps the bytes of the named array. The command can change big-endian short- or long-integer data to little-endian and vice versa. For most built-in data collection, spec automatically swaps bytes as appropriate, but this function is available for other cases that may come up.

"frame_size"
The number of rows in a frame. The frame size is part of the shared array header and may be useful to auxiliary programs, although the value is maintained for non-shared arrays. Note, setting the frame size to zero will clear the "frames" tag. Setting the frame size to a non-zero value will set the "frames" tag.

"latest_frame"
The most recently updated frame. The latest frame is part of the shared array header and may be useful to auxiliary programs, although the value is maintained for non-shared arrays.

"tag"
Shared arrays can be tagged with a type that will be available to other processes accessing the array. Usage is array_op("tag", arr, arg) where arr is the array and arg is "mca", "image", "frames", "scan" or "info".

"untag"
Removes tag information.

"info"
Returns or sets the info field of a shared array segment. The field can be contain up to 512 bytes of arbitrary text. When setting the field, if the string argument is longer than 512 bytes, the first 512 bytes will be copied. The function returns the number of bytes copied, -1 if arr is not a shared array or 0 if arr is a shared array that doesn't support the info field. The info field is included in SHM_VERSION version 6 headers, added in spec release 6.00.08.

"meta"
Returns or sets the meta area of a shared array segment. With spec, the field can contain up to 8,192 bytes of arbitrary text. When setting the field, if the string argument is longer than 8,192 bytes, the first 8,192 bytes will be copied. The function returns the number of bytes copied, -1 if arr is not a shared array or 0 if arr is a shared array that doesn't support the meta field. The meta field is included in SHM_VERSION version 6 headers, added in spec release 6.00.08.


array_dump([file, ] arr [, arr2 ...][, options ...])
Efficiently writes the data in the array arr and optionally arrays arr2, ..., etc. If the initial optional file argument is given, the output is to the named file or device. Otherwise, output is to all "on" output devices, most notably the screen. The additional optional options arguments are strings that control the formatting.

A format argument can specify a printf()-style format for the values. The default format is "%.9g", which prints nine digits of precision using fixed point or exponential format, whichever is more appropriate to the value's magnitude. Recognized format characters are e or E (exponential), f (fixed point), g or G (fixed or exponential based on magnitude), d (decimal integer), u (unsigned integer), o (octal integer), x or X (hexadecimal integer). All formats accept standard options such as precision and field width. For example, "%15.8f" uses fixed-point format with eight digits after the decimal point and a fifteen-character-wide field. For the integer formats, double values will be converted to integers. Also, initial characters can be included in the format string, for example, "0x%08x" is valid.

The option "%D=c", specifies an alternate delimiter character c to replace the default space character delimiter that is placed between each element in a row of output. For example, one might use a comma, a colon or the tab character with "%D=,", "%D=:" or "%D=\t", respectively. Use "%D=" for no delimiter.

Also, by default, the output is one data row per line. Thus, for one-dimensional row-wise arrays, all elements will be printed on one line, while one-dimensional column-wise array will have just one data element per line. For two-dimensional arrays, each line will contain one row of data. The number of elements per line can be controlled with the options "%#[C|W]". For one-dimensional arrays, the number # is the number of elements to print per line. For two-dimensional arrays, # is the number of rows to print per line. If an optional W is added, the number becomes the number of elements to print per line, which can split two-dimensional arrays at different points in the rows. If an optional C is added to the option string, a backslash will be added to each line where a row is split. (The C-PLOT scans.4 user function can properly interpret such "continued" lines for one-dimensional MCA-type array data.)

Finally, the various options can be combined in a single string. For example,
array_dump(data, "%15.4f", "%D=:", "%8W")
and
array_dump(data, "%15.4f%D=:%8W")
work the same.

array_copy(dst, src [, ...])
Fills consecutive bytes in the destination array (or subarray) dst with bytes from the source arrays or strings in the subsequent arguments. The arrays can be of different types, which allows creating a binary data stream of mixed types. If a source argument is not a data array, the string value of the argument is copied.

As an example of how array_copy() might be useful, consider a device that sends and receives a binary stream consisting of four floats followed by two integers then seven more floats. Here is how to prepare a byte array containing the mixed binary data types:
float array float_d[11]
ulong array long_d[2]
ubyte array ubyte_d[52]

# ... assign values to float_d and long_d, then ...

array_copy(ubyte_d, float_d[0:3], long_d, float_d[4:])
sock_put("host", ubyte_d)


Note, the source array is not erased prior to the copy. The above assignment could also be carried out as follows::
array_copy(ubyte_d[0:15,24:], float_d)
array_copy(ubyte_d[16:], long_d)
Four floats consume sixteen bytes. Two integers consume eight bytes. The subarray notation selects the first sixteen bytes of ubyte_d for the first four floats, then skips eight bytes for where the integers will go, then copies the remainder of the floats. Since only as much data will be copied as is contained in the source array and since the source arrays are fixed size, it is not necessary to specify the final byte position in the destinations.

If the returned data uses the same format, floats and integers can be extracted using similar syntax:
sock_get("host", ubyte_d)
array_copy(float_d, ubyte_d[0:15], ubyte_d[24:])
array_copy(long_d, ubyte_d[16:23])
The function will only copy as many bytes as fit into the preallocated space of the destination array.

If the source arguments are not data arrays, spec will take the string value of the argument and copy the ASCII value of each byte to corresponding bytes in the destination. The terminating null byte is not copied. If the argument is a number, the string value of the number is what one would see on the display with the print command.

The function returns the updated array dst. If dst is a subarray, the full array is returned. A -1 is returned if dst is not a data array.

Note, this function allows arbitrary bytes to be copied to the elements of float and double arrays, which can result in undefined or not a number (NaN) values for those elements.

The array_copy() function appeared in spec release 6.00.07.

array_read(file, arr [, options])
Reads data from the ASCII text file file, and stuffs the data into the array arr. For a row-wise array, the values on each line of the file are assigned into successive columns for each row of the array. If there are more items on a line in the file than columns in the array, or if there are more points in the file than rows in the array, the extra values are ignored. For a column-wise array, each row of the data file is assigned to successive columns of the array.

If arr is a string array, successive bytes from each line of the file are assigned to elements of the array (as of spec release 6.04.05).

Lines beginning with the # character are ignored, except for the case where arr is a string array. There is no limit on the length of the input line. Prior to spec release 6.03.05, the maximum length was 2,048 characters.

The only currently recognized option is a "C=#", where # is the starting column number in the file to use when making assignments (as of spec release 6.03.05).

Returns -1 if the file can't be opened, otherwise returns the number of points (bytes in the case of a string array) read and assigned.

array_pipe(program [, args [, arr_out [, arr_in]]]))


array_plot(arr [, arr2 ...]))
Plots the data in the array arr (and optional additional array arguments). Depending on whether arr is a row-wise or column-wise array, the first column or first row elements are used for x. Subsequent elements (up to a maximum of 64) are plotted along the y axis. If preceded by a call of plot_cntl("addpoint") and the ranges have not changed, only the last point in the array is drawn. If preceded by a call of plot_cntl("addline") the current plot will not be erased, and the plot ranges will not be changed. The plotting area is not automatically erased by a call of array_plot() - use plot_cntl("erase") for that. The axis ranges are set using the plot_range() function. See plot_cntl() for other options that affect drawing the plot.

array_fit(pars, arr [, arr2 ...])
Performs a linear fit of the data in the array arr. The fitted parameters are returned in the associative array pars. The function returns the chi-squared value of the fit, if the fit was successful. A -1 is returned if the covariance matrix is singular. The fit algorithm is along the same lines as the lfit() routine in Numerical Recipes (W.H. Press, et al., Cambridge University Press, 1986, page 512).

plot_cntl(cmd)
Selects built-in plotting features. The argument cmd is a string of comma- or space-delimited options. The following options may be preceded by a minus sign to turn the associated feature off, nothing (or an optional plus sign) to turn the feature on or a question mark to return a value of one or a zero that indicates whether the associated feature is currently on or off:


"xlog"
Use a logarithmic x axis.

"ylog"
Use a logarithmic y axis.

"xexact"
Force x-axis minimum and maximum to be set to the scan endpoints (as opposed to being rounded).

"colors"
Enable the use of colors.

"dots"
Draw graphics-mode points with large dots.

"lines"
Connect graphics-mode points with lines.

"ebars"
Draw vertical lines through each point of length equal to the twice the square root of the y value.

"persist"
Keep graphics mode on after ordinary user input.

"perpetual"
Keep graphics mode on continuously (appropriate if using X windows, for example).


Other plot_cntl() options are:


"colors=bgnd:win:text:axis:symb:..."
Assigns colors for drawing the various graphics-mode elements. The values for bgnd (the background color of the area outside the axis), win (the background color of the area inside the axis), text (the color of the text), axis (the color of the axis) and symb ... (the color of the plotting symbols) are integers. The first 10 colors are standardized according to the following table:
 0   background    (normally white or black) 
 1   foreground    (normally black or white) 
 2   blue   3   red 
 4   green   5   yellow 
 6   cyan   7   magenta 
 8   white   9   black 

Other colors may be available depending on the particular device. You don't have to assign values to all colors.

"colors[numb]"
Returns the current color assignments, where numb is a number between zero and 67. Numbers zero through three return the colors assigned to the bgnd, win , text and axis elements respectively. Numbers from 4 through 67 return the colors assigned to the symbols for data elements zero through 63.

"filternumb"
Selects filter number numb, where numb can be any of the numerals from 1 through 5. All plotting commands are directed to this filter. The default filter is filter 1. Each filter is associated with a separate process. On an X windows display, each filter is associated with a separate window.

"title=string"
On an X windows display, the title given by string is used in the XSetWMName() and XSetWMIconName() calls to set the window and icon labels. With most X11 window managers, that means the title will appear in the window's title bar.

"geometry=widthxheight+xoff+yoff"
With the x11 high-resolution plot windows, sets the size and position of the window. As with the conventional X11 syntax for specifying window geometry, not all parts of the geometry string are required.

"open"
Turn on graphics mode. If there is no graphics filter program currently active for the current filter number (see above), the filter program associated with the current GTERM variable is started. Recognized GTERM values are vga, ega, cga, herc, x11, and sun.

"close"
Turn off graphics mode, unless the perpetual or persistent mode has been selected.

"kill"
Turn off graphics mode and terminate graphics process.

"erase"
Clear the graphics-mode screen (or the text screen if graphics mode is off).

"addpoint"
Before a call to data_plot() will cause the plot to be made with minimal redrawing. Used for updated plotting during scans.

"addline"
Before a call to data_plot() will prevent the current data from being erased and the new data from changing the ranges when the new data points are drawn. Used for plotting several data sets from different data groups on top of each other.

"mca"
Before a call to data_plot() will cause the data points to be displayed using a minimal redrawing algorithm, appropriate for displaying data actively being accumulated by an MCA-type device. The "dots" and "ebars" modes must be turned off for the algorithm to work effectively.

"lp"
Before a call to data_plot() will generate printing instructions appropriate for plotting on a 132-column printer.


plot_move(x, y [, string [, color ]])
Moves the current position to column x and row y, where column 0, row 0 is the upper left corner of the screen. If the third argument string is present, it is written as a label at the given position. If using color high-resolution graphics, the fourth argument, if present, is the color to use to draw the label. The background color for the entire label will be the background color at the starting position. If graphics mode is not on, plot_move() works just as tty_move(). Returns true .

plot_range(xmin, xmax, ymin, ymax)
Sets the ranges of the internally generated plots. If any of the arguments is the string "auto", the corresponding range limit is determined automatically from the data at the time the plot is drawn. If any of the arguments is the string "extend", the corresponding range limit is only changed if the current data decrease the minimum or increase the maximum. Returns true .

splot_cntl(cmd)


spec can store data in up to 256 independent data arrays called groups. Each group is configured (see below) to have a particular number of data elements per point. For example, each point in a group could have elements for H, K, L, and detector counts. Alternatively, each point could have just one element and be used to hold data obtained from an MCA.

Groups are configured using the data_grp() function. A group can have up to 2048 elements per point. The maximum number of points in a group is determined by the product of the number of elements per point and the number of points. That product can be no more than 65,536, and may be slightly less depending on how the number of elements divides into 2048. The maximum number of points for all groups is 262,144. (These limits are arbitrary and are set to control the size of static data arrays and auxiliary files. If requested, CSS can make the limits larger.)

When starting spec for the first time or with the -f (fresh) flag, one data group (group 0) is configured for 4096 points, with each point consisting of two elements.

When leaving spec, the current data group configuration and data points are saved.

spec has several functions to manipulate the internal data. These functions allow unary and binary arithmetic operations, math functions and analysis operations to be performed on all the elements of a group or among elements in different groups.

In the functions described below, if an element number is negative, the element number is obtained by adding the number of elements per point in the group to the negative element number. For example, element -1 is the last element, element -2 is the second to last, etc.

All functions reset to command level if an invalid group, point or element is given as an argument. Functions that don't need to return anything in particular return zero.


data_grp(grp, npts, wid)
Configures data group grp. The group will have npts points, each having wid elements. If npts and wid match the previous values for the group, the data in the group is unchanged. Otherwise, the data values of the reconfigured group are set to zero. If wid is zero, the group is eliminated. If npts is zero, as many points as possible are configured. If npts is negative, as many points as possible, but not more than -npts are configured. If grp is -1, the current group configuration is displayed.

data_info(grp, what)
Returns data group configuration information for group grp, according to the the string what. Values for what are:


"npts"
the number of configured points.

"elem"
the number of configured elements.

"last"
the number of the last point added to the group.

"precision"
the number of bytes per element, either 4 or 8.


If the group number is invalid, or if the string what is none of the above, returns -1.

data_get(grp, npt, elem)
Returns the value of element elem of point npt in group grp.

data_put(grp, npt, elem, val)
Assigns the value val to element elem of point npt in group grp.

data_nput(grp, npt, val0 [, val1 ... ])
Assigns values to point npt of group grp. Element 0 is assigned val0, element 1 is assigned val1, etc. Not all elements need be given, although elements are assigned successively, starting at element 0.

data_uop(g_src, e_src, g_dst, e_dst, uop [, val ])
Performs the unary operation specified by the string uop on element e_src for all points in group g_src. The results are put in element e_dst of the corresponding points in group g_dst. The source and destination groups and/or elements may be the same. If the number of points in the groups differ, the operation is carried out on up to the smallest number of points among the groups. Values for uop are:


"clr"
clear to zero.

"fill"
each element is set to point number, starting at 0.

"neg"
Negative of source.

"abs"
Absolute value of source.

"inv"
Inverse of source.

"sin"
Sine of source.

"cos"
Cosine of source.

"tan"
Tangent of source.

"asin"
Arcsine of source.

"acos"
Arccosine of source.

"atan"
Arctangent of source.

"log"
Natural logarithm of source.

"exp"
Exponential of source.

"log10"
Log base 10 of source.

"pow"
The val power of source.

"copy"
Value of source.

"rev"
Reversed copy of source.

"sqrt"
Square root of source.

"set"
All elements set to the value of val.

"contract"
Every val points are averaged to make a new point.

"add"
Source plus val.

"sub"
Source minus val.

"mul"
Source times val.

"div"
Source divided by val.


If any of the operations would result in an exception (divide by zero, log or square root of a negative number, etc), the operation is not performed and a count of the operations skipped is printed as an error message.

data_bop(g0_src, e0_src, g1_src, e1_src, g_dst, e_dst, bop)
Performs the binary operation specified by the string bop on elements e0_src and e1_src for all points in the groups g0_src and g1_src. The results are put in element e_dst for the corresponding points of group g_dst. The source and destination groups and/or elements may be the same. If the number of points in the groups differ, the operation is carried out on up to the smallest number of points among the groups. Values for bop are:


"add"
The sum of the source elements.

"sub"
Source 0 minus source 1.

"mul"
The product of the source elements.

"div"
Source 0 divided by source 1.


If the divide would result in an exception, the operation is not performed and a count of the operations skipped is printed as an error message.

data_anal(grp, start, npts, el_0, el_1, op [, val ])
Performs the operations indicated by op on npts points in group grp, starting at point start. The operations use the values in element el_0 (if applicable) and el_1. If npts is zero, the operations are performed on points from start to the last point added using data_nput() or data_put(). The values for op are:


"min"
Returns the minimum value of el_1. (el_0 is unused.)

"max"
Returns the maximum value of el_1. (el_0 is unused.)

"i_at_min"
Returns the point number of the data point with the minimum value of el_1. (el_0 is unused.)

"i_at_max"
Returns the point number of the data point with the maximum value of el_1. (el_0 is unused.)

"i_<=_value"
Returns the point number of the nearest data point in el_1 at or below val, starting from the first point. (el_0 is unused.)

"i_>=_value"
Returns the point number of the nearest data point in el_1 at or above val, starting at the last point. (el_0 is unused.)

"uhmx"
Returns the value in el_0 corresponding to half the maximum value in el_1 and at a higher index.

"lhmx"
Returns the value in el_0 corresponding to half the maximum value in el_1 and at a lower index.

"sum"
Returns the sum of the values in el_1. (el_0 is unused.)

"fwhm"
Returns the full-width in el_0 at half the maximum value of el_1.

"cfwhm"
Returns the center of the full-width in el_0 at half the maximum value of el_1.

"com"
Returns the center of mass in el_0 with respect to el_1. The value is the sum of the products of each el_0 and el_1 divided by the number of points.

"x_at_min"
Returns the value of el_0 at the minimum in el_1.

"x_at_max"
Returns the value of el_0 at the maximum in el_1.

"sumsq"
Returns the sum of the squares in el_1. (el_0 is unused.)


The following operations treat a data group as a two dimensional data array with rows indexed by the point number and the columns indexed by the element number. The operations work on the portion of the group determined by the starting row start the number of rows npts, the starting column el_0 and the end row el_1. As usual, if npts is zero, all points (rows) from start to the last are considered. A negative element (column) number is added to the group width to obtain the element (column) to use.


"gmin"
Returns the minimum value.

"gmax"
Returns the maximum value.

"gsum"
Returns the sum of all values.

"i_at_gmin"
Returns the index number of the minimum value. The index number is the row number times the group width plus the element number.

"i_at_gmax"
Returns the index number, as defined above, of the maximum value.


data_read(file_name, grp, start, npts)
Reads data from the ASCII file file_name, and stuffs the data into group grp starting at point start, reading up to npts points. If npts is zero, all the points in the file are read. The values on each line of the file are assigned into successive elements for each point in the group. If there are more elements on a line in the file than fit in the group, or if there are more points in the file than in the group, the extra values are ignored. Lines beginning with the # character are ignored. Returns -1 if the file can't be opened, otherwise returns the number of points read.

data_fit(pars, grp, start, npts, el_data, el_data [, ... ])
Performs a linear fit of the data in element el_data to the terms in the elements specified by el_pars. The fitted parameters are returned in the array pars supplied by the user. The function returns the chi-squared value of the fit, if the fit was successful. A -1 is returned if there are insufficient arguments or the covariance matrix is singular. The fit algorithm is along the same lines as the lfit() routine in Numerical Recipes (W.H. Press, et al., Cambridge University Press, 1986, page 512).

data_plot(grp, start, npts, el_0, el_1 [, el_2 ... ])
Plots the current data in group grp starting at point start and plotting npts points. Element el_0 is used for x. Elements given by the subsequent arguments (up to a maximum of 64) are plotted along the y axis. The element arguments can be combined in a single space- or comma-delimited string, which can make creation of macros to plot a variable numbers of curves in the same plot window easier.

If npts is zero, only the points from start to the last point added using data_nput() or data_put() are plotted.

If preceded by a call of plot_cntl("addpoint") and the ranges have not changed, only point start + npts - 1 is drawn. If preceded by a call of plot_cntl("addline") the current plot will not be erased, and the plot ranges will not be changed.

The plotting area is not automatically erased by a call of data_plot()-use plot_cntl("erase") for that. The axis ranges are set using the plot_range() function. See plot_cntl() for other options that affect drawing the plot.

data_dump(grp, start, npts, el_0, [, el_1 ... ] [, fmt1 ] [, fmt2 ])
Efficiently writes elements from group grp to turned on output devices. The starting point is start and the number of points is npts. The elements specified by el_0, e1_1, etc., are printed. If el_0 is the string "all", all the elements for each point are printed. If npts is zero, only the points from start to the last point added using data_nput() or data_put() are printed. The element arguments can be combined in a single space- or comma-delimited string.

The optional argument fmt1 is a string, having the format "%#", that specifies how many data points (specified by the number #) are to be printed on each line. If the number # is followed by the letter C, a backslash is added to each continued line, appropriate for saving MCA data in manageable length lines. New versions (since May 1, 1995) of the C-PLOT scans.4 user function interpret the continued lines correctly for MCA data. The optional argument fmt2 is a string that specifies an alternate printf()-style format for the values. Only e, g and f formats are recognized. For example, "%15.8f" uses fixed-point format with eight digits after the decimal point and a fifteen-character-wide field. The default output format is "%g". See printf() in a C manual for more information. Note that in the default installation, the internal data arrays use single-precision floating values, which contain only about 8 decimal digits of significance.