The File menu: loading data into the program

Before using pca_gui, one has to save a stack .stk and $I_{0}$ spectrum (.xas or .csv file) using stack_analyze as described in Sec. 2. One can also write .stk files from other programs as described in Sec. B. The stack is loaded with the Read stack data ``.stk'' file option in the File menu. After the stack file has been loaded, an $I_{0}$ spectrum has to be loaded using the Read I0 file ``.xas'' or ``.csv'' option. Note that the File menu also has an option to load previously saved PCA calculations from .pca files using Read stack and component calculation``.pca''.

If you are dealing with a file for which no $I_0$ normalization is required, you still must specify some sort of $I_0$ file for the program to work (indeed, no other menu options besides File will be visible until you load a .stk and $I_{0}$ .csv or .xas file, or a precalculated .pca file). The program pca_gui expects to read intensity images $I(x,y,E)$ which are then converted to optical density images according to

\begin{displaymath}
D(x,y,E)=-\ln\frac{I(x,y,E)}{I_{0}(E)}
\end{displaymath} (7)

and all subsequent calculations are done on $D(x,y,E)$. Therefore if $D_{\mbox{desired}}$ in fact represents the positive data you want the program to act on, you can ``fake out'' this data normalization process by the following procedure:
  1. Use a text editor to create a simple $I_{0}$ .csv file that consists of two lines:
    $\qquad$ minimum energy, the number 1 $\qquad$ maximum energy, the number 1
  2. Calculate $D_{\mbox{stack}}=\exp[-D_{\mbox{desired}}]$ and save this to the .stk file.
When pca_gui reads in this $D_{\mbox{stack}}$ .stk file and $I_{0}$ .csv file, the data $D$ it will act on is
\begin{displaymath}
D=-\ln\frac{D_{\mbox{stack}}}{1} = -\ln\Bigl(\exp[-D_{\mbox{desired}}]\Bigr)
\end{displaymath} (8)

which will produce the desired effect.

Holger Fleckenstein 2008-07-08