The task of calculating and interpreting the correlation functions can be broken down into three logical parts:
Graphical output of results is catered for, and is one of the options controlled by tailinput. The programming behind this is complicated, but was written to ease transport of the programs. To plot a graph, a program creates otoko format files containing the data, and a set of shell scripts. The shell scripts run otoko and force it to plot the data contained in the files just created. The name used for dummy otoko files is O99000.TMP, or something similar. The shell scripts created by the programs are invoked by corfunc, and delete themselves once plotting is over. They use the otoko ".pnt" command that requires the user to click with the middle mouse button to clear the graph - any of the standard plotting commands would leave no delay between plotting the graph and clearing it, when run from a shell script. This may seem an unnecessarily complicated way of producing plots, but it can be used on any system that supports the Xwindows version of otoko, and in general works seemlessly. Note however that should any changes be made to otoko, the programs might not be able to produce graphics. In this case, the graphics option can either be toggled off, or some minor alterations made to the Fortran code to enable the programs to use some other graph plotting program.
Before discussing each of the analysis programs in turn, we will consider the first few inputs made to tailinput. The user is prompted for the name of the directory containing the otoko files to be analysed. This can be any UNIX path name such as /img8/ajr/aug94, or ../jul94, or you can simply press return if the current directory contains your data. The user is the prompted for a file name. All file names should be in the form X??000.!!!, where ?? is a file number and !!! a file extension. Using any other name format will result in error messages like
Software error with subroutine changeotok: fatal...
or
Error in subroutine swapexten: fatal...
at some point in the analysis. Whenever a fatal error occurs all the programs stop. The user is also prompted for a Q axis filename, before tailinput checks all the data. If the file supplied contains realtime data, the user is then prompted for the number of the first frame to be analysed, the last frame to be analysed, and the increment between frames. If the user, when prompted, chooses the absolute intensities option, the programs assume the intensities are in reciprocal centimetres. Using absolute units is recommended, as more information will be available when interpreting the correlation functions. Note that pressing the return key when prompted by tailinput selects the default for that input. Tailinput keeps a record of defaults, speeding up user input. Tailinput is case sensitive!
where B is a Bonart thermal background, K is the Porod constant, and σ describes the electron density profile at the interface between crystalline and amorphous sections.
Sigmoid tail interface width.
The parameter σ is in Angstroms, and is a measure of the width of the distribution that gives rise to the sigmoid electron density profile. Fitting with a sigmoid profile is a non-linear problem, and requires a robust fitting algorithm: a Levenburg-Marquart method5 is used. An initial guess is made at the fit parameters by performing least squares fits to certain graphs and measuring gradients.
The Porod tail profile has the form:
where B is a Bonart thermal background and K is the Porod constant. Using a Porod profile usually gives poor quality correlation functions, and is included for completeness. However, if a Porod profile is used, a greater number of structural parameters can be extracted, including interface surface to volume ratios and the Porod characteristic chord length. Fitting becomes a linear problem, and so can be less problematic than fitting to a sigmoid profile. The parameters K and B are measured from a standard Porod-type plot of I(q) vs. 1 / q4.
Same channel limits on each frame for tailfit [y/n] [y] -->
Choosing limits can be difficult, and some experimentation may be required. As a general rule, the start channel should have a q value about twice that at which any peak occurred in the intensity data. The end channel should be as large as possible, but should avoid any detector noise. More will be said about tail fit channel limits below. Tailfit can also search through a range of start channels to optimise the fit. The user is prompted:
Enter start channel optimisation range (type n for no opt.) [0] -->
Typing "n", pressing return, or entering zero will result in no optimisation. If the user entered, say, a value of five, tailfit would work through the channels from five to the left of the start channel specified by the user, to five channels to the right, searching for the best fit. This option is perhaps best ignored as the optimum starting point is invariably as far as possible to the right of the start channel specified by the user.
Tailinput also prompts the user for a number of iterations. Usually the default value of 100 is fine, but if start channel optimisation is being performed, or if warning messages appear during tail fitting, the number should be increased.
However, several non-fatal errors can occur in tailfit and these should be looked out for. If a single frame is being analysed using a sigmoid profile, you may see a message like:
Warning! positive gradient during estimation of sigma.
This refers to the graph used to gain an initial estimate of s. When this message appears, the initial guess at s will be poor, and this may affect the non-linear fitting. If the same error occurs during fitting to realtime data, no error message will appear. Following this error message, if the fits are poor, the analysis should be performed again with different tail channel limits.
Another message that may occur is:
Warning: ran out of iterations before convergence...
If, for a static image, this gives a poor quality fit, the analysis should be run again with a larger number of iterations specified in tailinput. For realtime data, if the message appears for several frames, again the number of iterations should be increased. The number of iterations required should never be higher than 500: if it is, something is wrong.
The most serious message that can occur is:
Fitting problem: singular alpha matrix...
This will only occur during sigmoid profile fitting. The error message refers to a problem with the Levenburg-Marquart algorithm that isn't properly understood. When this error occurs, the program automatically sets s to zero, and performs a linear least squares fit for the background and Porod constant. Changing fit channel limits or removing frames from realtime data may get around the problem.
For all files: | |
---|---|
Tailinfo.dat | Text file containing fit parameters. |
For realtime data: | |
A01000.BAK | Otoko file containing thermal background vs. frame. |
A01000.POR | Otoko file containing Porod constant vs. frame. |
A01000.SIG | Otoko file containing sigma value vs. frame. |
A01000.FAX | Otoko file containing frame no.s for use as an axis with the files above. |
In particular, watch out for values of s below 1. When realtime data is analysed, s will often be approximately zero for a large proportion of frames. This is an indication that the tail fitting is failing, and that your channel limits could be changed. Moving the start channel towards the beamstop usually increases s, but moving the limit in too far while keeping the end limit at high q will result in very poor fits.
Choosing channel limits is a payoff between using as many points as possible to ensure a good fit, but wanting to keep as many points as possible from your experimental data in the extrapolated data that is passed to the Fourier transform. A noisy tail on the experimental data will result in poor tail fits, possibly making correlation function analysis impossible.
The intensity profile used by the Guinier model has the form:
where B is negative. The Guinier model assumes the small angle scattering arises from particles and the parameter B is related to the radius of gyration of those particles. This obviously has dubious applicability to polymer systems. However, the correlation function is affected by the Guinier back-extrapolation to the greatest extent at large values of R, and so the back-extrapolation only has a small effect on the analysis. The Guinier profile is fitted to the first few genuine scattering points after the beamstop. If your experimental data does not contain an upturn in intensity at low q, back extrapolation may fail. As an alternative to the Guinier profile, a Vonk profile can also be used:
Little work has been performed using the Vonk model.
The channel at which tail fitting started also marks the point at which calculated data takes over from experimental data in the extrapolated data file. This region is smoothed using a Savitzky-Golay5 smoothing algorithm that smoothes the join without greatly altering higher moments of the data. Note that no smoothing is employed for the back-extrapolation as so few points are involved. The join between data sets will give rise to ripples in the correlation functions with a period matching the D-spacing at which the join occurs. These aren't usually visible.
The point in q to which extrapolation is performed affects the correlation functions, particularly if it is too small. The value of q=0.6 used by the programs was decided on after experimentation, and gives smooth correlation functions without loss of speed. The lower the truncation point is, the rougher the correlation functions, while the higher the truncation point is, the slower the transform. A truncation point of q=0.6 corresponds to fluctuations in the correlation functions of about 10 . These are usually not observable.
Enter channel at start of genuine data [73] -->
press return only if the default value is sensible. If tailjoin is not passed a sensible channel number the program will crash.
Guinier back-extrapolation failed!
or
Back-extrapolae channel optimisation has failed: fatal...
indicates problems with the first genuine data point. The user should inspect the intensities near the beamstop before running corfunc again. The fatal error message:
Problem with channel limits...
will only occur if one of the start or end channel limits for the tail fit is very close to the beginning or end of the experimental data. A serious fatal error occurs if the experimental data contains negative intensities close to the point at which the experimental data is joined to the extrapolated tail:
Error: negative intensities in experimental data: fatal...
If this occurs the user should add some arbitrarily large constant to the experimental data using otoko, and re-perform the tail fitting. Tailfit will automatically subtract any constant background added to the data, and no problems will occur in tailjoin. Finally, if the experimental work was performed at very long camera lengths, more than 2048 points may be needed to extrapolate the data to beyond q=0.6. If this occurs a warning message is displayed and the program stops. A re-program would be necessary to get around this problem.
For all data: | |
---|---|
A01000.FUL | Otoko file containing extrapolated intensities. |
X00000.FLX | Otoko file containing extrapolated q values used as a q-axis for the above. |
For realtime data: | |
A01000.RAD | Otoko file containing the Guinier radius of gyration vs. frame no. |
Γ1 and Γ3 are given by:
and
where j (q) is the scattering intensity and Q is the second moment or invariant of j (q) given by:
Hence Γ1(0) = Γ3 (0) = 1. Notice that every point in the extrapolated dataset will be used to calculate each point on the correlation functions, leading to a smooth correlation function. Of course, the integration is numerical and is only performed up to q=0.6 as discussed in the last section. Together with the fluctuations introduced by this truncation, fluctuations are also introduced into the correlation functions by the finite gap between points in the extrapolated dataset - we don't have intensity as a continuous function of q. As a final comment, note that the numerical integration takes the form of a trapezium approximation.
For all data: | |
---|---|
A01000.CF1 | Otoko file containing Γ1 . |
A01000.CF3 | Otoko file containing Γ3 . |
A01000.RAX | Otoko file containing real axis for the files above. |
For realtime data: | |
A01000.MO2 | Otoko file containing the second moment vs. frame number. |
For the re-transform option: | |
A01000.SMO | Otoko file containing re-transformed intensities. Use the original q-axis file as an axis. |
For the ascii output option: | |
A01$$$.ASC | Text file containing correlation functions vs. R for frame $$$ of the dataset. |
The program first decides whether a lamellar interpretation can be applied. It searches for the first local minimum with a negative Γ1 coordinate and the first local maximum with a positive Γ1 coordinate. If these cannot be found, extraction of the lamella structural parameters is abandoned (for that particular frame). If these features are found extraction can be performed, and will employ these two features. Note these criteria very carefully: local minima above the abscissa will be ignored and not used in the calculation of structural parameters. Similarly, local maxima below the abscissa will not be used in the calculation of structural parameters. Indeed, the interpretation of any one dimensional correlation function deviating from the ideal lamellar model is not yet properly understood.
A diagram of the one dimensional correlation function from an ideal lamellar morphology is given above. It consists of a gradually decaying oscillation, with an initial linear section at low values of R. Structural parameters are derived from the positions of the first local minimum and local maximum, and the position and gradient of the linear section.
Parameter | Symbol | Measurement |
---|---|---|
Long period | Lp | As in diagram |
Bulk crystallinity | φ | Γmin / (Γmin + G*) |
Av. hard block thickness | Lc | As in diagram |
Av. soft block thickness | La | Lp - Lc |
Local crystallinity | φl | Lc / Lp |
Average core thickness | D0 | As in diagram |
Average interface thickness | Dtr | As in diagram |
Polydispersity | Γmin / Γmax | |
Electron density contrast | Δρ | Q / φ (1-φ) |
Specific inner surface | 2f / Lc | |
Non-ideality | (Lp - Lp*)2 / Lp2 |
Most of these parameters are given in reference 1. The polydispersity measurement was suggested by Guy Eeckhaut. The problem of determining Dtr and D0 has not been straightforward. Algorithms have been developed with consistency as a priority, so that even if the structural interpretation of these parameters is dubious, the line they specify gives consistent values to the bulk crystallinity, hard block thickness and so on. This has not been an easy task, made harder by the fact that poor tail fits radically alter the appearance of Γ1 at low R. Early algorithms involved polynomial interpolation and algebraic differentiation to determine the first derivative of Γ1 in the region of the linear section. The linear section was then taken to be some region surrounding the point with greatest gradient. However, when low s values arise from tail fitting, Γ1 often has its steepest gradient at very low R in the form of an upturn next to the ordinate. This distracted the derivative-based algorithms away from the genuine linear section.
The present algorithm has been slightly more successful, but still does not work very well. It considers every possible value of Dtr and D0, and for each pair of values constructs a calculated Γ1 profile. This is done by performing a linear least squares fit to the points between Dtr and D0 and then connecting this linear region back to the ordinate and to the first local minimum with a polynomial. The position of the linear section defines these polynomials uniquely, as we know two points on each polynomial, and the gradient at those points. A goodness of fit parameter is then assigned to the calculated profile. The algorithm finds the values of Dtr and D0 that give rise to the best calculated profile.
Once extraction of the lamellar structural parameters is complete, Porod analysis is performed. If the lamellar interpretation of Γ1 failed, a crystallinity provided by the user in tailinput is used to calculate the electron density contrast, otherwise this was given in the lamellar parameter extraction. If a Porod profile was used for tail fitting, a detailed Porod analysis is performed. Those frames for which lamellar interpretation succeeded are analysed using the bulk crystallinity measurement from the lamella interpretation. Those frames for which lamellar interpretation failed are analysed using the user's estimate of crystallinity. The parameters calculated by the Porod analysis are given below.
The calculated profile fitted to Γ1 for extraction of Dtr and D0.
Parameter | Symbol | Measurement |
---|---|---|
Porod const. | K | Performed in tailfit |
Surface to volume ratio | π K φ (1 - φ) / Q | |
Characteristic chord length | lp | 4Q / π K |
Crystalline chord length | lp / (1 - φ) | |
Amorphous chord length | lp / φ |
where Q is the second moment and φ is a crystallinity measurement (either obtained from the correlation function, or user-supplied).
Tailinput also prompts the user:
Do you want user control of extraction process [y/n] [n] -->
This refers to the selection of the linear section of the correlation function. The first time you analyse a dataset you will probably want extract to select the linear section automatically. However, if the measurements of Dtr and D0 made by extract are inconsistent (ie. vary widely within a realtime dataset) you may want to re-run the analysis by supplying values for Dtr and D0 yourself. If user control is selected during tailinput, extract will prompt the user for Dtr and D0 for every frame. A system of defaults makes this a reasonably rapid process. Having performed an analysis with automatic selection of the linear section, you may want to re-perform the extraction process with the user selecting the linear section, but without having to tailfit and transform the data over again. This can be done by editing the file corfunc.dat and changing the line that reads "user" to read "auto". Then run extract directly (ie. not from within corfunc.sh). Corfunc.dat resides in the directory that contains the correlation function analysis programs.
For all datasets: | |
---|---|
A01000.OUT | Text file containing a copy of the information echoed to the screen. |