6.2 2d Data Manipulation


6.2.1 Absolute Value of Data

To take the absolute value of a dataset, first select an Image window containing some data. Then, choose the Absolute Value item from the Wavelets menu. The absolute value will be taken of all data points in the window, and the result plotted either in the current window, or in a new window, depending on the settings in the Settings... dialog of the Edit menu.


6.2.2 Adding Datasets

To add two 2d datasets together, first select an Image window containing some data. Then, choose the Add Datasets... item from the Wavelets menu. You will see the following dialog:

From the pop-up menu, choose the window containing the dataset you wish to add to the current window. It may help to name the windows in your document first, so that you can tell them apart in the pop-up menu. The window you select in the menu will then be added to the current window's data, and the result plotted either in the current window, or in a new window, depending on the settings in the Settings... dialog of the Edit menu.


6.2.3 Subtracting Datasets

To subtract one 2d dataset from another, first select an Image window containing some data. Then, choose the Subtract Datasets... item from the Wavelets menu. You will see the following dialog:

From the pop-up menu, choose the window containing the dataset you wish to subtract from the current window. It may help to name the windows in your document first, so that you can tell them apart in the pop-up menu. The window you select in the menu will then be subtracted from the current window's data, and the result plotted either in the current window, or in a new window, depending on the settings in the Settings... dialog of the Edit menu.


6.2.4 Multiplying Datasets

To multiply two 2d datasets together, first select an Image window containing some data. Then, choose the Multiply Datasets... item from the Wavelets menu. You will see the following dialog:

From the pop-up menu, choose the window containing the dataset you wish to multiply by the current window. It may help to name the windows in your document first, so that you can tell them apart in the pop-up menu. The window you select in the menu will then be multiplied by the current window's data, and the result plotted either in the current window, or in a new window, depending on the settings in the Settings... dialog of the Edit menu.


6.2.5 Dividing Datasets

To divide one 2d dataset by another, first select an Image window containing some data. Then, choose the Divide Datasets... item from the Wavelets menu. You will see the following dialog:

From the pop-up menu, choose the window containing the dataset you wish to divide into the current window. It may help to name the windows in your document first, so that you can tell them apart in the pop-up menu. The window you select in the menu will then be divided into the current window's data, and the result plotted either in the current window, or in a new window, depending on the settings in the Settings... dialog of the Edit menu.

During the divide, division by zero may occur. If so, you will be notified of this in an alert, and the offending point in the data will be set to zero.


6.2.6 Setting Data Length

You can change the number of points in a dataset by choosing the Set Data Length... item of the Edit menu. You will then see the following dialog:

Set the X and Y data points fields to a number greater than or equal to zero. If the number you set is smaller than the current number of X or Y points in the dataset, the dataset will be truncated (or eliminated). If the number you set is larger than the current number of points, the dataset will be expanded, and the new points set based on the settings in the Settings... dialog of the Edit menu.


6.2.7 Extracting Data Subsets

To extract a subset of a dataset, select a window containing data and then choose the Data Subset... item of the Edit menu. You will see the following dialog:

Type in the numbers of the first and last X amd Y points you would like in the subset (i.e. the upper left corner (x0, y0) and lower right corner (x1, y1)). These points will be extracted from the current dataset and displayed in the current window or in a new window depending on the settings in the Settings... dialog of the Edit menu.

Here is an example of a dataset and a subset from points (33,33)-(64,64):


6.2.8 Inserting Data Subsets

To insert one dataset into another, select a window containing data and choose the Insert Data... item from the Edit menu. You will see the following dialog:

Select the window containing the data you wish to insert into the current dataset from the popup menu. It may help you to name your windows first, so you can tell them apart in the menu. Type in the numbers of the X and Y positions at which you wish the first point (upper left corner) of the subset to be inserted in the current data. The data will be inserted at this position, and will overwrite the existing dataset. The resulting data will be displayed in the current window or in a new window depending on the settings in the Settings... dialog of the Edit menu.

Here is an example of inserting the subset extracted from the previous example into the beginning of the original array:


6.2.9 Converting Data from 2d to 1d

To convert a 2d dataset to 1d, select an Image window containing data and then choose the Convert 1d<-->2d item from the Edit menu. You will see the following dialog:

You can convert 2d data to 1d in 4 different ways:

  1. By unraveling the data by rows. This takes the 2d array of data and unwraps it by rows into 1 array of 1d data.
  2. By unraveling the data by columns. This takes the 2d array of data and unwraps it by columns into 1 array of 1d data.
  3. By extracting 1 row of the 2d array.
  4. By extracting 1 column of the 2d array.
A new 1d window will be created for the data.

Here is an exmaple of a 2d array and its 1d conversion by extracting row number 35:


6.2.10 Data Statistics

The Data Stats... item of the Edit menu provides basic statistics about a set of data: maximum value, minimum value, mean, variance, standard deviation, and average squared value. For example, the following dataset:

produces the following statistics:


6.2.11 Clipping Data

The results of other operations (e.g. noise-removal) can be clipped so that data values below zero (e.g.) are all set to zero. To clip data below or above a specific value, select the Clip Data... item from the Edit menu. You will see the following dialog:

Select the above or below button, fill in the clip value, and click OK. The data will then be clipped against the clip value, and all points which fall above/below the clip value will be set to that value.

Here is the result of clipping the previous set of data below 0:


6.2.12 Finding Peaks

The Find Peaks... item of the Edit menu will find the peaks or valleys in a dataset. This function presents the following dialog:

Set the find button to Peaks to find local maxima, or to Valleys to find local minima. Set the peak radius value to the number of neighboring points you wish to be compared to all potential peaks/valleys. Points which are peaks/valleys are set to the peak/valley value, while all other points in the dataset are set to zero.

The find peaks/valleys function is not very sophisticated: it simply looks for points which are greater than all other points within the peak radius, or for points which are smaller than all other points within the peak radius.

The result of finding peaks in the previous dataset looks like the following:

Note that attempting to find peaks in noisy datasets using a small peak radius will probably find many many peaks. Set the peak radius to something greater than 1 in order to reduce the number of peaks found.

You can also sort, truncate, and unsort the result of peak-finding, in order to obtain the locations of the N highest (e.g.) peaks in the data.


Contents | Previous Section | Next Section


MacWavelets 2.00 User's Manual.
"MacWavelets" is a trademark of Intergalactic Reality.
© Copyright Intergalactic Reality, 1996.
All rights reserved.