Subsections


EditNode

The edit node can be used to manipulate data before sending it on into the next node(s) in the module diagram. As of today, it is only possible to execute one command on a single EditNode. See section 4.3.1 for more details.



WARNING: With the current implementation, all the commands below can only handle matrices with numbers or single chars. Text in a matrix will make the operations fail. TECHNICAL: The reason for this, is that the package Numpy/Numeric is used to perform (parts) of the computations. The way we are using the package, does not support such matrices. How ever, the advantage is that the package is very fast.


Available commands

Currently, there are seven commands available (including the passThrough command that does nothing) in the EditNode. As mentioned before, it is as of today only possible to execute one command on a single EditNode. To perform several operations, you must use multiple EditNodes in your module diagram. We will make it possible to execute multiple commands on a single EditNode in a later version of SciCraft. For help on how to execute a command, see section 4.3.2.

In this section, commands are written in italics, arguments to commands are written with enclosing single quotes and mandatory arguments are presented in bold face.

joinMatrices

joinMatrices takes a number of matrices and joins them into one. The matrices given as input must have the same dimensions, except along the join axis. The join axis is specified with the argument `axis'. You can join a $10 \times 50$ matrix with a $10 \times 100$ matrix horizontally (`axis' = 1) and get a $10 \times 150$ matrix, but you cannot join them vertically, as they do not have the same number of columns.

passThrough

passThrough simply passes the data it reveices on unchanged. You want to use this if you want to be able to do picking in a plot and save the new dataset to a file or make use of it in another way in the module diagram.

removeColumns

removeColumns removes the specified columns from a dataset. The first column in the dataset is column number 1.

removeRows

removeRows removes the specified rows from a dataset. The first row in the dataset is row number 1.

subset

subset takes a list or a matrix as input, and returns a subset as specified by the arguments `upperLeft' and `lowerRight'. To understand which values are extracted, think of a rectangle with corners as specified by the coordinates. The coordinates are inclusive; if you specify the element $(2,5)$ as the upper left coordinate, this element will be included in the subset.



NOTE! With lists, it is possible to wrap around. For example, if you have list with 10 elements, you can specify `upperLeft' as 8 and `lowerRight' as 5. You will then get a list with the elements 8, 9, 10, 1, 2, 3, 4 and 5. This will not work with matrices.

transpose

transpose transposes a dataset, i.e. swaps the axis specified. If the argument `axis' is ommitted, the commands flips the order of all axis. If a matrix (rank 2) is supplied, the rows will become columns (and vice versa). If the rank of the dataset is 3 or higher, ie. a cube, you can use the `axis' argument to specify the new axis order. For instance, (1,0,2) would swap axis 0 and 1 of a cubic, but leave axis 2 as it was.



NOTE! transpose is currently only supported for datasets of rank 2 or lower.

vectorsToMatrix

vectorsToMatrix takes a number of vectors and transforms them into a matrix. The vectors must be of equal length, and you must specify which axis the vectors are to be joined along.


Executing commands

To execute a command in the edit node, first double click on the edit node in the module diagram to open the configuration window. A window like the one in figure 4.2 will appear.
Figure 4.2: Editnode configuration.
\begin{figure}\begin{center}
\scalebox{0.625}{\includegraphics{editnode.eps}}\end{center}\end{figure}
In the window shown, there are two main areas you need to interact with to configure the edit node. The first one is the list of tabs and the other one is the content of the tab.

The first thing to do, is to choose what command you want to execute. This is done by selecting the command in the spinbox under the tab ``Commands''. After this is done, you set the parameters that the command need in order to run, unless it does not need any. To do this you select the tab(s) that correspond with the command you selected. For instance, if you want to remove rows from a dataset, you first choose the command ``Remove rows'' in the spinbox under the tab ``Commands''. Then you select the tab ``Remove rows'' and input the row number(s) for the row(s) you want to remove. Note that some commands do not need any parameters, and there will not be any tabs for these.

Please note that if selecting a parameter that needs two input data sets, like ``joinMatrices'', you need to add a second input port, see 2.2.12.



SciCraft Development Team