About Data factory

 Top Next

by Wolfgang Theiss

January 2012

W. Theiss – Hard- and Software for Optical Spectroscopy

Dr.-Bernhard-Klein-Str. 110, D-52078 Aachen, Germany

Phone: + 49 241 5661390 Fax: + 49 241 9529100

e-mail: theiss@mtheiss.com

web: www.mtheiss.com

Purpose

Data factory is a utility to create and manipulate data. It was written to support other W.Theiss Hard- and Software products which exchange with Data factory data like optical spectra by easy drag&drop operations.

With Data factory you can

·Compute new data by applying user-defined formulas to existing data

·Use up to three input spectra in your formula

·Draw data with your mouse and use them for your computations

·Reduce the number of data points by averaging

·Smooth curves

·Fourier transform data


Program overview

 Top Previous Next

The main window of Data factory is the following:

The design of the window is simple: You see the data (y-values defined on an equi-distant set of x-values) and various buttons to start data manipulation actions. These are described in detail later.

Also the usage of Data factory is simple: Import a spectrum, do some manipulations, export the spectrum. There are Import and Export menu commands which are followed by the standard Windows dialogs for file selection. However, the exchange of data sets with other products of W.Theiss Hard- and Software is more easily done by Drag&Drop via the button labeled 'D' in the lower left corner of the window.

You can also drag a file from Explorer to the 'D' button: If the file extension is *.std (standard format), *.xy (text file with one x- and one y-column), *.dx (JCAMP format), *.spc (SpectraCalc format) or *.sp (Perkin Elmer format), Data factory will recognize the format and import the data.

Besides the main window there are four subwindows, named 'C1', 'C2', 'C3' and 'C4'. They are displayed if you press one of the buttons on the left side of the main window labeled as 'C1', 'C2', 'C3' or 'C4'. Here is one the subwindows:

In the subwindows C1, C2 and C3 you cannot do anything with the data, except import and export actions. However, you can refer to C1, C2, C3 and C4, respectively, in formulas in the main window. This way you can add, subtract and multiply spectra. The window C4 is used to 'draw' data with your mouse (see below).

Note that the subwindows have 'D' buttons also. You can use these to Drag data from the main window to subwindows, from subwindows to other subwindows, from other programs to subwindows, and so on ...

The graphics features of Data factory are exactly the same as in the other programs of W.Theiss Hard- and Software. Please refer to the description in the corresponding separate help documents.

As usual, you can Save and Open complete program configurations with File submenu commands.


Apply formula

New data are computed based on the user-defined formula Y(X,Y)= ... and the current Range of data.

The symbol Y refers to the current y-values. The formula Y(X,Y)=SQRT(Y), for example, replaces the current data by their square root.

You can also refer to the data of the three subwindows. The formula Y(X,Y)=sqrt(C1) replaces the data of the main window by the square root of the data in subwindow 'C1'.

In the formula editor you can use the following functions:

Function Explanation

abs(...) the absolute value of the argument

sin(...)

cos(...)

tan(...) trigonometric functions (argument in rad)

cot(...)

asin(...)

acos(...) inverse trigonometric functions

atan(...)

sinh(...)

cosh(...) hyperbolic functions

tanh(...)

exp(...) the exponential

ln(...) the natural logarithm

log(...) the logarithm with base 10

sqr(...) the square of the argument

sqrt(...) the square root of the argument

frac(...) returns the fractional part of the argument

int(...) returns the integer part of the argument

step(...) the step or 'heavyside' function

rect(...) the rect function

rnd(...) returns random numbers centered around 0 with amplitude

given by the argument, the values are equally distributed

gauss(...) returns gauss-distributed random numbers centered around 0.

The standard deviation of the distribution is given by the argument.

si(...) sin(...)/(...)

pi 3.14159

Expressions of the form number1^number2 are allowed and return the number2'th power of number1. Of course the usual operators +,-,*,/ and () can be used to combine expressions.


-log(Y)

The data of the main window are replaced by -log(Y). This can be used to convert transmittance spectra to absorbance.


10^(-Y)

The inverse of the -log(Y) action. Used to transform absorbance spectra back to transmission.


1-Y

Replaces the current data by 1-Y.


1-C1-C2

Computes the data of the main window by the difference of 1 and the sum of the C1 and C2 data. This can be used to compute the absorption of radiation in a sample if you have measured transmittance and reflectance. Put the reflectance data into subwindow C1, the transmittance into C2 and get the absorbed fraction into the main window.


Average 3 pts

Replace the data of the main window by a data set with reduced number of data points. Three neighboured data points of the original data are merged to a new point whose value is the average of the three y-values. This action can be used to reduce the number of data points to 1/3.


Smooth 3 pts

Replace the data of the main window by a new data set. Each point of the new data set is the average of the original value of the point and the y-values of the two neighoured points. Applying this action several times leads to a considerable smoothing of the data.


FFT power

Computes the Fourier transform power spectrum of the original data of the main window. This can be used to compute the frequency spectrum of a time domain signal.


FFT pow. C1

The same as FFT power with the difference that the data of subwindow C1 are Fourier-transformed. If you investigate several input spectra this is more convenient: The graphics parameters of the main window and subwindow C1 don't have to be changed and you can watch the original data and their Fourier transformation at the same time on the screen.


'Drawing' data

 Top Previous

Using the subwindow 'C4' you can define the shape of a function by moving points with the mouse. The definition points are connected by a smooth spline curve:

The 'Points' submenu has commands to control the definition points: You can switch to a mode where a mouse click creates a new point, or one which let's you move the points, or a third one which deletes points by mouse click. With the option 'Continuous update' switched on you will have a live update of the curve while you move the definition points.

The values of the current curve of subwindow 'C4' can be entered in the main window's formula using the symbol C4.