This is the easiest and safest method of obtaining the values. Since the values output are the ones FIT2D actually uses when it is checking the key value.
Q. I installed FIT2D on my workstation / PC, but it did not work ! The operating system is *********
The computer produced the following message:
"segmentation fault (core dumped)"
Could you please help me answer this problem ?
A. I've just checked the FIT2D executable from the aftp server on my workstation / PC; it runs fine. (Occasionally I have made an error in transferring the wrong executable, or transferring in ASCII mode by ftp which corrupts the file). My machine is slightly different from yours, but I don't think that this is the problem.
Can you check that you have transferred the executable file correctly. There should be exactly the same number of bytes in your file as the file on the ftp server. If the file has been accidently transferred in ASCII mode it will have been corrupted and more bytes will be present.
Unfortunately there appears to be a bug in Netscape version 4, which has been reported to lead to corrupted binaries being downloaded. If you have problems with downloading using a web browser, then you'll have to follow the aftp instructions instead. This is not quite as easy, but is not too difficult either, and if followed correctly should almost always work.
If the executable looks O.K. then it would be worth checking the amount of memory available to processes. My code always checks after malloc's, but X-11 code can contain surprizes. Maybe FIT2D is too large to start-up. This is unlikely on a modern system, but it's worth checking.
If you still cannot find an answer to this problem, it will be very difficult for me to offer further help. On other systems of the same type I know about there is no such problem. Maybe you could find somebody to help you examine the core file to try to work more about the problem.
If there is still a problem, it will be worth noting exactly where in the start-up the crash occurs.
If there is no obvious answer to the problem, it is very difficult for me to provide more help in such a case.
Q. How can I avoid having to specify the array sizes every time I use FIT2D ?
A. The program dimensions can be specified on the command line. e.g.
fit2d -dim2048x2560
will set-up FIT2D with program dimensions of 2048 elements by 2560 elements. This avoids the dimension sizes form altogether.
Set this up as an alias, and put it in your start-up files e.g.
alias fit2d 'fit2d -dim2048x2560'
for the "C"-shell or "TC"-shell. Since the options can be repeated, with the last one being used the command
fit2d -dim1024x1024
will still be correct even if the alias is being used.
Q. The only stange thing is that on a machine where my RAM quotum is 128 Mbyte I cannot load a IMAGEQUANT file which is 3544 * 4316 pixels because the following error results:
STATUS: The error was identified in module: IO: Input/Output and Status
STATUS: Position where error condition was identified Subroutine IO_MALLOC V0.1
STATUS: The error condition has been classified as: Bad memory allocation: Memory allocation failed
I checked that with a 1772 * 2158 pixels Imagequant file, fit2d takes 22.6 Mbyte I find this strange because I would then expect it to need 4*22.6=90.4Mbyte which I can allocate on that machine (I verified that).
A. The problem with memory allocation is probably not too strange. FIT2D needs 9 bytes per pixel plus some other general RAM (say 10 Mbytes). (It's possible to input and display data with less, but not to do integration.) Thus your smaller example might need about 34.4 + 10 = ~44 Mbytes. At the time you looked, the system had probably not mapped in all the memory, so the figure is smaller.
For the large image you need about 137.7 + 10 = 148 Mbytes. (Forgive me for mixing million and mega).
This can run on your system as long as the swap file (page file) and the process memory limit are set large enough. With 128 Mbytes RAM paging should not be to bad. You will have to see your system admin. to see what the present limits are and if they can be increased easily.
Q. Do you plane to prepare an fit2d executable for Linux on Macintosh ?
Or Is there an executable for Linux on sparc processors ?
A. No.
The Linux version for x86 PC's is a practical way to make FIT2D available on the latest, fastest, and cheapest processors. It is also a route that has been taken by many others in scientific community so FIT2D can be run along with other useful programs. I am not interested in supporting more and more versions just for the sake of it. Sparc processors are supported with the Solaris version (when in Rome ...). If Linux develops within the scientific community on other hardware, it may need to be supported in the future, but for the present I would recommend avoiding any "unnatural" solutions.
The only hardware which represents any significant advantage over the Intel Pentiums is the Dec/Compaq Alpha, but this is only in raw performance and Intel have been closing the gap very quickly. The Alpha is supported with the Dec-Unix version and again I would not willingly (at present) support a Linux version for Alpha.
(Of course everything can change very quickly in the computing industry. It may well be in a few years time that only WindowNT and Linux are used by the scientific community. FIT2D is already prepared for such changes.)
Q. Does FIT2D crash on Windows 95 and Windows 98 systems ?
A. FIT2D used to crash on these systems, but hopefully the problem is now fixed. The memory management on these systems is poor, but hopefully I've now adapted the graphics so that it does not run out of resources. (On Windows NT systems this was never a problem.) If you find problems still exist with new versions of FIT2D (V10.130 or greater) let me know the details.
On WNT the software product purify has been used to checked that there are no memory leaks, or other problems. This shows the NT version to be fine (in fact one Windows call does loose 4 bytes, but since it only does this once, this is not a worry). The precise source of the W95 problem is not known, but lack of heap usage recovery, or old 16 bit based GDI routines may well be associated. W95 is still historically linked to DOS, which in theory W98 is not. (Doubly annoyingly on W95 and apparently on W98, the error messages output by "C" code do not appear until the end of the program, so the ordering of messages gives little clue as to what has actually happened !)
I tried to use 'binary' format, using 2 byte integers, no byte-swap.
It displays what appears to be a reasonable file, however, it of course
didn't do the log base ten conversion, so the relative intensities are not
very reasonable.
I guess what I need to do is append a header (format?) so I can read it
with the fit2d BAS-2000 option. How do I append a header on a binary file??
A. The Fuji-Bas 2000 scanner (and all BAS
scanners I've seen) use a
two file system. The '.img' file is the binary data as you describe,
and a .inf file which is a pure ASCII header file with information
of the image size and the manner in which to linearise the data.
FIT2D expects to find both (you can click on either when you input
in the GUI). Probably the best is to create your own
.inf files. I'll include an example at the end.
An alternative is to input the raw data using the BINARY
input format and to use
the command FUJI LINEARISATION in the main keyboard menu
to linearise the
data. Since V9.164 the user can enter all the variables in this
linearisation formula.
Unfortunately this sort of problem can also occur when a Macintosh
is used to control the scanner. On the Mac the .inf is
not created
automatically, although the information is stored internally. The
problem arises when the data is to be transferred to another computer
system. The program MacBAS can be used manually to create the
.inf files
but this is a slow and awkward procedure. Alternatively it may be
that a special Mac version of ftp can create the .inf files
(but I haven't seen this working, only been told of the possibility).
Below the line of dashes is an example .inf file.
Note, that the second
line tells FIT2D which .img file to open. The image here is
2048 by 4096 pixels and was scanner with a "sensitivity" of
10000 and a "latitude" of 4 (these numbers are used in the linearisation
formula.)
A. For image arithmetic operations you need
to understand how the
"memory" works. You could of course read "FIT2D: An Introduction
and Overview", but here's a quick summary.
As an example of a typical binary operation on images, the division
of image1.dat by image2.dat will be used. (Exactly the
same logic applies to other binary operation on images.)
The following steps can be used:
The result is left in the current data array, and the image2.dat
data is left in the memory.
Note: The images can be input in the reverse order, but an additional
EXCHANGE command will be necessary, so that the division is in the
correct sense.
The same logic applies to the subtraction of two images. With the image
addition and multiplication the order is not important.
A. Normally the graphics window is re-drawn
whenever the window is uncovered
after being covered by another window. This generally works, but does
not work by default with Silicon Graphics X-servers. (This may also be
a problem with other X-servers, but at present this has not occurred.)
The problem is that Silicon Graphics X-servers do not provide "backing
store" by default. FIT2D requests "backing store" when the graphics
window is created, and this works fine on all other known X-servers.
When "backing store" is enabled it is the window manager which
automatically re-draws the window when it is uncovered.
To make this work for Silicon Graphics X-servers:
The file /usr/lib/X11/xdm/Xservers (which is used when launching
Xsgi ) should NOT contain the option -bs.
(see man Xsgi).
This will also avoid the same problem for IDL and other programs.
Given the cheapness and availability of RAM there is no good reason for
not providing "backing store".
(Dominique Bourgeois, IBS Grenoble can be thanked for investigating and
finding the solution to this annoying problem.)
Q. In the zoom input one can apparently only use
graphical input.
I need, however, the coordinate (pixel) input. This is much more
precise ...
A. The graphical coordinate input includes the
possibility to enter
an exact pixel position, for the reasons given in the question.
Click on the "KEYBOARD" button in the menu on the right of the
graphical coordinate input tool. This then asks for the
"X-COMPONENT OF COORDINATE TO DEFINE" followed by the
"Y-COMPONENT OF COORDINATE TO DEFINE". In the case of zooming-in
this can be repeated for the second corner of the zoom region.
Q. On my Linux system FIT2D refuses to start the
graphics window, saying that the X-server is 16-bit and is not supported.
A. This is correct, presently 8-bit and 24-bit colour
modes are supported. You need to re-start your X-server in 8-bit or 24-bit
colour mode. Exit the X-server and type:
A. Does the detector system suffer from
spatial distortion ?
And has this been corrected ? If "yes" and "no" then such instability
is quite understandable. Other people have reported similar "problems"
which went away after calibration and correction of the spatial
distortion. (Fibre optic taper / CCD detector systems have quite enough
spatial distortion to cause such problems and even some image plate
scanners suffer from considerable spatial distortion.
FIT2D is trying to find points on the powder rings and fit
the positions with ellipses. Ideally all powder rings will
be the same shape ellipses, but spatial distortion if present
and not corrected it will change the shapes so different rings
will have different shapes and the result will be unstable (and
wrong).
If there is no distortion, but the pixels are non-square, and this
is not accounted for, then all things being equal the tilt angles
will be stable, but wrong. Integrated line should be sharp, but the
angles will be wrong.
Note that even with perfect ellipses there are theoretically two
equivalent solutions, with + and - tilt angles and different beam
centres. You can only distinguish between them if you know which is
the right beam centre, which might be possible due to a direct beam
mark, or scatter off the beam-stop. Also note that exactly the same
tilt can appear as a negation with the tilt plane rotation angle
180 degrees different. However, when the rings are integrated the
correct angles are produced even if the "wrong" tilt is used, so
don't worry about this too much.
I want to integrate a series of frames to generate powder patterns.
I get into the powder menu, and would like to set within the integrate
menu the parameters such as conserve intensity, apply polarisation,
etc. Those commands that require numerical input were easy to guess.
I failed with the yes/no type of buttons and also with the 'tilt angle'
and the 'maximum angle'.
A. Probably the best is to let FIT2D create
the macro files even if you
already have a macro file which you want to extend. Use the "START MACRO"
button in the "KEYBOARD" menu or in the "MACROS" interface, to start
"recording" the sequence. Then go through a data analysis sequence,
including setting forms values. The macro text to do this will all
be placed in the macro file. Use the "STOP MACRO" command to close the
file. This may then be edited (with care), and useful proportions can be
copied from one file to another.
For forms input the macro command is the button name.
Normally the logical values are simply toggled in form input, but this
would cause problems for macros, so during macro "recording" and "play-back"
logical values are prompted for a YES or NO response. This should be
clear in a macro file written by FIT2D.
This page has been produced by Andy Hammersley
(E-mail: hammersley@esrf.fr).
It is subject to further modification. If you have helpful suggestions,
please send them to me.
FILE INPUT AND OUTPUT
Q. I am trying to read some files I recorded
at ***** 4 years ago. The files
were read on a Fuji-Bas 2000 scanner. Somehow, fit2d is not able to read
the files with the Fuji-option. I suspect, it expects a file header which
is not present in our files.
------------ snip snip -------------------------------------
BAS_IMAGE_FILE
file_001
20*40
100
100
10
2048
4096
10000
4.0
Fri May 27 19:57:51 1994
833565471
0
Sample details
------------ snip snip -------------------------------------
IMAGE ARITHMETIC
Q. How do I divide one image by another ?
GRAPHICS
Q. On my Silicon Graphics Irix system FIT2D
doesn't rewrite the window
after another window has been covering it.
startx -- -bpp 24
to start the X-server in 24-bit mode. This is recommended if the hardware has
suitable capabilities. Or:
startx -- -bpp 8
to start the X-server in 8-bit mode. This should work on older hardware, but
colour "flash" is likely.
POWDER DIFFRACTION
Q. When I try to fit the detector "TILT"
angles (non-orthogonality
to the direct beam) I get different answers each time I use
different rings or starting points.
MACROS
Q. I'm trying to run some of the menus of the
GUI by macros within a
sequence. Where can I find the appropriate names to use for the various
commands ?