copyright 1987-1997 andy hammersley / esrf use of fit2d ... · supp ort for exceed and lan w...

306
Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D implies acceptance of the " Conditions of Use " (Click on "CONDITIONS") V10.3 HELP DON’T ACCEPT CONDITIONS I ACCEPT

Upload: others

Post on 02-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

EUROPEAN SYNCHROTRONRADIATION FACILITY

INSTALLATION EUROPEENE DE RAYONNEMENT SYNCHROTRON

uuu

u

uuu

u

u

uu

s s sssssss

ssssssssssss s

r rrrr

r

r

rr

rrrr

rr

r

r

r

rrr

rq q

qq

q

q

q

q

qq

qqqq

q

q

q

q

q

qq

q

FIT�D V���� Reference Manual V��� ESRF��HA��T

Copyright A P Hammersley�ESRF ���������Email� hammersley�esrf�fr

August � ����

Use of FIT�D implies acceptance of the �Conditions of Use� �see Page �����

Copyright 1987-1997 Andy Hammersley / ESRF

Use of FIT2D implies acceptance of

the " Conditions of Use "

(Click on "CONDITIONS")

V10.3

HELP

DON’T ACCEPT

CONDITIONS

I ACCEPT

Abstract

This manual describes use of FIT�D� a ��D data analysis program� specialising inmodel �tting� FIT�D is a program which allows di�cult data analysis problems to betackled using ��D dimensional �tting of user speci�ed models� To enable model �ttingto be performed on a wide variety of input data� many other more basic data analysisoperations are also available� Calibration and correction of detector distortion has becomean important part of FIT�D� FIT�D is still under development� but already a widerange of basic data analysis operations and a number of more sophisticated methods areavailable� Normal graphics display methods are available�

Page 2: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

INTENDED AUDIENCE� This document is intended for scientists and engineers who intend to use FIT�D for basic data analysis data visualisation or data format conversion� Thismanual is intended for reference and most users should not need to read more than small sectionsof the manual� The index should be of use in �nding information on speci�c subjects and usersare recommended to use the index extensively� The manual contains many crossreferences souseful interrelating sections should be easy to �nd� �If you have helpful suggestions for furtherindex entries or crossreferences please contact me�� For newcomers to FIT�D the user guide�FIT�D� An Introduction and Overview� is recommended as a starting point�

MAJOR VERSION CHANGES� The following major changes have occurred which aresignalled through the change in the major version number�

At Version ��� WindowsNT and Windows � support is available� This is still a testingstage but gradually FIT�D will become available on Windows based systems as well as Unixsystems�

The �symbol� system was replaced by the �variable� system� The �variable� system allows internal program variables to be de�ned from the commandline or within FIT�D and used withinmacros to allow attempts like �le names to be automatically varied� The �variable� system isvery similar to the previous �symbol� system but variables have the concept of type i�e� a variable may be an integer value a logical �boolean� state value a �oating point real value or a character string value� The commands DEFINE SYMBOL� SYMBOL� LIST SYMBOLS and UN�DEFINE

SYMBOL have been replaced by the commands DEFINE VARIABLE� VARIABLE� LIST VARIABLES

and UN�DEFINE VARIABLE� The DEFINE VARIABLE � VARIABLE command now prompts for thetype of variable to be de�ned� �The SYMBOL command is now an alias for the DEFINE VARIABLE

command��

At Version �� all NAG code was removed from FIT�D so that no NAG licence �or othercommercial licence� is necessary to run FIT�D� This mainly a�ected the �tting code andassociated options�

At Version �� the �Graphics User Interface� �GUI� became the default interface to FIT�D��The command line ��Keyboard�� interface can still be used directly as the default interfaceby entering the option �key or �keyboard on the command line when starting FIT�D��

NEW FEATURES� The following major changes and new features have been added sinceVersion ����� �as well as many minor ones��

� Graphics Display

� �Feature� which made �twoclick� mode input unusable corrected �V��������

� Support for X�� displays with ��bit �TrueColor� colour mapping �V�������

� Allow PostScript output of images to rebin by di�ering factors in each direction�V�������

�In fact the numerical overlay was being written on top of the spy�glass image� This was in a way intended�so I term a �feature�� but nevertheless made the function unusable so many may well regard this as a bug� Stillnow it�s �xed�

Page 3: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� Support for �eXceed� and �LANWorkplace Pro� PC Xservers in ��bit plane �TrueColor� setup �V�������

� Redraw graphics when an �Expose� event occurs with ��bit �TrueColor� and reverseRGB coding� This attempts to work around a bug in the Xserver with �LANWorkplace Pro� in ��bit mode� The Xserver wipes out all graphics whenever anexpose event occurs � �V������

� CURVE STYLES control option added within OPTIONS submenu �V�������

� DISTANCE command added to DISPLAY submenu to calculate the distancebetween two coordinates �V��� ���

� Output all graphically input coordinates to the terminal window �V��� ���

� Masked out coordinates no longer accidently drawn on �D graphs� �This was thecause of red crosses being incorrectly drawn�� �V��� ���

� Reset linear axis scaling after log X�Y graph �previously this caused a problem withsubsequent �D axis drawing� and put masked points in correct place on Log scales�V��� ���

� Graphical value input now has a graphical OK button to accept the current value�V��� ���

� Work around problem with Silicon Graphics IRIX �� Indigo workstation screensreporting that they have �bit plane depth default �visuals� �V�������

� Correction to graphical coordinate input so that TWO CLICK mode input isdisabled for X�Y graph coordinate input �previously hung program� �V�������

� Change Windows image display to use much more e�cient �CreateDIBSection� routine �V�������

� Fitting and Graphical MASKING Menu

� New scaling method used in �tting resulting in much faster �tting and much betterconvergence �V�������

� POWDER DIFFRACTION Menu

� Change array index order for �theta and azimuthal directions in �CAKE� and�INTEGRATE� commands� The �theta output scan is now in the Xdirectionwhich is the natural order for �tting with the MFIT interface �V�������

� Handle CANCEL button requests properly in the INPUT and CORRECTIONcommands forms �V�������

� Correct problem with �D Gaussian beam centre sometimes being returned out bya large factor �V�������

� Always output Dspacings when the user clicks on the image �even if distance wavelength have not been explicitly set� �V��� ���

� Tilt angles saved between calls to FIT�D �V��� ���

� Correct CAKE integration so that the region is correctly integrated when the datahas an o�set axis start �V�������

Page 4: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� IMAGE PROCESSING GUI Menu

� EXTEND command added to the GEOMETRIC submenu to allow the size ofthe de�ned data region to be easily increased �V�������

� ONLINE CRYSTALLOGRAPHY Menu

� Output Dspacings for peak search and use centroiding to improve peak centres�V�������

� SAXS�GISAXS GUI Menu

� Option of �D projected scan output for grazing incidence small angle scattering�V�������

� Add SUMMATION option and option to correct intensities for �at plate geometryin PROJECTION command �V��� ���

� Take account of detector tilt angle in PROJECTION command �V��� ���

� Tilt angles saved between calls to FIT�D �V��� ���

� �D TRANSFORMS command added to allow the I�q� versus q scans to betransformed to �Log� I�q���a � q��b versus �Log� q��c scans �V��� ���

� Draw projection region in correct place for o�set images �V��� ���

� Option of FIT �D PROJECTION in BEAM CENTRE command to allow thesymmetry of �D pro�le to be used to de�ne a beam centre �V��� ���

� FILE SERIES GUI Menu

� INTEGRATE command added allowing automatic integration of a whole seriesof �les �V�������

� AVERAGE� COMPOSITE� and INTEGRATE commands within the �FILESERIES� interface now generate �le names in the same manner as theMACROS�LOGFILE interface RUN SEQUENCE command �V�������

� Option to output �D integrated scan �les in the INTEGRATE command �V�������

� Correction to INTEGRATE command� Previously the intensity tended to fallhigh angles owing to the spatial correction only being performed on the zoomed inregion �V�������

� First correct input image of INTEGRATE command prior to display for maskingand ROI selection �V�������

� Will now work for �TIFF� and �IMAGEQUANT� formats without asking for theinput rebinning form �V�������

� KEYBOARD Interface menu

� Option to input �PDS� format �V���� ��

� Add more predictors to PREDICTOR command �V��� ���

� Update FUJI LINEARISATION command so that full user control is given to parameters of linearisation formula �V�������

Page 5: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� Change name of commands DEFINE SYMBOL LIST SYMBOLS etc� to DEFINE VARIABLESLIST VARIABLES etc� �V������

� File Input and Output

� Cure problem with �PRINCETON INSTRUMENTS� format input �and potentiallyothers� when the image is larger than the current data array �V�������

� Support input of �byte integers Princeton Instruments format �V�������

� Support input of �byte reals with Princeton Instruments format �V���� ��

� Improve support for Fuji BAS���� scanners� Now a variety of possible �les will betried for the binary data and if they are not found the user will be prompted forthe �le to use� The linearisation is now performed using a LUT so should be muchfaster �V�������

� Correct �le selection call for the �FIT�D� format option for an output �le �previouslywas for an input �le� �V��� ���

� Set title based on input �le name for ��D GAS� format input using the GUI�V��� ���

� Correct GUI selection of output �les for �CBF� �CHIPLOT� �TIFF� and �HUFFMAN� formats and for output of detector distortion correction table �le �previouslythe �le selection tool was looking for an input �le� �V�������

� Byte swap input of ESRF format Real�� data if necessary �V�������

� CHIPLOT input now gives error message if there is a problem opening a �le �V�������

� Convert �CHIPLOT� input to new I�O system calls so that a �le with only �read�permission can be input on Linux machines �the Absoft Fortran compiler requiresread�write permission unless nonstandard keywords are used� �V�������

� Convert �FUJI� and �BINARY� format and spatial distortion function �le input tonew I�O system calls so that a �le with only �read� permission can be input on Linuxmachines �V�������

� Convert �BSL� format �le input to new I�O system calls so that a �le with only�read� permission can be input on Linux machines �V�������

� Correct error introduced in V����� which meant that �TIFF� �le �XResolution� and�YResolution� tags were not correctly de�ned �V�������

� Add support for the �Klora� �le format in the GUI input routine �V�������

� �TIFF� output inverted so now is the correct way up for the TIFF standard�V�������

� Detector Distortion Calibration and Correction

� BiSpline and image plate spatial distortion correction made about ��� faster �V�������

� Macros

� The RUN SEQUENCE command in the GUI take account of any unchangingpart of the �le name prior to any extension �V�������

� Other�

Page 6: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� Help texts now gives references to web pages �V�������

� Store symbol data type within internal symbol database �now the variables database��V���� ��

� Allow evaluation of arithmetic expressions within command menus �V�������

� Replacement of all �SYMBOL� routines with �VARIABLE� routines so now all internal variables have a type and are stored in integer logical �oating point orcharacter string form �V������

� Commandline option �gdoc� added to allow control of the option of saving menusand forms to PostScript �les� �This is to help produce documentation�� �V������

FURTHER DEVELOPMENT� FIT�D is presently under development andmany new features are likely to be added in the future� If users have particularrequirements which �t within the general framework that FIT�D provides I willbe happy to try to include new features to ful�l their needs�

Page 7: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

When all else fails ��� Read the documentation �anonymous�

Documentation is like sex� even when it�s bad� it�s better than nothing �anony�mous� Internet�

These two quotations are more or less consistent with the authors� view ondocumentation� I do not like to have to read documentation but it is necessaryand at times indispensable� Most of this reference manual should not be read � It isa reference manual and as such apart from some general considerations which aregiven in the �rst few sections the remainder of the manual can be considered forreference only�

FIT�D should be very largely selfdocumenting� All graphical menus and formscontain a button and�or a HELP button� Clicking the button will producea list of the available commands and a short oneline explanation of the command�TheHELP button will produce interactively scrolled help text describing the wholemenu or form and the options and choices that are available� Within the keyboardinterface you can obtain an explanation of the required input for every prompt byentering a question mark ���� The �HELP� option is also available within manymenus�

Nevertheless the Reference Manual exists and I feel it can be useful� If youwant to perform an operation but do not know the name of the command there isa large index to help you� If you want to know precise details on the workings ofa command the reference manual contains extra information and cites articles andbooks containing more information�

Page 8: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

Contents

� Prerequisites ��

� Running FIT�D ����� FIT�D Executable Directory � � � � � � � � � � � � � � � � � � � � � � � � � � � � ����� Startup of FIT�D � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��

����� Graphics User Interface �GUI� StartUp � � � � � � � � � � � � � � � � � � ������� �Keyboard� Interface StartUp � � � � � � � � � � � � � � � � � � � � � � � ��

��� FIT�D Old and New Versions � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��

� Important Principles And Common Features ����� Dynamic Memory Allocation � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ����� The �MEMORY� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ����� �Active Data Region� �ADR� � �Region of Interest� �ROI� � � � � � � � � � � � � � ��� The Graphics Window � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� False Colour Image Display � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��� Information Warnings and Error Messages � � � � � � � � � � � � � � � � � � � � ��

� Graphics User Interface� Introduction And General Use ����� Graphics User Interface Colour Coding � � � � � � � � � � � � � � � � � � � � � � � ����� Parameter Value Input � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��

����� Integer Real Value and Character String Input � � � � � � � � � � � � � � ������� Boolean Value Input � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Graphical Menu Choices � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Graphical Coordinate Input � � � � � � � � � � � � � � � � � � � � � � � � � ��

��� Graphical forms � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��� File Selection and input � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �

� Common GUI Commands and SubMenus �� �� The GUI INPUT Command � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� �� The GUI EXCHANGE Command � � � � � � � � � � � � � � � � � � � � � � � � � �� �� The GUI Z SCALING Command � � � � � � � � � � � � � � � � � � � � � � � � � �� �� The GUI DISPLAY Command � � � � � � � � � � � � � � � � � � � � � � � � � � � �

���� The �D SURFACE SubMenu � � � � � � � � � � � � � � � � � � � � � � � � �� � The GUI OPTIONS Command � � � � � � � � � � � � � � � � � � � � � � � � � � �� �� The GUI MOVEMENT Command � � � � � � � � � � � � � � � � � � � � � � � � � �� The GUI MASK Command � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� The GUI OUTPUT Command � � � � � � � � � � � � � � � � � � � � � � � � � � � �

� The FILE SERIES Interface ����� De�ning a File Series � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ����� De�ning a Composite Image � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ����� Integrating a Series of Images � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��

� The IMAGE PROCESSING �GENERAL� Interface ����� The FILTER SubMenu � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ����� The GEOMETRIC SubMenu � � � � � � � � � � � � � � � � � � � � � � � � � � � ����� The MATHS SubMenu � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ����� Example of Dividing One Image by Another � � � � � � � � � � � � � � � � � � � � ��

Page 9: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� The MACROS � LOG FILE Interface ����� Creation and Using Simple Macro Files � � � � � � � � � � � � � � � � � � � � � � � �

� The MFIT �MULTIPLE �D FITTING� Interface ����� Entering an Initial Model and Model Optimisation � � � � � � � � � � � � � � � � ��

�� The ONLINE CRYSTALLOGRAPHY Interface ��

�� The POWDER DIFFRACTION ��D� Interface ������ The INPUT Command � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ The TILT Command � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ The INTEGRATE Command � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ The BEAM CENTRE Command � � � � � � � � � � � � � � � � � � � � � � � � � ����� The CALIBRANT Command � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ The CAKE Command � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��

�� The SAXS�GISAXS Interface ���

�� The TEST Interface ���

�� The KEYBOARD INTERFACE� Introduction And General Use ������� FIT�D Prompts and Required Input � � � � � � � � � � � � � � � � � � � � � � � � ������� Important Main Menu Commands � � � � � � � � � � � � � � � � � � � � � � � � � � �� ���� FIT�D Terminal Output � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� The �Pager� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ Online HELP � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Modifying Text � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Modifying Graphics Style � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

�� The KEYBOARD INTERFACE� Command Summary ���� �� ��D INTERPOLATION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� ��D SURFACE PLOT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� ADD � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � ANNOTATION LABEL � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� ASPECT RATIO � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� AUTOCORRELATION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� AXES SCALES � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� BANNER � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� BLUR � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� BRAGGS� EQUATION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� CADD �Constant ADDition� � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� CALCULATOR � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

� �����Examples of Calculator Usage � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� CALIBRATION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� CDIVIDE �Constant DIVIDE� � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� CHANGES � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� CLEAR DATA � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� CLOSE LOG � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� CMULTIPLY �Constant MULTIPLY� � � � � � � � � � � � � � � � � � � � � � � � � ���

Page 10: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

� ��� COLOUR TABLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� CONCATENATION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� CONTOUR PLOT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� CREATE DATA � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� CURVE STYLES � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� DEDUCE FILE SEQUENCE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� DEFINE VARIABLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� DIFFRACTION PATTERN � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� DIMENSIONS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� DISPLAY LIMITS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� DIVIDE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� END GRAPHICS FILE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� ENTROPY � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� EXCHANGE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� EXIT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� FAST IMAGE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� FILTER � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� FIT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� FLIP � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � ��� FONT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � ��� FUJI LINEARISATION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � ��� FULL REGION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � ��� GAUSSIAN � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� GEOMETRY �EXPERIMENT� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� GRID � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� GUI � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� HELP � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� HISTOGRAM � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� IC � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� IMAGE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � � INFORMATION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � � INPUT DATA � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

� � ��� ��D ASCII FREE FORMAT � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � ��� �D ASCII FREE FORMAT � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � ��� BINARY �UNFORMATTED� � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � ��� BSL FORMAT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � �� CHIPLOT FORMAT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � ��� DIP� �Mac Science� � � � � � � � � � � � � � � � � � � � � � � � � � �� � � ��� ��ESRF Data Format�� � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � � ��� FUJI BAS� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � ��� GAS �D DETECTOR �ESRF� � � � � � � � � � � � � � � � � � � � � � � � � � ���� � ���� HAMAMATSU PHOTONICS � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � ���� IMAGEQUANT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � ���� MAR RESEARCH FORMAT � NEW MAR CODE � � � � � � � � � � � � � � � � � ���� � ���� PMC FORMAT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � ���� PRINCETON CCD FORMAT � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � ��� TIFF � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � ���� UNKNOWN � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � ���� USER INTENSITIES � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

Page 11: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

� � � INTERNAL MEMORY � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � � LINEARISE FILM � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � � LIST VARIABLES � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � LOGARITHM � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � � MACRO � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � � MEDIAN FILTER � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � � MESSAGE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� � � MOVE�ROTATE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� MULTIPLY � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� NORMALISE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � ��� OFFSET�SCALE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � ��� OPEN LOG � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � ��� OUTPUT DATA � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

� ����� �CAM � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ����� BINARY �UNFORMATTED� � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ����� BSL FORMAT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ����� CBF � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ���� CHIPLOT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ����� COMPRESSED DIFFRACTION DATA � � � � � � � � � � � � � � � � � � � � � � � �� ����� DENZO MAR FORMAT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ����� DUMP � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ����� FITD STANDARD FORMAT � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ������ GSAS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ������ MCA FORMAT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ������ SPREAD SHEET � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ������ TIFF INTEGERS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �

� �� PAGE POSITION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� PAUSE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� PEEP � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� PIXEL REGION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� PLOT DATA � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� POISSONIAN NOISE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� POLARISATION EFFECT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� POSTSCRIPT OPTIONS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� POWER SPECTRUM � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� PREDICTOR � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� PRINT GRAPHICS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��� PUBLICATION QUALITY � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� QUESTION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� QUIT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� RAISE TO A POWER � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� REBIN � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� RE�BIN � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� RECALL � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� REFLECT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� REGION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� �� RING �ADD POWDER RING� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� ROI �Region Of Interest� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ��� ROTATE LUT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �

Page 12: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

� ��� RUN MACRO � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� SELECT PIXEL OPERATION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� SEQUENCE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

� �����Examples of the SEQUENCE Command Usage � � � � � � � � � � � � � � � � ���� ��� SET ANNOTATION STYLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � ��� SET ARROW STYLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � ��� SET AXES STYLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � ��� SET BACKGROUND STYLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � �� SET COLOUR � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� SET CURVE STYLES � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� SET ENUMERATION STYLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� SET FONT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� SET GRID STYLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� SET LAYOUT STYLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� SET TICK POSITIONS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� SET TITLE STYLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� SET X�LABEL STYLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� SET Y�LABEL STYLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� SLEEP � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� SMOOTH � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� SPATIAL FILTERING � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� START MACRO � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� STATISTICS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� STOP MACRO � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� STORE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� SUBTRACT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� SURFACE INTERPOLATION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� SYMBOL � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� SYMMETRIC FUNCTION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� TITLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� THRESHOLD � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� TRANSPOSE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� UN�DEFINE VARIABLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� UNIT CELL PARAMETERS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� VARIABLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� VARIANCES DEFINITION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� VC � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� WAIT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ��� WEIGHTED AVERAGE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� X�AXIS LABEL � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� Y�AXIS LABEL � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� Z�AXIS LABEL � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� Z�SCALE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��

�� Calibration Submenu ������� De�ning a Spatial Distortion Calibration Function � � � � � � � � � � � � � � � � � ������� Spatial Distortion Correction � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� NonUniformity of Sensitivity Response �FlatField Correction� � � � � � � � � � ������� Data Collection Sequence for the Xray Image Intensi�er�CCD Detector System ���

Page 13: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

��� Notes on the Data Collection Sequence for the XRII�CCD Detector System � � � ������ �� Step �b� CCD Camera Uniformity of Response � � � � � � � � � � � � � � ������ �� Steps �f �k� Reference or Dark Count Images � � � � � � � � � � � � � � � ������ �� Steps �a�c� Spatial Distortion Calibration Grid � � � � � � � � � � � � � � ������ �� Step �c�f and �e�g� FlatField Calibration � � � � � � � � � � � � � � � � ���

���� Calibration SubMenu Commands � � � � � � � � � � � � � � � � � � � � � � � � � � ��������� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��������� CALCULATE DISTORTION FUNCTION � � � � � � � � � � � � � � � � � � � � � ��������� DECAY CORRECTION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��������� DESTROY GRID PEAKS � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ����� DISPLAY DISTORTION � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ������ EXIT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ������ FAST CORRECTION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ������ FIND PEAKS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��������� FIT GRID PEAKS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���������� FLAT�FIELD CORRECTION � � � � � � � � � � � � � � � � � � � � � � � � � � ���������� HELP � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ������� INPUT SPATIAL FUNCTION � � � � � � � � � � � � � � � � � � � � � � � � � �� ������� INVERSE DISTORTED�IDEAL � � � � � � � � � � � � � � � � � � � � � � � � � �� ������� LEARN HOLE PROFILE � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ������ LINEARISE INTENSITIES � � � � � � � � � � � � � � � � � � � � � � � � � � ���������� LOAD LOOK�UP TABLE � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���������� LOOK�UP TABLE �SPATIAL DISTORTION� � � � � � � � � � � � � � � � � � ���������� OUTPUT SPATIAL FUNCTION � � � � � � � � � � � � � � � � � � � � � � � � � ���������� PLATYPUS CORRECTION FILE � � � � � � � � � � � � � � � � � � � � � � � � ���������� QUIT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���������� RE�CALCULATE DISTORTION � � � � � � � � � � � � � � � � � � � � � � � � � ���������� RESIDUALS OF FIT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���������� SAVE PEAKS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���������� SIZE �IMAGE DISPLAY� � � � � � � � � � � � � � � � � � � � � � � � � � � � ��������� SPATIAL CORRECTION � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���������� STORE LOOK�UP TABLE � � � � � � � � � � � � � � � � � � � � � � � � � � � ���������� TRANSFER DISTORTION � � � � � � � � � � � � � � � � � � � � � � � � � � � ���������� VIEW PEAKS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���������� XRII FLAT�FIELD � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

���� Spatial Distortion Correction in MADNES � � � � � � � � � � � � � � � � � � � � ��������� Image Format Conventions � � � � � � � � � � � � � � � � � � � � � � � � � � ��������� Example of Producing Calibration Files � � � � � � � � � � � � � � � � � � � ��

�� Fit SubMenu ������� Powder Di�raction Ring Integration � � � � � � � � � � � � � � � � � � � � � � � � ���

������ Correction for Polarisation E�ects � � � � � � � � � � � � � � � � � � � � � � ������� Advice on Model Fitting � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� The Data Mask � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� CHANGE SCALE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ CLEAR MASK � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� CONSTRAIN PARAMETERS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� COVARIANCE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� DEFINE MASK � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

Page 14: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

���� DISPLAY MASK � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �������� EXIT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �������� INPUT PARAMETERS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

�������GRAPHICAL INPUT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �������� MASK STATISTICS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �������� MINIMISE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �������� MODEL � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� NORMALISATION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �������� OUTPUT PARAMETERS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ����� QUIT � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ����� POWDER DIFFRACTION � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ����� R�THETA RE�BINNING � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �������� RADIAL PROFILE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �������� RESULTS � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �������� SET MASK COLOUR � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �������� SET UP � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �������� SURFACE POLYNOMIAL � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� THRESHOLD MASKING � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �������� TILT�BEAM CENTRE � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �������� TRANSFER MASK TO MEMORY � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

�� Publication Quality Graphs ���

�� Creation and Usage of Simple Macros ���

�� Command Line Options ������� Macro File � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Variable De�nition � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Program Dimensions � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Variance Arrays � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ No Graphics � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� �Landscape� Output � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Colour Table Control � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Graphical Form and Menu PostScript Output � � � � � � � � � � � � � � � � � � � ���

�� Coordinate Systems ���

�� Including Graphics in LATEX ��Documents ���

�� The Graphics System ������� Fonts for Text Output � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Colour Map Usage � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Graphical Input � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� ���� X�� Restrictions � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��

�� Limitations� Bugs� and Unclear Documentation ������� Known Bugs and Limitations � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Limitations � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

������ �Legal� Paper Hardcopy Output � � � � � � � � � � � � � � � � � � � � � � ������� Reporting Bugs Bad Features and Bad Documentation � � � � � � � � � � � � � ���

Page 15: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

�� TroubleShooting ���� �� Command not found � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� Failure in FIT�D Startup � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� No Image Output � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� LATEX �� Instructions Do Not Work � � � � � � � � � � � � � � � � � � � � � � � � � ���� � Graphics Output File Does Not Print � � � � � � � � � � � � � � � � � � � � � � � � ���� �� Missing Font Message at Startup � � � � � � � � � � � � � � � � � � � � � � � � � � ���� �� The Graphics is not Redrawn when the Window is Uncovered � � � � � � � � � � ���

�� Acknowledgement and Citation of Use of FIT�D ���

�� Acknowledgements ���

�� Appendix A� FIT�D Availability ������� Program Description � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Availability � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� Operating Systems and Computer Languages � � � � � � � � � � � � � � � � � � � ������� Documentation � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ Further Questions � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �

�� Appendix B� FIT�D Macro Language ������� Variables � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ����� More Complicated Macros � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ����� �KEYBOARD� Interface Commands for Macros � � � � � � � � � � � � � � � � � � � ���� A Macro Example � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� Command Files �Scripts� for Batch Mode Processing � � � � � � � � � � � � � � � � �

��� �� Explanation of Files � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ �� fitd�batch � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ �� scorr�batch � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ �� gen files � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ � scorr imagequant�mac � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ �� scorr princeton�mac � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������ �� scorr photometrics�mac � � � � � � � � � � � � � � � � � � � � � � � � � � ��

�� Appendix C� Menu Commands and Short Description ������� Main Menu Commands � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ������� CALIBRATION SubMenu Commands � � � � � � � � � � � � � � � � � � � � � � � � � ������� FIT SubMenu Commands � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���

�� Appendix D� Command Output and E�ects ���

�� Appendix E� Conditions of Use ���

�� Appendix F� Conditions of Disclosure of Source Code ���

�� Appendix G� Collaborative Development ���

Page 16: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

� Prerequisites

To be able to run FIT�D the following tasks must have been ful�lled�

Installation� FIT�D since Version ��� is a single executable which does not depend on anyother �les although a PostScript version of this reference manual may also be useful asmight be the introductory manual� �FIT�D� An Introduction and Overview� �both thesemanuals are now available as web pages���� FIT�D executables are available for mostworkstation systems and can be obtained from the worldwide web� The FIT�D homepage URL is�

http ��www�esrf�fr�computing�expg�subgroups�data�analysis�FITD

From the home page links to installation documentation executables and user and reference manuals are available� With a minimum of computer knowledge you should be ableto obtain and setup FIT�D yourself� Otherwise ask your system administrator for help�

On Unix systems it is generally necessary to set the �executable bit�� Assuming theFIT�D executable has been copied to a �le named fitd this can be achieved with thefollowing Unix command�

chmod �x fitd

Environment Variables� On Unix systems The following environment variable needs to bede�ned�

DISPLAY As with all X�� programs the environment variable DISPLAY needs to be set toyour X�� display� Normally this will be de�ned automatically but sometimes it maybe necessary to de�ne or rede�ne this variable manually� e�g� Using the �C� shell or�better� the �T� shell with a workstation called experiment� the following commandcould be typed on the �T� shell command line�

setenv DISPLAY experiment�

FITD KEY variable needs to be set to an individually determined code� �the softwarekey�� This is only necessary outside of the ESRF and not on ESRF computersystems� For external users an email message will be with the value of the individualcode �key value� and instructions on how to set it�

The current �values� of the environment variables may be checked by using the �C���TC� shellcommand printenv�

�If the Version of FIT�D being used has been linked �dynamically� then it is dependent on the requiredsystem libraries being available� If it has been linked �statically� then it should be completely independent�

Page 17: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

� Running FIT�D

To run FIT�D on Unix systems simply enter fitd � Return� on the command line�� OnWindows systems you may either run FIT�D from a command window as on Unix systemsor click on a FIT�D icon� If necessary FIT�D will open a �terminal window� for text outputand keyboard input�

A �welcome� banner should appear in the terminal window with the version number of theprogram� If this does not happen check with your system administrator that FIT�D has beeninstalled and that your PATH is properly de�ned �see Section � �� Page �����

After the header information a graphics window should be started as a separate X�� window�If FIT�D cannot open the graphics window for some reason it will output an error message inthe terminal window with suggested causes of the problem and possible solutions� If no errormessage appears but the graphics window does not appear check the de�nition of the DISPLAYvariable e�g� printenv DISPLAY � Return�� Other potential startup problems are coveredin Section � �� Page ����

Assuming everything has been setup properly the graphics window should have been openedand FIT�D will be waiting for graphical input in one of four buttons� CONDITIONS�I ACCEPT� HELP or DON�T ACCEPT�

Whilst FIT�D is running keep the terminal window visible even when running in the graphicsmode� Useful information warning and error messages often appear in the terminal window�

��� FIT�D Executable Directory

Ideally systems would be setup such that users would type fitd and FIT�D would automatically start� However this depends on the system directories and the users �path� beingde�ned appropriately�

On all ESRF computers FIT�D should be found in the �usr�local�bin directory which isusually already in a standard �PATH�� This is the recommended directory for external usersas well but for various reasons FIT�D may be in a di�erent directory� Ask your local systemadministrator for help if necessary�

�The recommended directory for the FIT�D executable on Windows system is not presentlyde�ned��

��� Start�up of FIT�D

When FIT�D is started you should see a screen of text similar to this one� on the terminalscreen from where you typed fitd�

�Command line options may also be useful� see Section ��� Page ����The version number may well be dierent� and some of the messages notifying you of recent changes may

be dierent�

Page 18: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

�������������������������������

PROGRAM FITD Version V���

�������������������������������

Copyright ��������� Andy Hammersley � ESRF �hammersley�esrf�fr�

FITD �D Detector Calibration�Correction� File re�formatting� �D Fitting

YOU CAN ALWAYS ENTER �

FOR FURTHER EXPLANATION OF REQUIRED INPUT

No commercial software used �

See ��CHANGES�� �keyboard menu� for important changes

��� NOTE ��SYMBOLS�� commands replaced with ��VARIABLES��

��� commands in �KEYBOARD� menu

Note the version number that you are using��

At the same time the graphics window should be �lled with the FIT�D graphics �banner� andthe FIT�D logo and four buttons �unless FIT�D has been started in the �keyboard� interfacemode��

��� Graphics User Interface �GUI� StartUp

The default interface to FIT�D is the graphics user interface �GUI� which uses the graphicswindow with �point and click� user interaction�

The areas with yellow background and blue text are graphically active i�e� they can be clickedupon to select a command or in later forms a �le name�

In this case �see front cover Page �� there are four buttons�

� CONDITIONS This explains the conditions of use�

� I ACCEPT To accept the conditions of use and enter the main interface selection menu�

� DON�T ACCEPT To exit FIT�D immediately�

� HELP For general explanation on the graphics user interface�

Now and at any time the graphics window is active i�e� the cursor and crosshair can be movedwith the mouse �or other graphics pointing device� the graphics window can be resized by

�This is useful if you encounter bugs or problems�

Page 19: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

dragging on one of the corners of the window� After user resizing FIT�D will resize thewindow to the largest window with the same aspect ratio as previously within the user de�nedregion although a minimum size is speci�ed below which the window cannot be reduced�

To enter FIT�D you must click on the I ACCEPT button which conveys acceptable ofthe �Conditions of Use� which are detailed within the text form obtained by clicking on theCONDITIONS button�

If you don�t accept the �Conditions of Use� then click on the DON�T ACCEPT button andFIT�D will exit immediately� �This is also useful when you remember that you should bedoing something else or want to work from a di�erent directory etc��

After the I ACCEPT button has been clicked the following form should appear �unlesscommandline options have been used to specify the equivalent information� see Section ��Page �����

Figure �� FIT�D Program Array Dimensions Form

DIMENSIONS OF PROGRAM ARRAYS(need to be big enough to store

and work on data)

O.K. CANCEL ? HELP INFO

DESCRIPTIONS VALUES CHANGE

FIRST DIMENSION OF

ARRAYS

SECOND DIMENSION OF

ARRAYS

CREATE MEMORY ARRAYS

CREATE VARIANCE ARRAYS

512

512

YES

NO

X-DIMENSION

Y-DIMENSION

MEMORY

VARIANCES

Click on variable to change, or ’O.K.’

The four vertical buttons allow the size �number of elements� of the internal program arraysand the number and type of arrays to be speci�ed� Unlike many other programs FIT�D is

Page 20: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

completely versatile in the size of images �and �D datasets� which can be treated �althoughsystem constraints will impose limits at some level��

Thus when FIT�D is started it is necessary to specify the size of the internal arrays used tostore data� Normally you will want the arrays to be as large as the data to be input� Theprecise size will vary from application to application� The arrays can be larger or smaller thanthe data input from �le� If the arrays are smaller then not all of the data can be input at fullresolution� If the arrays are bigger then only the region input will be used but sometimes itcan be useful to specify array sizes larger than the size of the input data�

The XDIMENSION button allows the number of pixels in the �rst array dimension �horizontal as displayed� to be speci�ed�

The YDIMENSION button allows the number of pixels in the second array dimension�vertical as displayed� to be speci�ed�

The MEMORY button allows the creation of �memory� arrays or not� All operations exceptfor very basic display require the �memory� to exist so by default this boolean variable has thevalue �YES�� Normally this should not be changed� Only if there is a problem of insu�cientcomputer memory and only image display is required would this be set to �NO��

The VARIANCES button allows variance arrays to be created or not� Variance arrays arenecessary if error propagation is to be carried out ��� but this nearly doubles total computermemory requirements and will slow down many operations� This should only be selected iferror propagation is being used in the data analysis�

The other buttons �blue text on a yellow background� are general forms buttons� See Section ��� Page � for general information on the interactive graphical forms�

When the form values are correct click on the OK button and the program array will becreated and the main interfaces menu will appear�

Assuming the �Scienti�c Interfaces� menu has appeared you have entered FIT�D and areready to select one of the graphical interfaces or the KEYBOARD INTERFACE� These aredescribed below�

��� �Keyboard� Interface StartUp

When FIT�D is startedup in the �keyboard� interface mode e�g� by using the �key optionon the commandline �see Section �� Page ��� for further information� or when the graphicssystem cannot startup for some reason the line�

X DIMENSION FOR ARRAYS �Range � to �� ����

appears beneath the FIT�D banner text within the terminal window�

Page 21: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure �� FIT�D Scienti�c Interfaces Main Menu

?

HELP

FILE SERIES

IMAGE PROCESSING (GENERAL)

KEYBOARD INTERFACE

MACROS / LOG FILE

MFIT (MULTIPLE 1-D FITTING)

ON-LINE CRYSTALLOGRAPHY

POWDER DIFFRACTION (2-D)

SAXS / GISAXS

TEST

EXIT FIT2D

This is a prompt line for user input� If you click inside the terminal window� and enter aquestion mark ��� you should see the following text�

X DIMENSION FOR ARRAYS �Range � to �� ���� �

Here you are asked to define the size of the program arrays� These will

be used to store data �inside� FITD� Normally you will want the arrays

to be at least as large as the image data to be input� If the dimensions

are larger this does little harm� but is wasteful of system resources�

If the arrays are smaller then not all of an image can be input at full

resolution� Some input options allow an image to be re�binned on input

or for a sub�region of the image to be input�

This prompt and the next prompt�

Y DIMENSION FOR ARRAYS �Range � to �� ����

de�ne the sizes of the internal arrays which are used to store data� As images can vary in sizeFIT�D allows great �exibility in the size of data that can be input� Very large images maybe treated but the computer system on which FIT�D is running may not be setup to allow

�This is nothing to do with FIT�D� but is a property of the X�window system� Depending on how yourX�terminal is set�up it may not be necessary to click� simply placing the graphics cursor inside the terminalwindow may be su�cient�

Page 22: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

enough memory to be used� Users are recommended to use as little memory as they need� Theprogram arrays do not need to be exactly the size of input data� if they are bigger the extraspace is not used initially but may be used by certain commands� if the arrays are smaller thanimages to be input then only part of the image will be input or with some input options thereis the choice to �rebin� the data on input�

The next prompt allows you to create variance arrays or not�

CREATE VARIANCE ARRAYS �NO�

If you don�t know whether or not to create variance arrays it is best not to create them �thedefault is not to create them�� Creating variance arrays doubles the requirements for virtualmemory and is only useful for a few specialist commands�

Assuming no error occurs the next prompt is�

Main menu ENTER COMMAND �INPUT DATA�

You have now started FIT�D and entered the �Main menu�� See Section �� Page ��� for helpon general usage of the FIT�D �keyboard� interface �

If instead you get an message like the following�

STATUS The error was identified in module

EXPG�IO Input�Output and Status

STATUS Position where error condition was identified

Subroutine EXPG�IO�MALLOC V��

STATUS The error condition has been classified as

Bad memory allocation Memory allocation failed

RESET ��status�� �YES�

then the memory allocation has failed i�e� the system cannot give FIT�D as much virtualmemory as you have requested� This means that the program arrays have not been created andnormal operations will not work� It may be possible to rede�ne smaller memory requirementsusing the DIMENSIONS command �See Section � ��� Page ���� or to ask other users to stopsome processes to free more virtual memory or to ask the system administrator to increase thesystem quotas�

��� FIT�D Old and New Versions

On most systems where FIT�D is installed and updated a previous version is saved in thesame directory as the current FIT�D program� The old version is called fitd old� If ever

Page 23: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

you �nd that a bug has appeared in a new version which was not present in the old versionyou can use the command fitd old instead of fitd to obtain an older version� This willtake all the command line options exactly as for fitd� �It cannot be guaranteed that sitesoutside the ESRF are setup like this but this is the recommended setup��

At the ESRF new features may be added to a development version of FIT�D during anexperimental run owing to user requests� Since it is preferable not to change the standardversion during a run normally any changes will be made to a version called fitd new� Onlyif a major bug is discovered �one which is likely to a�ect many users� will the standard version�fitd� be changed during a run�

Between experimental runs the standard version may replace the old version and a new versionmay replace the standard version�

�An external site may also choose to setup a fitd new version��

Page 24: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

� Important Principles And Common Features

A number of general principles persist throughout FIT�D� These should be largely intuitiveand obvious but some points may be missed by a new user so are explained here�

��� Dynamic Memory Allocation

FIT�D uses dynamic memory �or virtual memory� allocation to allow as much �exibilityas possible in the size of data that can be treated� This has obvious advantages but also hasdisadvantages� �D dimensional data �images� from modern detector systems can be very largeso the demands of FIT�D for memory allocation can be similarly large� Users are recommendedto try to use the minimum of memory necessary for their data� At startup the user is promptedfor the initial size of program arrays i�e� the size necessary to input their data�

The user is also prompted as to whether or not error estimate arrays �variance arrays� are tobe created� If created the dynamic memory demands are roughly double and many operationswill take longer as error propagation is being carried out� If error estimate arrays are notcreated no error propagation is carried out and any �tting will thus be unweighted�

If at any stage during the running of FIT�D the user gets a message that memoryallocated has failed� it must be assumed that the previous command has failedRecovery may be possible� but this depends on the circumstances

�It is thought that Windows � limits the maximum memory size to �� Mbytes� If this isthe case it will be a severe limitation for those wanting to work with large image sizes i�e�greater than ���� � ����� WindowsNT does not impose this limitation so may be a solutionfor those wanting to use FIT�D from a Windows system� Whether or not Windows �� solvesthis problem is not presently known and FIT�D has yet to be tested on such a system��

��� The �MEMORY�

FIT�D uses two main internal arrays to store image data and to perform almost all operations�The default array will be referred to as the �current data array� � this is where data is storedwhen input and where data to be displayed graphically must be situated� The second array willbe referred to as the �memory�� The �memory� is like the memory facility on many calculatorsexcept that the single memory may take up � Mbytes or more and may store a full image�

To move data from the current data array to the memory and vice versa most graphicalmenus contain the EXCHANGE button and the keyboard interface contains the EXCHANGEcommand� The output of all operations which produce output data within the GUI is in thecurrent data array� In many cases the original data is transferred to the memory and thusmay be recovered using the EXCHANGE button� In other cases the original data may berecovered using the inverse operation e�g� SUBTRACT after ADD�

Page 25: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��� �Active Data Region� �ADR� �Region of Interest� �ROI�

All commands which operate on data elements may be limited as to the range of data elementsupon which they act� The region or �window� over which operations take place is referred toas the �Active Data Region� �ADR� or the �Region Of Interest� �ROI�� � In other programsand contexts this concept is sometimes referred to as a �Data Window��

When data is input the ADR is initially set to include all the data� The menu commandsZOOM INUNZOOM and FULL buttons allow the ADR to be changed �see Section �������TheMOVEMENT graphics submenu also contains many commands which change the ADRe�g� all the commands which move around the image� UP� DOWN� LEFT� etc�

It should be noted that the ADR concept does not just a�ect graphical display but also a�ectsarithmetic and other operations and the output of data to �le �OUTPUT�� FIT�D followsthe WYSIWYG ��what you see is what you get�� principle in data operations so only thearea of the data which is currently displayed will be operated upon� �The exception is theEXCHANGE command which swaps the entire datasets including the de�nitions of theADR��

�� The Graphics Window

The graphics window may be resized to suit user needs by dragging on one of the corners ofthe window border� When the graphics window is resized it will change size but will keep thesame �aspect ratio� i�e� the relative lengths will be kept the same�� To do this the correctlyproportioned window is �tted within the region de�ned by the dragged cursor� Thus to de�nea larger window it is important to drag the cursor in both directions� The window can also bemade smaller but there is a minimum size�

By default the graphics window is created in the �portrait� format in the same ratio as A�paper� However other formats may be used and in particular �landscape� A� format is available�see Section ����

��� False Colour Image Display

The basis of all interactive data analysis in FIT�D is the false colour image display for �Ddata or an X�Y Graph plot for �D data� The �at image display allows easy and unambiguousinteractivity� An example of the false colour image display and a control menu is shown inFigure ��� The whole of the ROI is displayed as an image even if there are less screen pixelsthan data elements which is often the case�

For general data analysis the style options are generally not important with the exception ofthe intensity or �zscaling�� It is necessary to understand the manner in which the data element

�This automatic re�sizing does not presently work on Windows systems��The images displayed in this manual deliberately have relatively small numbers of pixels� This is to prevent

the PostScript �le of the manual getting too big� and to make printing reasonably quick� Naturally� mostanalysis will involve images with many more pixels� FIT�D can handle very large images and display theme�ciently�

Page 26: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure �� Example of False Colour Image Display

1820 1840 1860 1880 1900 1920 1940 1960

1820 1840 1860 1880 1900 1920 1940 1960

1150

1200

1250

1300

1350

1150

1200

1250

1300

1350

PTA STAINED COLLAGEN

Columns

Row

s

0 200 400 600 800 1000 1200

Intensity

EXIT

?

FAR-LEFT

UN-ZOOM

FULL

L-TOP

L-UP

LEFT

L-DOWN

L-BOTTOM

TOP

UP

CENTRE

DOWN

BOTTOM

R-TOP

R-UP

RIGHT

R-DOWN

R-BOTTOM

OPTIONS

ZOOM IN

FAR-RIGHT

DISPLAY

PRINT

Page 27: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

values are changed into displayed pixel colours to interpret the display images�

Generally usage is very obvious but it is necessary to understand the di�erent scaling modeswhich may be present� The mode of intensity scaling can be changed by using the Z SCALINGcommand and subsequent submenu �see Section �� Page ���� This submenu may also beobtained simply by clicking on the intensity scale colour bar in the main menus of the di�erentinterfaces�

By default FIT�D uses automatic full range linear scaling of the ADR data values� This meansthat the minimum value and maximum of the ADR are found and all values inbetween areconverted to a colour �black white and grey�s are colours� in the current colour table usinglinear interpolation�

With automatic range intensity scaling the whole of the range of data values will always bevisible although some images with a very few very extreme intensity values may not appear veryinteresting� Full range automatic scaling may be selected using the FULLY AUTOMATICbutton� As the ROI changes then so do the current minimum and maximum values and sameintensity values may be displayed using di�erent colours� This can be confusing and undesirablein some circumstances�

�Fixed� range intensity scaling is also available� With completely �xed scaling the minimumand and maximum data values which correspond to the extremes of the colour table are �xedto some values� Thus as the ROI changes the intensities displayed with particular colours stay�xed� However if data values outside the de�ned range are encountered then they are justdisplayed using the colour corresponding to the minimum or maximum of the range�

The full range of scaling options are �together with linear or logarithmic scaling��

FULLY AUTOMATIC� Automatic full range rescaling� Every time the ROI or the data ischanged the minimum and maximum are found and the scaling is set to cover the wholerange� This is often suitable but when a few very high or low valued pixels exist thedetail may be lost in the image�

WEAK PEAKS� Automatic limited range rescaling� Every time the ROI of the data ischanged a number of regions are used to calculate averages and standard deviations�The range is set to hopefully display best weak features in the data�

USER MIN�MAX This uses user entered �xed minimum and maximum values for thedisplayed intensity range�

USERMINIMUM This uses an user entered �xed minimum value for the displayed intensityrange but the maximum is automatically de�ned by the ROI data values�

USER MAXIMUM This uses an user entered �xed maximum value for the displayed intensity range but the minimum is automatically de�ned by the ROI data values�

If data is input but nothing appears to be displayed it is likely that the intensity scaling is�xed and that the data values are not within the range� The Zscaling mode and range valuesare remembered between calls to FIT�D �V�������

For further information on controlling the intensity scaling see Section �� Page ���

Page 28: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Aspects of the false colour diagram style can be changed using theOPTIONS command whichis present in many menus �see Section � Page ��� and other forms of graphical display areavailable through the DISPLAY command which is also generally available �see Section ��Page � ��

��� Information Warnings and Error Messages

Di�erent types of prompt text information text and warning and error messages will appearin the graphics window and also extra information text will appear in the terminal window�The main �dialogue� is in always in the graphics window except within the KEYBOARDINTERFACE but often more detailed explanation is given in the terminal window�

Information and warning text in the terminal window is identi�ed by one of four initial �keywords��

INFO The text is of a purely informative nature e�g� values calculated as the result of someoperation or information on an input dataset�

NOTE The text is also informative but highlights a potential for misunderstanding by aninexperienced user� Thus such messages should be carefully noted�

WARNING Something has not worked as it should� This may be of greater or lesser importancedepending on the circumstances� e�g� An input �le was not found or was of the wrongformat�

ERROR Something �serious� has gone wrong� This may require exiting FIT�D or may be�recoverable� depending on the circumstances� e�g� The system has failed to allocatedynamic memory as requested�

It should be noted that these categories are not strict i�e� in some circumstances a WARNING

message may be more serious than an ERROR message nevertheless this show a generallyincreasing importance and need for user comprehension and maybe action�

Page 29: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

� Graphics User Interface� Introduction And General

Use

The �Graphical User Interface� �GUI� is designed to make easily accessible the most usedfunctionality which is available within FIT�D� To achieve this functionality has been arrangedinto di�erent �interfaces� for di�erent scienti�c or technical areas� Figure � Page �� showsthe menu for the present choice of �scienti�c interfaces�� �Further interfaces are likely to beadded in future versions�� It should be emphasized that data can be moved from one interfaceto another without restriction e�g� �D Powder di�raction data could be input in the IMAGEPROCESSING �GENERAL� menu and manipulated then DebyeScherrer rings could beintegrated within the POWDER DIFFRACTION ��D� menu�

By clicking on the di�erent �buttons� the user enters the di�erent �interfaces�� The buttonsare�

The question mark in this menu and other menus gives a brief description of each of theavailable choices�

HELP The �HELP� button enters the �context� related help associated with the menu� Inthis case there is information describing the di�erent available interfaces� Clicking on�HELP� enters a �pager� which allows the user to scroll down and up the help information�

FILE SERIES Is an interface for performing operations on a whole series of �les or imagesas single commands� This is a newly available interface and much functionality is yet tobe added�

IMAGE PROCESSING �GENERAL� Is an interface for general purpose image processing and display operations on data input from a �le�

KEYBOARD INTERFACEThis enters the �keyboard� commandline interface to FIT�D�Certain functionality is presently only available from this interface�

MACROS � LOG FILE Commands to create and run macros and to open and close logrecords of the data analysis session�

MFIT �MULTIPLE �D FITTING� This interface allows �D �peak� functions such asGaussian Lorentzian and Voigt functions to be �tted to data along with other functionssuch as a polynomial �background� function and exponential decay or trigonometricfunctions� The �t model may be �tted repeatedly to a whole series of �D datasets� �Thisprovides the same functionality as was previously available through the program MFIT�����

ONLINE CRYSTALLOGRAPHY This interface allows online display and examinationof crystallographic data with the option of automatic updating of new image data asthey are obtained� Simple statistics to evaluate data quality are produced�

POWDER DIFFRACTION ��D� This interface specialises in the integration of DebyeScherrer rings from �D detectors to �D ��theta� scans and to other scans� This isuseful for standard powder re�nement but is also useful for texture analysis and othertypes of integrations and �scans��

Page 30: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

SAXS�GISAXS This interface is similar to the POWDER DIFFRACTION ��D� interface but is under development for specialised support of Small Angle Xray Scattering�SAXS� and Grazing Incidence SAXS �GISAXS�� The interface should also be useful forother types of small angle scattering�

TEST This interface is for test purposes and is used to generate test data� �Perhaps it willevolve into a data simulation interface��

EXIT FIT�D Allows FIT�D to be exited after con�rmation�

Most of the interfaces contain common submenus for generally important and useful functionality such as inputting displaying and outputting data as well as specialist commandsparticular to the interface� First the general commands and submenus will be described�

�� Graphics User Interface Colour Coding

Throughout the GUI a simple colour coding is used to indicate� user input information orwarning messages� �Active� regions such as buttons and region for inputting text have a yellowbackground with blue writing� �Note� the image of the data and the whole graphics windowmay be �active� for certain operations but these are left in their normal colours�� Generalinformation text has a white background and black text and warning or error messages havea red border and within black writing on a white background�

When warning or error messages occur there will usually be extra information in the terminalwindow and other useful information can appear so keep the terminal window visible at alltimes�

�� Parameter Value Input

FIT�D has been developed in a very modular fashion and the user interface exhibits thismodularity� This means e�cient development and easy use� The same �components� arereused many times and the user will soon become familiar with the input style�

At the most basic level of user input is parameter input� This may be a number e�g� a valuefor the number of pixels for the internal arrays in one direction a character string e�g� a titlefor a dataset or a choice between a limited number of values�

The following di�erent types of input exist�

Integer Value

Real Value

Boolean Value

Character String

Graphical Menu Choice

Page 31: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Graphical Coordinate

��� Integer� Real Value� and Character String Input

Figure � shows the typical display box for the input of an integer value� A very similar style isused for the input of real and character string values�

Figure �� Example of the User Input of an Integer Value

The following �components� of the dialogue box are apparent�

Descriptive Text� At the top �with the white background� is a short text describing therequired input� This includes the text �Range � to �� which tells that the valuemust by between � and ������ For parameters where any value may be input this text isnot present�

CANCEL The cancel button cancels the parameter input without changing its value� Thismay also cancel the operation for which the parameter value was being requested�

HELP The help button may be clicked to obtain more detailed information concerning theparameter value being input and its context in relation to the operation being undertaken�

OK The O�K� button may be clicked to accept the current value which is in the text input box� Initially this is a default value from FIT�D� This is equivalent to typing the�Enter� key�

Text Input Box� The yellow lower rectangle is the area for the display of input text� Thebox already contains the text �� which is the default value for the parameter and thecursor to the right of the number� Text entered from the keyboard will appear in thisbox at the cursor position�

The text may be �edited� using the left and right arrow keys to move the cursor the �backspace�or �delete� key to remove text and other numerical or alphabetic keys to enter characters�Additionally the up arrow and down arrow keys allow previous inputs to be scrolled� The uparrow key allows previous input to be �recalled�� Each time the uparrow key is pressed theprevious input replaces any entered text� The downarrow key can be used after the uparrowkey to scan through the previous inputs� If used by itself or when the current input is beingdisplayed it removes all characters� This can be useful for quickly removing all the charactersof a presented default response�

Page 32: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

When the text is as required the �Enter� �or � Return�� key is used to enter the value� Ifthe value is correct the parameter input is completed otherwise an error message will presentedfollowed by the full information �help� message and the user will be required to reenter theparameter value�

��� Boolean Value Input

Many times a simple �yes�no� choice is o�ered to the user� This sort of �boolean� parametervalue input is controlled with a simple menu of four buttons� An example is shown in Figure �

Figure � Example of the User Input of a Boolean Value

AUTOMATIC CORRECT ASPECT RATIO IMAGE DISPLAY

CANCEL HELP

YES NO

The buttons are�

Help information on the parameter value being requested

CANCEL Cancel input without changing the value of the parameter� This will also in manycases cancel the operation for which the parameter was requested�

YES Set the value to �Yes��

NO Set the value to �No��

The �CANCEL� button will cancel the operation and the parameter will keep its previousvalue�

The ��� button will display help text describing the purpose of the parameter and the type ofvalue required�

��� Graphical Menu Choices

Graphical Menus are the normal manner in which data analysis operations may be chosen bythe user� The choice of �scienti�c interfaces� is a graphical menu and each of the interfaces isa menu� Various menu commands may themselves produce submenus e�g� the ZSCALINGcommand produces a submenu�

Page 33: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

When a button is pressed it will be redrawn pressedin to show that it has indeed beenpressed� �Note� afterwards it may be redrawn normally and if this happens quickly enoughthe pressedin button may not be noticed��

Di�erent interfaces have di�erent commands but the following commands are common toseveral or all menus�

EXIT Every menu has an exit button which is used to exit the menu and return to theprevious menu or in the case of the �scienti�c interfaces� menu to exit FIT�D providedcon�rmation is given�

The question mark button provides a message with the available button commands and ashort explanation of the commands�

HELP The help button provides a �context� related help message on the menu and the overallfunctionality which it provides�

INPUT Input data from a �le �see Section ��� for more details��

OUTPUT The output button is used to save the current ADR of the data to an output �le�

EXCHANGE Exchange the current data with the memory data� If the memory was previously unde�ned then the current data array becomes unde�ned �see Section �����

ZOOM IN De�ne a smaller ADR using graphical cursor input �see Section �����

FULL Set the ADR to be the whole of the currently de�ned data �see Section �����

UNZOOM Increase the size of the ADR� This is done symmetrically if possible �see Section �����

PRINT Save the currently displayed graphical image to a PostScript �le� The name for thePostScript �le is requested�

DISPLAY Submenu with variety of alternative data display possibilities to the false colourimage e�g� contour or �D surface views �see Section ����

OPTIONS Submenu o�ering control of graphical display style options �see Section � ��

��� Graphical Coordinate Input

FIT�D has a true graphics user interface in that the user interface includes the graphicsdisplay as opposed to only buttons and dialogue boxes of most programs with �GUI�s�� Formany operations the most convenient form of user interaction is for the user to indicate somefeature in the data� This is performed by clicking on a false colour image of the data �or anX�Y graph for �D data��

An example of the dialogue box associated with graphical coordinate input is shown in Figure ��

The various components of this dialogue region are�

Page 34: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure �� Example of Graphical Coordinate Input

�SpyGlass�� On the left is the �spyglass� or zoom window which shows the region aroundthe cursor at full pixel resolution� As the cursor is moved within the data image so theimage within the spyglass changes� The crosshairs in the centre of the spyglass showthe position of the cursor� Unlike the main image display the spyglass is always fullrange automatic intensity scaling�

User Prompt� The white background rectangle contains �prompt� information describing thepurpose of the required coordinate input� Note� For some coordinate input this regioncan be replaced by a yellow button to be pressed to end input e�g� when the user canenter a variable number of coordinates�

CrossHair� Drawn on top of all the graphics is the cursor crosshair� These vertical andhorizontal lines follow the cursor and may be useful when the input coordinate needs tobe aligned with features in the data�

HELP The help button will provide a message describing in greater detail than the �prompt�the required input and its purpose�

CANCEL The cancel button allows the input to be cancelled� This will usually also cancelthe operation for which the coordinate was required�

KEYBOARD The keyboard button may be used to enter the X and Y coordinate positionby entering two numbers from the keyboard instead of the graphical click� This can beuseful when some precise value is required�

TWO CLICK Enter �two click mode�� In this mode for graphical coordinate input the �rstclick within the image stops the spyglass and then a second within the spyglass de�nesthe input coordinate� This allows more accurate input particularly for very large imageswhich will be displayed at much lower than single pixel resolution� When in �two clickmode� this button will change to ONE CLICK and may be used to return to normal�one click mode��

When a coordinate is selected a double cross is drawn on the image at the appropriate position�The double cross is made from a black horizontal�vertical cross and a white diagonal cross�Thus regardless of the colour of the data the cross will be visible�

Often when two or more coordinates are input the later coordinates are related in some wayto the �rst or previous coordinate� In such a case a �rubberband� line or rectangle is drawnand redrawn as the cursor moves� e�g� The ZOOM IN command requires two coordinates to

Page 35: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

de�ne the new ADR� and a rectangular box will be drawn de�ned by the �rst coordinate andthe cursor position whilst the second coordinate is being input�

�� Graphical forms

Often a number of control parameters for a data analysis operation may be varied by the user�Since for many of the parameters the default values will be suitable �graphical forms� arepresented� The same basic �form� is used for many di�erent purposes� The form for de�ningthe size of program arrays when FIT�D is �rst startedup is an example� All forms have thesame basic components and functionality although the number of user variable parameters maychange� The form presented to the user for modi�cation when the INTEGRATE commandof the POWDER DIFFRACTION ��D� interface is shown as an example in Figure ��

Each user controllable parameter has a button which may be clicked to change the value of theparameter� This button will contain some short text to describe the parameter� To the far leftwill be a short phrase giving more detail as to the purpose of the parameter and immediatelyto the left is the current value�

Clicking on the buttons of parameters which require a �YES�NO� value will simply togglethe value whilst clicking on other types of parameters will produce a �dialogue� region at thebottom of the graphics window� Here the parameter value can be entered from the keyboard�see Section ������ or a choice or inputs will be displayed as a graphical menu�

In addition to the parameter buttons are the following general buttons�

OK Clicking on the O�K� button will exit the form saving any changes to parameter valueswhich may have been made�

CANCEL Clicking on the cancel button will exit the form without making any changes� Thismay also cancel the operation for which the parameters were being input and return to amenu�

INFO This gives general information explaining the use of the graphical form�

This gives a short phrase explaining the use of each of the buttons in the form

HELP This gives help information speci�c to the particular graphical form and the parametersbeing controlled� This gives an overview of how the parameters control or vary theoperation�

� File Selection and input

Another often repeated operation is the selection of a �le for input of data �or for other purposes�� To facilitate this operation a ��le selection tool� is used� This allows the directory treeto be searched as well as displaying available �les� An example is shown in Figure ��

At the top of the display is the �prompt� describing the type of �le to be entered� The lineunderneath shows the current directory and this text will change if the directory is changed�

Page 36: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure �� Example of a Graphical Form

CONTROL OF RADIAL OR 2-THETA SCAN

RE-BINNING PARAMETERS

O.K. CANCEL ? HELP INFO

DESCRIPTIONS VALUES CHANGEEQUAL 2-THETA ANGLE

REBINNING

INTENSITY CONSERVATION

APPLY POLARISATIONCORRECTION

POLARISATION FACTORSAMPLE TO "DETECTOR"

DISTANCE (MM)

GEOMETRICAL CORRECTIONTO INTENSITIES

X-PIXEL COORDINATEOF DIRECT BEAM

Y-PIXEL COORDINATEOF DIRECT BEAM

ROTATION ANGLE OF PLANEOF TILT (DEGREES)

TILT ANGLE OF DETECTOR(DEGREES)

MAXIMUM 2-THETA ANGLEOF SCAN (DEGREES)

NUMBER OF BINS IN OUTPUTSCAN

YESNOYES

.99000

315.000

YES692.560

927.340

29.0460

.73600

12.7080

876

EQUAL ANGLES

CONSERVE INT.

POLARISATION

FACTOR

DISTANCE

GEOMETRY COR.

X-BEAM CENTRE

Y-BEAM CENTRE

TILT PLANE

TILT

MAX. ANGLE

SCAN BINS

Click on variable to change, or ’O.K.’

Page 37: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure �� The File Selection Tool

ENTER INPUT DATA FILE FOR FIT2D IMAGE

(click on "INFO" for details of file types)

DIRECTORY: /data/a/hammersl/MDgridm45_y.datgridm46_x.datgridm46_y.datgridm47_x.datgridm47_y.datgridm48_x.datgridm48_y.datgridm49_x.datgridm49_y.datgridm50_x.datgridm50_y.datgridm51_x.datgridm51_y.datgridm52_x.datgridm52_y.datgridm60.gellin.datmd_lin.datscan3.scanspatial.dat

UP DIRECTORY LEVEL

COMP

CANCEL

?

HELP

INFO

TYPES

FILTER

(No file selected)

Menu commands

on required file

on file selection

<ALL PERMITTED>

<NO FILTERING>

File Name (Optional)

Page 38: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Underneath on the left hand side is the �UP DIRECTORY� button which allows the directorytree to be mounted� The subdirectories of the current directory if any are displayed in aregion on the left of the window and any �les are displayed on the right� Both when presentare displayed in blue writing on a yellow background �i�e� active� and if more directories of�les are present than can be displayed �scroll� buttons appear to allow the list to be scrolled�Clicking on a directory name will change the current directory and a new list of subdirectoriesand �les will be displayed�

As well as the directory and �le selection regions there is a region for text input� The text isdisplayed at the bottom of the window� Thus rather than clicking on a displayed �le name it ispossible to enter �le names from the keyboard� The �Enter� �or � Return�� key is usedto complete entry of the name� If a valid �le name is entered then this will be the selected �le�If a valid directory name is entered then the directory will be changed and a new set of �lesand subdirectories will be displayed� The �Tab� key may be used for automatic �le namecompletion� Pressing the �Tab� key will search for possible completions of the entered text�If only one �le or directory is possible then this will be automatically selected� In case thatmore than one completion is possible then common characters will be automatically completedas far as possible� Immediately using the �Tab� key again will update the lists of �les anddirectories which are possible completions of the �le name� �Note� when this �le completionfacility is used any �lters or type matching �see below� is ignored��

Additionally the following buttons follow the directory list�

CANCEL To cancel the selection of a �le� This will cancel the input and return to a menu�

List of button commands and short explanatory text�

HELP Help information on the particular type of �le required�

INFO Help information on the use of the �le selection tool�

TYPES A subset of �les may be selected and displayed by specifying only �les of a certain�le extension to be �selectable�� By clicking on the TYPES button the require extensionof the �les may be entered� e�g� image may be entered to select only MarResearch imageplate scanner �les� When a �le type has been de�ned it is displayed in the informationbox to the right of the TYPES button� In the example no �le types have been de�nedso the information box contains the text �ALL PERMITTED��

FILTER A subset of �les may be selected and displayed by de�ning a �le ��lter�� Theasterisk is used as a �wildcard� so that a pattern may be de�ned and only �les matchingthe pattern will be displayed in the �le window� e�g� If �f��dat� is entered then only �leswhich start with lower case �f� and are of �le extension �dat� will be selectable� Anyactive �lter is displayed to the right of the �FILTER� button� In the example no �le �lterhas been de�ned so the information box contains the text �NO FILTERING�� �It should benoted that both �FILTER� and �TYPES� will act together if they are both activated��

Having selected a �le FIT�D will try to use the �le extension to determine the data format� Ifthe �le extension is of a number of �known� types the appropriate input code will automaticallybe tried� e�g� The Molecular Dynamics image plate scanners save �les with the extension gelso all such �les are read in automatically� If a �le type is unknown then a menu of available

Page 39: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

input formats is displayed and the user can click on the correct format or the CANCELbutton if none are suitable� �The BINARY input type allows a very wide range of �le typesto be input so long as the user knows the basic details of the format��

Common GUI Commands and SubMenus

Important commands which appear in many di�erent interfaces are listed below together witha brief description and they are described in detail in the sections which follow�

INPUT� Input data from a �le with the help of the �le selection tool�

EXCHANGE� Swap the data in the current data array with the data in the �memory�� Ifno data is present in the �memory� then the current data array becomes unde�ned�

Z SCALING� Submenu controlling the displayed intensity range and the choice of linearof logarithmic scaling� This submenu may be obtained directly from all interfaces whenthe intensity scaling colour bar �lookup table� is displayed�

DISPLAY� Submenu which allows a number of di�erent forms of graphical display�

MOVEMENT� This submenu allows easy movement within a large data image�

OPTIONS� Submenu controlling graphical style options such as grid title and axis text�

OUTPUT� Submenu allowing choice of output formats to save the contents of the currentregion of interest to a �le�

��� The GUI INPUT Command

Most interfaces contain the INPUT command and usually this will be the �rst command tobe used on entering an interface� After pressing the INPUT command the �le selection toolwill appear and help the user to �nd and select the �le containing the required data� SeeSection ��� Page � for general guidelines on �le selection�

Depending on the extension of the �le selected and type of �le format the data may be automatically input or a �le format menu or an input form may appear�

The following �le extensions and corresponding formats are automatically recognised as areupper case or mixed case versions��

bin� BINARY user speci�ed format

bsl� BSL �Daresbury� � OTOKO �Hamburg� format

chi� CHIPLOT ASCII �D X�Y graph format

�Other �le formats are likely to be added as needed� so this list is likely to grow�

Page 40: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

cor� BINARY user speci�ed format

cor� BINARY user speci�ed format

corr� BINARY user speci�ed format

edf� �Klora� format or BINARY user speci�ed format� The �Klora� format is a subset ofthe �ESRF Data format�� The �ESRF Data format� is too general and wrongly speci�edto be usable� The �Klora� format has a header section of ���� bytes stores one imageand does not use any data compression� This is the default data format on many of thebeamlines at the ESRF�

fd� FIT�D format

final� BINARY user speci�ed format

gel� Molecular Dynamics IMAGEQUANT �ti�� format

inf� FUJI BAS���� �BAS� ��� format

info� BINARY user speci�ed format

image� MarResearch IP scanner format

img� FUJI BAS���� �BAS� ��� format or HAMAMATSU CCD format� The �le type isrecognised from the start of the �le�

mar�� MarResearch IP scanner format

mar��� MarResearch IP scanner format

mar� MarResearch IP scanner format

mar�� MarResearch IP scanner format

mar���� MarResearch IP scanner format

pck� Old compressed MarResearch format

pmi� PHOTOMETRICS CCD format

spe� PRINCETON INSTRUMENTS CCD format

tif� Adobe TIFF format

tiff� Adobe TIFF format

If the �le has an unrecognised extension then the UNKNOWN EXTENSION� SELECTFILE FORMAT� menu will appear� This menu is shown in Figure ��

Most �le formats are automatically input but some do not have headers which fully de�ne thenecessary information to input the data� The BINARY format is the best explain of this� Thisis a very �exible input option which allows the user to de�ne all the information concerningthe formats and allows almost any noncompressed binary data to be input provided the userknows the details of the format or �nds them by trail and error� The BINARY format inputparameter form is shown in Figure ���

The form buttons allow the following input parameters to be controlled�

Page 41: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure �� The UNKNOWN EXTENSION� SELECT FILE FORMAT� Menu

CANCEL ? HELP

BINARY BSL/OTOKO CHIPLOT

FIT2D FUJI (BAS) HAMAMATSU

IMAGEQUANT KLORA MAR

MAR-PCK PHOTOMETRICS PRINCETON

TIFF

XPIXELS� The number of pixels to be de�ned and input in the fastest changing direction

YPIXELS� The number of pixels to be de�ned and input in the more slowly changingdirection

DATA TYPE� The data type used to store a pixel value� Presently the following types aresupported�

BYTE VALUES� Single byte per pixel integers

�BYTE INTEGER� �bytes per pixel integers

INTEGER ��BYTE�� �bytes per pixel integers

REAL ��BYTE IEEE�� �byte per pixel IEEE �oating point reals�

SIGNED� For integers data types whether or not the values are signed or unsigned�

BYTE SWAP� For multiple byte per pixel data types this sets whether or not the bytesare to be reversed in their ordering on input� This is necessary for data written on alittleendian machine and read in on a bigendian machine or vice versa�

STARTING BYTE� This allows the possibility of ignoring header sections at the start ofbinary �les� If for example a �le has a �xed length header of ���� bytes so that theimage data starts at byte number ��� �numbering from �� then this value can be set to��� �

When the form has been set the OK button can be clicked and the data will be input�

Even with unknown formats trail and error can be used to �nd the correct parameters of theformat provided the correctly input data can be recognised�

Since some of the formats are often used with very large �les a subregion input menu can alsoappear�

Further information on the available �le formats for input may be found in Section � � �Page ����

��� The GUI EXCHANGE Command

The EXCHANGE command is present in many interface menus and submenus and is theessence to using FIT�D for data analysis� EXCHANGE swaps the data in the current data

Page 42: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure ��� The BINARY Format Input Parameter Form

TYPE AND SIZE OF FILE DATA

(need to specify image size)

O.K. CANCEL ? HELP INFO

DESCRIPTIONS VALUES CHANGE

FIRST DIMENSION OF FILE

IMAGE

SECOND DIMENSION OF FILE

IMAGE

DATA TYPE OF PIXEL

VALUES

SIGNED OR UNSIGNED

(INTEGERS)

SWAP BYTES ON INPUT

(INTEGERS)

BYTE NUMBER FOR START OF

BINARY DATA

768

512INTEGER

(2-BYTE)

NO

YES

1

X-PIXELS

Y-PIXELS

DATA TYPE

SIGNED

BYTE SWAP

STARTING BYTE

Click on variable to change, or ’O.K.’

array with any data in the �memory� array� If no data is present in the �memory� the currentdata array is left unde�ned�

EXCHANGE is the way in which to �charge� data in the �memory� so that binary imageprocessing operations can be used� See Section ��� Page �� for a detailed example of dividingone image by another�

EXCHANGE is also very useful for recovering the original data after many operations withinthe GUI� The output of GUI operation if any is always in the current data array but theoriginal data is often transferred to the �memory�� so after such an operation EXCHANGEcan be used to recover the original data for further analysis�

Page 43: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

��� The GUI Z SCALING Command

The ZSCALING menu allows the range of intensity values displayed to be changed and tocontrol the manner in which data array intensity values are converted to output pixel colours�

Figure �� is an example of the false colour display of �D data together with the ZSCALINGmenu for changing the manner in which pixel intensity values are displayed as di�erent coloursor grey levels�

The following commands are available�

EXIT� Exits Z SCALING submenu and return to calling menu�

� MAXIMUM� Set �xed range scaling and increase maximum limit by ��� of the scalingrange�

USER MIN�MAX� Prompt user for MINIMUM DISPLAY VALUE and for MAXIMUM DISPLAY

VALUE and set �xed range scaling to these values�

� List of commands with short description of each command�

MAXIMUM� Set �xed range scaling and decrease maximum limit by ��� of the scalingrange�

USER MINIMUM� Prompt user for MINIMUM DISPLAY VALUE and set �xed minimum valuefor the displayed intensity range� The maximum is automatically de�ned by the ROI datavalues and rede�ned each time the ROI is changed or new data are displayed�

FULLY AUTOMATIC� Full range automatic scaling is set� The ROI is searched for theminimum and maximum values and the scaling range is set� Each time the ROI ischanged or new data are displayed the scaling range is recalculated�

� MINIMUM� Set �xed range scaling and increase minimum limit by ��� of the scalingrange�

USERMINIMUM� Prompt user for MAXIMUM DISPLAY VALUE and set �xed maximum valuefor the displayed intensity range� The minimum is automatically de�ned by the ROI datavalues and rede�ned each time the ROI is changed or new data are displayed�

WEAK PEAKS This selects reduced range automatic scaling� This is designed to displaythe weak features of di�raction data� Often full range scaling is not very informative sincethe intensity range is dominated by a very few strong re�ections and little detail is seenin the majority of the image� In this mode the average value and standard deviationof intensity values are calculated in several regions of the image� The minimum of thedisplay intensity range is then calculated from the minimum of the mean minus threetimes the standard deviation and the maximum is set to the maximum of the mean plus�ve times the standard deviation from each of the regions� Each time the ROI is changedor new data displayed the range is recalculated�

MINIMUM� Set �xed range scaling and decrease minimum limit by ��� of the scalingrange�

Page 44: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure ��� Example of False Colour Image Data Display

1500 1600 1700 1800 1900

1500 1600 1700 1800 1900

900

1000

1100

1200

1300

1400

1500

1600

900

1000

1100

1200

1300

1400

1500

1600

PTA STAINED COLLAGEN

Columns

Row

s

50 100 150 200 250 300 350

Intensity

FIT2D: IMAGE: OPTIONS: Z-SCALINGEXIT

?

FULLY AUTOMATIC

WEAK PEAKS

+ MAXIMUM

- MAXIMUM

+ MINIMUM

- MINIMUM

USER MIN/MAX

USER MINIMUM

USER MAXIMUM

LOG SCALE

Page 45: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

LOG SCALE� Display the data on a logarithmic scale� �The LOG SCALE button isreplaced with the LINEAR SCALE button��

LINEAR SCALE� Display the data on a linear scale� �The LINEAR SCALE button isreplaced with the LOG SCALE button��

As well as linear scaling logarithmic scaling is available through the LOG SCALE button�When logarithmic scaling is enabled this button is replaced by the LINEAR SCALE button�If zero or negative range limits are encountered when automatic range logarithmic scaling isbeing used a small positive value will be used instead�

The Z SCALING menu may also be obtained by clicking within the intensity scale colourbar when in the main menus of the di�erent interfaces� A �rubberband� line appears fromwhere the user clicked� Any of the menu commands can be clicked or the intensity scale colourbar may be clicked a second time� If clicked a second time the two values within the scale areused to set �xed range scaling� If the user clicks outside both the menu and the intensity scalecolour bar then fully automatic scaling will be set� This allows quick and reasonably preciserescaling from any interface�

�� The GUI DISPLAY Command

The DISPLAY menu allows other graphical display possibilities in addition to the standardfalse colour image display� Figure �� shows the menu button choices�

Figure ��� The Display Menu

EXIT ARC SLICE CONTOUR PLOT DISTANCE

? NUMBERS PIXEL (X/Y) PROJECTION

HELP SATURATED SLICE STATISTICS

PRINT 3-D SURFACE 3-D LINES

The buttons have the following functions�

EXIT Exit display menu

ARC SLICE De�ne an arc by entering the end coordinate and a coordinate on the arc andcalculate the �D �slice� along this arc� This is displayed as an X�Y graph and is savedin the memory�

CONTOUR PLOT Display the ADR as a contour plot

DISTANCE Allows two coordinates to be entered graphically and calculated the distancebetween the coordinates in pixel units and in millimetres using the currently de�nedpixel sizes�

Page 46: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Explanation on each of the menu options

NUMBERS Allow the user to click on coordinates and output the �� by �� square of pixelvalues around the coordinate� �If a log �le is open this will be saved in the log �le��

PIXEL �X�Y� Allow the user to click on pixels and display information on the coordinateand pixel values� If the geometry of a di�raction experiment has been de�ned then anglesand equivalent Dspacings will be calculated and displayed�

PROJECTION Allow the user to de�ne an arbitrary line and a region either side of theline and �project� the pixel values in the de�ned region onto the line� This is displayedas an X�Y graph and is saved in the memory� �This is similar to SLICE but allowsaveraging over several or many pixels��

HELP Help text explaining the available commands�

SATURATED Count the number of pixels with an intensity greater or equal to an inputvalue�

SLICE Allow the user to click on two coordinates to de�ne an arbitrary �slice� through thedata� The nearest pixels to the line de�ne the output data values� This is displayed asan X�Y graph and is saved in the memory�

STATISTICS Allow the user to de�ne a arbitrary polygon region and calculate a numberof statistics within this region� e�g� number of pixels total intensity mean and standarddeviation values� By �rst de�ning a background region followed by a region around adi�raction peak a primitive form of peak integration is available�

PRINT Save the current graphics display to a PostScript �le�

�D SURFACE The ADR is displayed a �D surface perspective view� The surface mayadditionally be coloured by the current colour table� The viewing angle and many aspectsof the display are controlled by a menu� An example of the display and menu are shownin Figure ��� This menu is described in the next section�

�D LINES Draw the ADR as a �D line plot with hidden line removal�

��� The �D SURFACE SubMenu

The �D SURFACE control submenu is shown in Figure ���

The following commands are available�

EXIT Exit �D surface viewing submenu�

�ROT Increase longitude angle of viewer�

�ELEV Increase elevation angle of viewer�

�ZOOM Increase size of object�

Page 47: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure ��� Example of the �D Surface �Viewer�

14801500

15201540

15601580

1100

1150

1200

1250

1300

1350

0

50

100

150

200

250

300

EXIT +ROT. +ELEV. +ZOOM LEFT UP STEEPER

? -ROT. -ELEV. -ZOOM RIGHT DOWN FLATTER

PRINT ANGLE DEFAULT LINEAR FAST STYLE 360

Page 48: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

LEFT View further to the left of the object�

UP View further above the object�

STEEPER Increase importance of Zdimension �vertical��

Explanation of menu options�

ROT Decrease longitude angle of viewer�

ELEV Decrease elevation angle of viewer�

ZOOM Decrease size of object�

RIGHT View further to the right of the object�

DOWN View further below the object�

FLATTER Decrease importance of Zdimension �vertical��

PRINT Output displayed �D surface to PostScript output �le�

ANGLE Keyboard entry of arbitrary viewing angles�

DEFAULT Reset default view angles and zoom factor�

LOG Logarithmic image intensity scaling� When selected this button is replaced by LINEARto allow selection of linear intensity scaling�

FAST Fast mode of display� lower resolution and few colours are displayed� This results inmany fewer polygons being calculated so display is much faster� This is useful for �ndingthe best viewing angle� When the required view has been found the display style can bereset to NORMAL�

STYLE Control of �D surface display diagram style� This starts a submenu which is described below�

��� ��� degree rotation in longitude in �� degree steps� �Note� This may take some time onolder systems and there is no cancel button ��

The STYLE button starts a submenu which controls style aspects of the �D surface display�This submenu is shown in Figure ���

Figure ��� �D Surface Style Control Menu

EXIT

?

HELP

LIMITS

LINES

NO FILL

AXES

TOP IMAGE

LOW IMAGE

The style submenu has the following commands�

Page 49: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

EXIT Exit style submenu�

Explanation of menu options�

HELP Help text�

LIMITS Set output pixel resolution limit and number of colours�

LINES Draw �D lines on surface around the rebinned pixels�

FILL Fill areas of �D surface with colour�

AXES Draw enumerated axis around the �D surface�

TOP IMAGE Add �D projected false colour image above �D surface�

LOW IMAGE Add �D projected false colour image below �D surface�

��� The GUI OPTIONS Command

The OPTIONS menu allows the style of the displayed false colour image to be altered� Thesubmenu is shown in Figure � �

Figure � � The Graphics Display Style Options Menu

EXIT ? COLOURS

GRID POSITION ROTATE LUT

TITLE X-AXIS LABEL Y-AXIS LABEL

Z-AXIS LABEL Z-SCALING ASPECT RATIO

NO LUT

The following command are available�

EXIT� Exit OPTIONS menu

� Explanation on each of the menu options

COLOURS� Choice of di�erent colour tables e�g� grey scale inverse grey scale �black is moreintense� �temperature�� Several of the di�erent colour tables are shown throughout thismanual�

CURVE STYLES� Allows the style of curves to be altered� Each set of data coordinatesmay be displayed by a line through the coordinates markers drawn at the coordinatesand error boxes drawn around the coordinates� �Error boxes will only be drawn if errorestimates are de�ned�� All aspects of the lines and markers may be set� e�g� line type�solid dotted dashed dotdashed� line widths colours and marker types �� choices��If the markers de�ne closed shapes the interiors may be optionally �lled with a di�erentcolour�

Page 50: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

GRID� Add or remove horizontal and vertical grid lines to the image display� Both coarse�every large axis tick mark� and �ne �every small axis tick mark� grid lines may be set�

POSITION� Change the position for the image display in the graphics window� This allowsyou to change the size of the image display or other graphics within the graphics window�You click on opposite corners of the position where the image should be displayed� Thecoordinates input are those of the maximum region used for the axes frame of the imagecontour plot or graph� Since the title and axis label positions are �attached� to the axesframe this also changes their position� Note� This is a maximum size if correct aspectratio display is being used �the default� the actual region may be smaller if the imageaspect ratio is not the same as the region�

ROTATE LUT� Change cyclically the colours used to display di�erent intensity levels� Thiscan emphasise di�erent features in the data�

TITLE� Change the title of the image�

XAXIS LABEL� Change the text used to label the Xaxis of the image�

YAXIS LABEL� Change the text used to label the Yaxis of the image�

ZAXIS LABEL� Change the text used to label the intensity scale �Zscale� of the image�This is drawn with the lookup table intensity scale

ZSCALING� Change the mapping of data values to pixel colours �see Section �� for furtherdetails��

ASPECT RATIO� Change the �aspect ratio� for image display� By default pixels are drawnsquare so if the ADR is rectangular the image is rectangular� When many more pixelsare de�ned in one direction than the other it can be more useful to allow the pixels tobe rectangular and allow the image to �ll the full region available� These modes can betoggled�

NO LUT� Don�t draw the intensity scale colour bar or �lookup table�� When clicked thisis replaced by the button DRAW LUT�

The CURVE STYLES command allows the output style of �D datasets to be controlled� Adataset may be drawn with a series of lines through the coordinates a series of markers andif error estimates are de�ned as a series of error boxes� The CURVES OUTPUT STYLESCONTROL FORM shown in Figure �� Page � allows the output styles to be set forindividual curves� �Up to � di�erent curve styles may be set although generally in FIT�Donly � or � �D datasets are output at a time��

If lines are to be output the LINE OUTPUT STYLE CONTROL FORM appears� Thisis shown in Figure �� Page �� This allows the following attributes of the line to be set�

LINE TYPE� Type of line drawn between the coordinates�

�� Solid line

�� Dashed line

�� Dotted line

Page 51: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

Figure ��� The Curves Output Styles Control Form

CURVES OUTPUT STYLESCONTROL FORM

O.K. CANCEL ? HELP INFO

DESCRIPTIONS VALUES CHANGE

FIRST CURVE TO SET

OUTPUT STYLE

LAST CURVE TO SET OUTPUT

STYLE

OUTPUT LINE THROUGH

COORDINATES

DRAW MARKERS AT

COORDINATE POINTS

DRAW ERRORS BOXES (IF

ERRORS DEFINED)

11

YES

NO

NO

FIRST CURVE

LAST CURVE

DRAW LINE

DRAW MARKERS

DRAW ERRORS

Click on variable to change, or ’O.K.’

�� Dotdash line

COLOUR� Colour of line� Choice of primary and secondary colours white and black�

WIDTH� Scale factor for line thickness� �Graphics terminals are too low resolution to seethe di�erence in thickness except for very thick lines but lines will appear thicker onPostScript hardcopy output��

CLOSE� Whether a line should be drawn from the last data point to the �rst data point�usually not��

INTERPOLATION� Type of interpolation to use to draw the line between the data points�

� �� Linear i�e� straight lines

� �� Cubic spline i�e� smooth lines going through the data points but with the maximum and minimum possibly going outside the range set by the two coordinates�

� �� Piecewise monotonic i�e� smooth lines going through the data points and withthe maximum and minimum within the range set by the two coordinates�

Page 52: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

Figure ��� The Line Output Style Control Form

LINE OUTPUT STYLECONTROL FORM

O.K. CANCEL ? HELP INFO

DESCRIPTIONS VALUES CHANGE

LINE TYPE FOR DRAWING

THROUGH POINTS

COLOUR OF LINES TO DRAW

SCALE FACTOR FOR LINE

WIDTHS

CLOSE LOOPS FROM LAST

POINT TO FIRST

TYPE OF INTERPOLATION

METHOD

1BLACK

1.000000

NO

0

LINE TYPE

COLOUR

WIDTH

CLOSE

INTERPOLATION

Click on variable to change, or ’O.K.’

If markers are to be output the MARKERS OUTPUT STYLE CONTROL FORMappears� This is shown in Figure �� Page �� This allows the following attributes of themarkers to be set�

MARKER� Type of marker�

�� Dot ��� �Not scalable�

�� Cross ���

�� Asterisk ���

�� Circle �o�

� Diagonal cross �X�

�� Square

�� Rotated square �Kite�

�� Triangle �Base a bottom�

Page 53: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

�� Triangle �Point a bottom�

��� Sixpointed star

��� Convolution sign �circle with diagonal cross�

��� Circle with cross

��� Two coloured cross

COLOUR� Colour of lines used for drawing markers�

SIZE� Size scale factor�

WIDTH� Line width scale factor of lines used to draw markers�

FILLED� Whether or not the interior of markers which de�ned a closed area is to be �lledwith colour�

FILL COLOUR� The colour used to �ll the interiors of any �lled markers�

Figure ��� The Markers Output Style Control Form

MARKERS OUTPUT STYLECONTROL FORM

O.K. CANCEL ? HELP INFO

DESCRIPTIONS VALUES CHANGE

MARKER TYPE FOR DRAWING

COORDINATES

COLOUR OF MARKERS TO

DRAW

SCALE FACTOR FOR MARKER

SIZES

LINE WIDTH FOR DRAWING

MARKERS

FILL INTERIOR OF MARKERS

FILL COLOUR FOR MARKER

INTERIORS

2BLUE

1.500000

2.000000

YES

YELLOW

MARKER

COLOUR

SIZE

WIDTH

FILLED

FILL COLOUR

Click on variable to change, or ’O.K.’

Page 54: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

If error boxes to be output the ERROR BOXES OUTPUT STYLE CONTROL FORMappears� This is shown in Figure �� Page � This allows the following attributes of the errorboxes to be set�

BOX TYPE Type of representation for the error estimates�

� �� Cross hair

� �� Kite

� Rectangle

Note� If the error estimates are only de�ned in one direction these are all drawn the same�

LINE TYPE Type of line used to drawn the error boxes�

�� Solid line

�� Dashed line

�� Dotted line

�� Dotdash line

COLOUR� Colour of lines used for drawing the error boxes�

WIDTH� Line width scale factor of lines used to draw the error boxes�

��� The GUI MOVEMENT Command

TheMOVEMENT command allows easy �movement� within a large image� i�e� The user canzoomin to a small subregion of the image and change the position of the subregion to movearound the image� This is very useful for examining large images� This menu is also obtainedby using the IMAGE command from with the �KEYBOARD� menu� The MOVEMENT submenu is shown in Figure � Page ���

The commands available are�

EXIT� Exit submenu and return to calling menu�

LTOP� Move to the top lefthand corner of the current de�ned data image�

TOP� Move to top of the current de�ned data image�

RTOP� Move to the top righthand corner of the current de�ned data image�

OPTIONS� Enter the graphical style controlOPTIONS submenu �see Section � Page ����

� List of commands with brief description�

LUP� Move left and upwards� The centre of the displayed subregion will move to the toplefthand corner provided the data is de�ned�

Page 55: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

Figure ��� The Error Boxes Output Style Control Form

ERROR BOXES OUTPUTSTYLE CONTROL FORMO.K. CANCEL ? HELP INFO

DESCRIPTIONS VALUES CHANGE

ERROR BOX TYPE FOR

COORDINATES

LINE TYPE FOR DRAWING

ERROR BOXES

COLOUR OF ERROR BOXES TO

DRAW

LINE WIDTH FOR DRAWING

ERROR BOXES

1

2RED

1.800000

BOX TYPE

LINE TYPE

COLOUR

WIDTH

Click on variable to change, or ’O.K.’

UP� Move upwards� The centre of the displayed subregion will move to the top edge providedthe data is de�ned�

RUP� Move right and upwards� The centre of the displayed subregion will move to the toprighthand corner provided the data is de�ned�

ZOOM IN� Zoom in to a new smaller subregion by interactive graphical coordinate clicking�

FARLEFT� Move to the left edge of the current de�ned data image�

LEFT� Move left� The centre of the displayed subregion will move to the left edge providedthe data is de�ned�

CENTRE� Move to the centre of the de�ned data image�

RIGHT� Move right� The centre of the displayed subregion will move to the right edgeprovided the data is de�ned�

FARRIGHT� Move to the right edge of the current de�ned data image�

Page 56: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

UNZOOM� Make the ROI bigger symmetrically about the existing ROI if possible� Thesize is increase by � pixels or by ��� whichever is the larger�

LDOWN� Move left and downwards� The centre of the displayed subregion will move tothe lower lefthand corner provided the data is de�ned�

DOWN� Move downwards� The centre of the displayed subregion will move to the loweredge provided the data is de�ned�

RDOWN� Move right and downwards� The centre of the displayed subregion will move tothe lower righthand corner provided the data is de�ned�

DISPLAY� Enter the DISPLAY submenu which contains a variety of alternative graphicsdisplay styles �see Section �� Page � ��

FULL� Set the ROI to be the whole of the de�ned data�

LBOTTOM� Move to the bottom lefthand corner of the current de�ned data image�

BOTTOM� Move to lower edge of the current de�ned data image�

RBOTTOM� Move to the lower righthand corner of the current de�ned data image�

PRINT� Save the currently de�ned graphics as a PostScript �le�

It should be noticed that the menu movement commands are arranged in a cross� The positionin the cross corresponds to the a�ect the command has in moving within the image�

��� The GUI MASK Command

The MASK command is available in a number of interfaces and will gradually be generalised� At present it is used to mask out �bad� or contaminated data pixels from regions to beintegrated or �tted�

Allowing elements to be arbitrarily included or excluded from �tting and other operations isa very powerful facility which allows much �exibility in the data analysis process� �Bad� datapoints can be excluded from operations� Optimum nonrectangular data regions can be selectedreducing calculations for �tting and other calculation intensive operations�

The �mask� is a �D area of the same size as the current data and memory arrays� Each dataelement may be �masked� or not� By default no elements are masked�

�maskedo�� areas can be de�ned graphically for small blemishes or for large regions or fromthe data values themselves by using the THRESHOLD MASK command� This allows athreshold value to be de�ned and all data elements with values above or below �as required�this value are de�ned as �maskedo��

The current ROI is displayed as a �D pixel image together with the graphical menu giving achoice of commands allowing the masking and unmasking of regions of the data� �Maskedo��pixels are displayed using a single colour� An example of this display and menu are given inFigure ���

Page 57: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

Figure ��� Example of the MASK SubMenu

1550 1600 1650 1700 1750 1800 1850 1900 1950

1550 1600 1650 1700 1750 1800 1850 1900 1950

150

200

250

300

350

150

200

250

300

350

/data/a/hammersl/POWDER/LIABW2.INF

Columns

Row

s

0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2

*10E4Intensity

EXIT ? CLEAR MASK ZOOM IN

UN-ZOOM FULL UN-ZOOM MASK PEAKS (5) MASK PEAKS (9)

MASK PEAKS (15) MASK PEAKS (27) MASK POLYGON UN-MASK POLYGON

UPDATE DISPLAY Z-SCALING MASK ARC THRESHOLD MASK

Page 58: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

The available choices are�

� EXIT� Exit from MASK submenu and return to calling menu�

� � Display list of commands with a short description�

� CLEAR MASK� Set all elements in the ROI to be unmasked�

� ZOOM IN� Graphical region de�nition�

� UNZOOM� Make region displayed bigger�

� FULL UNZOOM� View whole of data image�

� MASK PEAKS ���� Mask out peaks �Diameter pixels�� The user is prompted toselect graphically the centre of each peak to be masked out with a circle of diameter pixels� When �nished click within the graphical prompt box� The display is updated withthe maksed out pixels being dispalyed in the masking colour �red by default��

� MASK PEAKS ���� Mask out peaks �Diameter � pixels�� Works in the same manneras MASK PEAKS ����

� MASK PEAKS ����� Mask out peaks �Diameter � pixels� Works in the same manneras MASK PEAKS ����

� MASK PEAKS ����� Mask out peaks �Diameter �� pixels� Works in the same manneras MASK PEAKS ����

� MASK POLYGON� Coordinate de�nition of region to mask o� The user clicks on thecorners of an arbitrary polygon region� When �nished click within the graphical promptbox� The polygon is closed by a line going from the last entered coordinate to the �rst�Normally this should be a simple convex shape�

� UNMASK POLYGON� Coordinate de�nition of region to unmask� Works in thesame manner as MASK POLYGON�

� UPDATE DISPLAY� Redraw image including masked regions

� MASK ARC� De�ne an arc region to be maskedo�� If the arc is made large enough acircular region can be masked� �

� THRESHOLD MASK� Allows pixels within the ROI to be masked if they are lessthan an entered minimum threshold value or alternatively if they are greater than amaximum threshold value� First the user is prompted for LESS THAN COMPARISON� If NO is selected a greater than comparison with be used� Then the DECISIONTHRESHOLD DATA VALUE is entered� The masked o� pixels are added to anyexisting masked pixels and the display is updated�

Page 59: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

Figure ��� The GUI OUTPUT Command File Format Menu

?

CANCEL

BINARY

BSL/OTOKO

CHIPLOT

DENZO MAR

FIT2D FORMAT

GSAS

SPREAD SHEET

TIFF 8 BIT

TIFF 16 BIT

��� The GUI OUTPUT Command

The OUTPUT command allows the current ROI to be save to a user speci�ed �le� If all of thedata is to be saved make sure that the ROI is set to all of the data prior to using theOUTPUTcommand� The OUTPUT command �le format choice menu is shown in Figure ���

The presently available commands are�

� Short description of each of the available choices

CANCEL� Exit menu without saving data

BINARY� Save ROI as pure binary �dump� with a choice of data types�

BSL�OTOKO� Daresbury BSL � Hamburg OTOKO� KOHALA format

CHIPLOT� �D row or column output for X�Y graph plotting in a simple ASCII columnformat

DENZO MAR� Output format in Mar format for input to DENZO

FIT�D FORMAT� Self describing readable binary for reentry to FIT�D

GSAS� GSAS powder di�raction format

SPREAD SHEET� ASCII one line of ADR in one record

TIFF � BIT� TIFF integer pixel storage with � byte per pixel� This is suitable for exportingdata to image display programs such as xv�

TIFF �� BIT� TIFF integer pixel storage with � bytes per pixel

Depending on the format chosen further prompts and graphical forms may appear� The nameof the output �le will be de�ned�

Page 60: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

� The FILE SERIES Interface

The commands within the FILE SERIES Interface allow operations on a whole series of �les��This is also possible using macros but here the most useful operations are �hardcoded� andthis allows greater e�ciency in some cases�� Further commands are likely to be added in thenear future so you may �nd an expanded menu�

The following commands are available�

EXIT� Exits FILE SERIES interface and returns to main �scienti�c interface� menu� Note�data can be moved from one interface to another�

� Help text with short explanation of commands�

HELP� Detailed help text on the interface and the available commands�

AVERAGE� Calculates the average value from a series of input �les� See below for detailsof the speci�cation of the �le series�

COMPOSITE� Inputs a series of �les and displays them all together in a composite image�The composite image is actually formed in the main data array so can be used for dataprocessing afterwards� See below for details of the speci�cation of the �le series�

DISPLAY� Enter the GUI general display menu assuming that data has been de�ned� Thisis used to display the result of an AVERAGE or COMPOSITE operation in a varietyof di�erent styles�

EXCHANGE� transfers data from the �main program array� to the �memory array� andvice versa� This may be useful to save some data whilst another operation is overwritingthe �main program array��

INTEGRATE� Integration of a series of images from a �le series to a choice of �D scans�V������� The integration is exactly the same as the INTEGRATE command in thePOWDER DIFFRACTION interface �see Section ���� Page ���� This option isdescribed in greater detail in Section ��� Page ���

OPTIONS� Starts the general GUI OPTIONS submenu �See Section � Page ��� whichallows various display options to be modi�ed and control of the graphical output style�Used to alter the colour table etc� after data has been input�

OUTPUT� General GUI output menu� Saves the current �region of interest �ROI�� in aselected �le with a choice of �le formats�

PRINT� Save the currently displayed data image as a PostScript �le� You are prompted forthe name of the output �le to create� After the �le is fully written it may be sent to aPostScript printer for printing� Note� It can take some time to create a �le of a large �Ddataset and often even longer for the �le to be printed�

Page 61: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

��� De�ning a File Series

A �le series is a series of �les which are related to each other� FIT�D does not need to knowthe relationship but it does require that the �les are numbered in a similar manner�

The �les must all be of the same format as only the �rst �le is used to de�ne the input formatand all other �les are input in the same manner�

A large variety of numbering schemes will be successfully input but schemes based on alphabeticcharacters will not be recognised�

A typical �le series would be�

file���dat� file��dat� file���dat�

file���dat� file���dat� file���dat�

file���dat� file���dat� file���dat�

file���dat� file����dat� file���dat

An alternative scheme which is also often found is�

file���dat� file��dat� file���dat�

file���dat� file���dat� file���dat�

file���dat� file���dat� file���dat�

file���dat� file����dat� file���dat

�The former series is preferable as the directory listing command will output the �les in numerical order which will not be the case for the second series but FIT�D will input bothseries correctly��

FIT�D looks for the changing numerical part and works out whether or not the number ofcharacters used for the numerical part is �xed or changing�

The �le series is de�ned by selecting the �rst �le using the GUI �le selection tool� If the �leformat is known and fully de�ned the data will be input automatically� Otherwise one or moremenus will be presented to de�ne the �le format and parameters necessary for the input�

After input the data will be displayed and a FILE OK form will appear� If the data is notcorrect enter NO and you can select another �le or rede�ne the format� Enter CANCEL tostop the operation completely and return to the main FILE SERIES menu�

After con�rming the �rst �le input is correct you are prompted for the last �le in the series�This is not input immediately� Again you can use the CANCEL button on the �le selectionform if you don�t what to continue the operation�

Next you are prompted for the FILE INCREMENT� �For some operations this value is partof a larger graphical value form�� This is the increment to increase the �le �number� for eachinput� If all �les in a simple series are to be input this number should be �� However ifonly every second �le is required then enter �� This increment is generally intended to allow

Page 62: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

skipping of �les however some series are de�ned in a �confusing� manner� e�g� if the following�les exist�

file���dat� file��dat� file���dat�

file���dat� file���dat� file���dat�

file���dat� file���dat� file���dat

but no �les in between� Selecting file ��dat as the �rst �le and file ��dat as the last �lewill make FIT�D think there are �� �les to input� However de�ning the �FILE INCREMENT�as �� allows the correct �les to be input�

The �le series is then de�ned� If any �les are missing in the series a warning prompt will appearwith the name of the missing �le and the OK button must be clicked before the operationwill continue�

The e�ect of missing �les will depend on the operation but in general the operations will tryto continue and leave blank any a�ected region or not include the data in the case of theAVERAGE operation�

��� De�ning a Composite Image

It is often useful to display a whole series of images together� This can be achieved in a verygeneral manner using the COMPOSITE command� An example of such a composite image isshown in Figure ��� The �les containing the data are de�ned as explained above� In additiona graphic form allows a number of options�

SUBTRACT� Allows a background image to be input from �le and subtracted from eachimage input in the series prior to further operations�

ROI� Allows interactive graphical selection of a small region to be input and used to built upthe composite image� If ROI is not selected the whole of the input images is used�

INCREMENT� Increment number between input �les �see above��

NO PER ROW� Number of input images to be displayed together on one row of thecomposite image� The number of rows is calculated automatically from the number of�les and the number per row�

REBIN NO� This is the factor by which the input image pixels should be rebinned �inboth directions� before being assembled into the composite image� If many images arebeing input fully it is recommended to rebin them to reduce the computer memoryrequirements�

If SUBTRACT is YES then the �le selection tool will help you input an image to be subtracted from each of the �le series images� The �le format must be the same�

If ROI is YES the �FIT�D� REGION OF INTEREST MENU� will appear� The ZOOM INbutton can be used to select a subregion� Coordinates of the region may be entered graphically

Page 63: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure ��� An Example of a COMPOSITE Image

0 5 10 15 20 25 30

0 5 10 15 20 25 30

70

75

80

85

90

95

100

70

75

80

85

90

95

100

file_001.bin to file_016.bin

Columns

Row

s

1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5

*10E4Intensity

Page 64: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

or by clicking the KEYBOARD button and entered from the keyboard� The other buttonsallow unzooming if the original choice was not correct� When satis�ed click on the EXITbutton�

If the size of the data array needed to construct the composite image is larger in either dimensionthan the current program array sizes then you will be promptedDESTROYANDCREATEBIGGER PROGRAMARRAYS� If you answerYES any current data and �memory� datawill be lost and the program array sizes will be set exactly to the size necessary for thecomposite image Entering NO will abort the operation� Assuming the computer memoryis available the operation will start inputting data otherwise an error message will appear�

When the data has been input the composite image is displayed as a false colour image� Thedata is in the main program array so operations such as DISPLAY may be used to changethe display style� The FILE SERIES menu can also be exited and the data can be analysedwithin another interface�

��� Integrating a Series of Images

The INTEGRATE command is equivalent to the INTEGRATE command within thePOWDER DIFFRACTION INTEGRATE command �See Section ����� Page �� ��

First you need to know geometrical parameters e�g� beam centre and detector tilt angles� Forthis you may want to �rst input data and treat it within the POWDER DIFFRACTIONinterface�

The FILE SERIES INTEGRATE command prompts for the �rst and last �le in the seriesas with the other commands� A detector distortion correction form allows optional correctionof nonuniformity of response and spatial distortion� The �rst image in the series will be inputand corrected as speci�ed�

The masking menu appears automatically and allows both masking and selection of a subregionwith the ZOOMIN command� When satis�ed click OK

The experiment geometry and the integration control forms are presented for completion� Thereis the option to save each �D integrated scan to an output �le as the integration is completed�If this option is selected the output �le type and the �le extension will be asked� The output�les will have the same base name as the input �les�

Once the menus and forms have been completed the integration of the �rst image will proceedand the same treatment will then be repeated automatically for all subsequent images in thede�ned �le series� Each �D integrated scan is displayed as the data is integrated� At the endthe whole of the scans are left as a �D image in the main data array� The Xdirection is the�� direction and the Ydirection has the direction scans with the �rst at the bottom� Thisdata can be saved or used for further analysis�

Often there will be many more pixels in the horizontal direction than in the vertical �the scans��The output will be a thin rectangle and details may not be seen� To see the full detail use theOPTIONS menu command ASPECT RATIO to turn o� the automatically correct aspectratio� The image will then �ll the whole of the current image output area�

Page 65: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

An example of the results left in the main program array after the INTEGRATE commandare shown in Figure ���

Page 66: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure ��� An Example of the Results of the INTEGRATE Command

0 100 200 300 400 500 600 700 800 900 1000

0 100 200 300 400 500 600 700 800 900 1000

0

5

10

15

20

25

30

35

40

0

5

10

15

20

25

30

35

40

Synthesis of High Tc Superconductor

2-Theta Angle (bins)

Scan

s

80 100 120 140 160 180

Intensity

Page 67: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

� The IMAGE PROCESSING GENERAL� Interface

The IMAGE PROCESSING �GENERAL� interface contains general commands for operations which manipulate images such as adding dividing transposing and �ltering� Theseare the typical commands you will �nd in any image processing software� The IMAGE PROCESSING �GENERAL� main menu is shown in Figure ���

The following commands are available �in order displayed in the menu from left to right topto bottom��

EXIT� Exits the IMAGE PROCESSING �GENERAL� interface and returns to main�scienti�c interface� menu� Note� data can be moved from one interface to another�

DISPLAY� Enter the GUI general display menu assuming that data has been de�ned� Thisis used to display the data in the current program array in a variety of di�erent styles�

EXCHANGE� transfers data from the �main program array� to the �memory array� andvice versa� This may be useful to save some data whilst another operation is overwritingthe �main program array��

FILTER� starts a submenu which allows various �ltering and smoothing of the data �seesubsection below��

� Help text with short explanation of commands�

FULL� Sets the extent of the �region of interest �ROI�� or �active data region �ADR�� tobe the whole of the currently de�ned data� This may be useful after the �ZOOMIN�command�

GEOMETRIC� starts the Geometric operations submenu which allows various transformations to be applied to the data �see subsection below��

INPUT� starts an interactive �le selection tool to allow selection of directories and of a �lefor input �see Section �� Page ����

HELP� Detailed help text on the interface and the available commands�

OPTIONS� Starts the general GUI OPTIONS submenu which allows various display options to be modi�ed and control of the graphical output style� Used to alter the colourtable etc� after data has been input �see Section � Page ����

OUTPUT� General GUI output menu� Saves the current �region of interest �ROI�� in aselected �le with a choice of �le formats�

MATHS� starts a submenu which allows various unitary and binary mathematical operationsto be performed pixel by pixel on the data�

PRINT� Save the currently displayed data image as a PostScript �le� You are prompted forthe name of the output �le to create� After the �le is fully written it may be sent to aPostScript printer for printing� Note� It can take some time to create a �le of a large �Ddataset and often even longer for the �le to be printed�

Page 68: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure ��� The IMAGE PROCESSING �GENERAL� Main Menu

1270 1280 1290 1300 1310 1320 1330 1340 1350

1270 1280 1290 1300 1310 1320 1330 1340 1350

930

940

950

960

970

980

990

1000

1010

1020

1030

930

940

950

960

970

980

990

1000

1010

1020

1030

olivine_1_002.image

Columns

Row

s

0.2 0.4 0.6 0.8 1.0 1.2

*10E4Intensity

EXIT DISPLAY EXCHANGE FILTER

? FULL GEOMETRIC INPUT

HELP OPTIONS OUTPUT MATHS

PRINT MOVEMENT UN-ZOOM ZOOM IN

Z-SCALING

Page 69: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

MOVEMENT� starts a submenu which allows movement within the currently de�ned data�

UNZOOM� increases the size of the current �region of interest� �ROI��

ZOOMIN� allows a subregion of the data to be selected and displayed� It should be notedthat all operations including OUTPUT only work on the current selected region� Care needs to be taken when using ZOOMIN that subsequent operations areintended for only the current subregion� The full available data region may be selectedby using the FULL button�

ZSCALING� starts a submenu which allows the false colour� grey scale used to displayimage intensities to be changed� Di�erent automatic and �xed scaling methods can beselected�

��� The FILTER Sub�Menu

The FILTER submenu contains commands which allow �ltering and smoothing of data��Other commands exist in the �KEYBOARD MENU� which allow other forms of �ltering��The FILTER submenu is shown in Figure � �

Figure � � The FILTER SubMenu Commands

EXIT

?

HELP

EXCHANGE

FULL

MEDIAN

SMOOTH

ZOOM IN

The available commands and their functions are�

EXIT� Leave FILTER submenu and return to IMAGE PROCESSING �GENERAL�main menu�

EXCHANGE� transfers data from the �main program array� to the �memory array� andvice versa� This may be useful to save some data whilst another operation is overwritingthe �main program array��

SMOOTH� Apply a tophat smoothing function of speci�ed size to the current region ofinterest� Tophat smoothing is the convolution of the data with a rectangular region ofuniform intensity ���� divided by the number of pixels in the rectangle�� This is a lowpass�lter and will �lter out noise and high spatial frequencies� You are prompted for X BLUR

SIZE and Y BLUR SIZE� This de�nes the size of the tophat function in the X and the Ydirections� The original data is transferred to the memory whilst the current data arraycontains the smoothed data after the operations is completed�

� Help text with short explanation of commands�

Page 70: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

FULL� Sets the extent of the �region of interest �ROI�� or �active data region �ADR�� tobe the whole of the currently de�ned data� Note� the �ltering commands only a�ect thecurrent region of interest�

ZOOMIN� allows a subregion of the data to be selected and displayed� It should be notedthat all operations only work on the current selected region�

HELP� Detailed help text on the interface and the available commands�

MEDIAN� Applies �median� �lter of user speci�ed size� Median �ltering is replacingeach data value by the median value in a rectangular region centred on the pixel� Thisis a nonlinear �ltering which �lters out noise whilst tending to preserve edges and othersharp features better than tophat smoothing� The user is prompted for the MEDIAN

FILTER X�SIZE and the MEDIAN FILTER YSIZE� This de�nes the number of pixelsused to de�ne the rectangle around each pixel for the calculation of the median value�The original data is transferred to the memory whilst the current data array containsthe smoothed data after the operations is completed�

��� The GEOMETRIC Sub�Menu

The GEOMETRIC submenu contains commands which allow geometrical transformationsto be applied to the current region of interest� �Other commands exist in the �KEYBOARDMENU� which allow other transformations such as rebinning�� TheGEOMETRIC submenuis shown in Figure ���

Figure ��� The GEOMETRIC SubMenu Commands

EXIT

?

HELP

EXCHANGE

EXTEND

FLIP

FULL

TRANSPOSE

ZOOM IN

The available commands and their functions are�

EXIT� Leave GEOMETRIC submenu and return to IMAGE PROCESSING �GENERAL� main menu�

EXCHANGE� transfers data from the �main program array� to the �memory array� andvice versa� This may be useful to save some data whilst another operation is overwritingthe �main program array��

EXTEND� Allows the size of the de�ned data to be increased� Normally the size is de�nedwhen the data is input from �le but it may be useful to make the number of de�nedpixels arti�cally larger� This command inputs the new size in the X and Ydirections and

Page 71: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

extends the image� The new pixels are set to zero� If a variance array exists the pixelsare also set to zero�

TRANSPOSE� Transpose elements of the current region of interest� The X and Yaxisvalues and labels are also swapped� The transposed data is output replaces the originaldata which is saved in the �memory��

� Help text with short explanation of commands�

FLIP� Swaps pixels in the current region of interest from left to right and�or from top tobottom as speci�ed by the user� The operation is performed inplace� Note� If ZOOMIN is used to de�ne a subregion FLIP swaps the pixels and FULL is used a strangee�ect will result since only part of the full region will have been a�ected�

ZOOMIN� allows a subregion of the data to be selected and displayed� It should be notedthat all operations only work on the current selected region�

HELP� Detailed help text on the interface and the available commands�

FULL� Sets the extent of the �region of interest �ROI�� or �active data region �ADR�� tobe the whole of the currently de�ned data� Note� the �ltering commands only a�ect thecurrent region of interest�

��� The MATHS Sub�Menu

TheMATHS submenu contains commands which allowmathematical operations to be appliedto the pixels of the current region of interest� The MATHS submenu is shown in Figure ���

Figure ��� The MATHS SubMenu Commands

EXIT

?

HELP

SCALAR +

SCALAR /

SCALAR *

ADD

DIVIDE

LOG(10)

MULTIPLY

NORMALISE

STATISTICS

SUBTRACT

THRESHOLD

X^(n)

The available commands and their functions are�

EXIT� Leave MATHS submenu and return to IMAGE PROCESSING �GENERAL�main menu�

SCALAR �� Pixel by pixel division of the current region of interest by an input scalarvalue� The user is prompted DIVISION CONSTANT for the scalar which will be used fordivision�

HELP� Detailed help text on the interface and the available commands� The operation isperformed inplace�

Page 72: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

LOG����� Take the logarithm �base��� of all the pixel values in the current region of interest�If zero or negative values are encountered the user is prompted LOWER THRESHOLD and thevalue entered will be used as the lowest value in the output� The operation is performedinplace� �Note� This changes the data values unlike the log scaling option in the ZSCALING menu which only a�ects the display��

SUBTRACT� Subtracts pixel by pixel the image in the �memory� from the image in thecurrent data array within the current region of interest� The �memory� data must bede�ned throughout the current region of interest or a warning message will be produced�The operation is inplace�

� Help text with short explanation of commands�

SCALAR �� Pixel by pixel multiplication of the current region of interest by an input scalarvalue� The user is prompted MULTIPLICATION CONSTANT for the scalar which will be usedfor the multiplication�

MULTIPLY� Multiples pixel by pixel the image in the �memory� and the image in thecurrent data array within the current region of interest� The �memory� data must bede�ned throughout the current region of interest or a warning message will be produced�The operation is inplace� The original data is replaced by the result of the multiplication�

THRESHOLD� Allows minimum and maximum thresholding values to be set for the currentregion of interest� The user is prompted MINIMUM THRESHOLD VALUE and MAXIMUMTHRESHOLD VALUE� Values outside of the set range are replaced will the minimumor the maximum value� The original data is replaced� Note� This operation is in generalnonreversible�

HELP� Detailed help text on the interface and the available commands� The operation isperformed inplace�

ADD� Add pixel by pixel the image in the �memory� and the image in the current data arraywithin the current region of interest� The �memory� data must be de�ned throughoutthe current region of interest or a warning message will be produced� The operation isinplace� The original data is replaced by the result of the addition�

NORMALISE� Divide pixel by pixel by the largest value throughout the current region ofinterest� The original data is replaced by the result of the division�

X��n�� Calculate pixel by pixel xn where x is a user speci�ed constant and n is the valueof each input pixel� The user is prompted ENTER POWER for the value of x� If x is���� this operation is the partial inverse of the LOG���� operation� It is only a partialinverse in the case that values have been thresholded in the LOG���� operation�

SCALAR �� Pixel by pixel addition of the current region of interest with an input scalarvalue� The user is prompted ADDITION CONSTANT for the scalar which will be used forthe addition�

DIVIDE� Divides pixel by pixel the image in the current data array by the image in the�memory� within the current region of interest� The �memory� data must be de�nedthroughout the current region of interest or a warning message will be produced� Theoperation is inplace�

Page 73: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

STATISTICS�

Allows the user to de�ne an arbitrary polygon region with graphical coordinate inputand calculates a number of statistics in the region� If only two coordinates are input theyde�ne opposite corners of a rectangular region for the calculation� The result is displayedin a text window and can be saved to an output �le�

A typical result of the STATISTICS operation is shown below�

Extremes of polygon �X�Y min� X�Y max� �

����� ������ ������ �������

Number of pixels inside polygon � ���

Smallest value � ����� Largest value � �����

Total intensity � ����� �square root � ���� �

Average intensity � ������

Root Mean Square �RMS� value � ������

Standard Deviation � ������E� Gain ��� � ������E��

Integrated intensity minus previous average � �����

Square root of above � �����

The Integrated intensity minus previous average contains the integrated sum of pixelvalues minus the previous average value� Thus if �rst a background region is de�ned and thena peak is de�ned a simple form of peak integration is performed�

�� Example of Dividing One Image by Another

As an example of a typical binary operation on images the division of image��dat by image��datwill be used� �Exactly the same logic applies to other binary operation on images��

The following steps can be used�

�� Enter the IMAGE PROCESSING �GENERAL� Interface�

�� Use the INPUT command to input data from image��dat

�� Use the EXCHANGE command to place the data in the �memory��

�� Use the INPUT command to input data from image��dat

� Use the MATHS command to enter the MATHS submenu�

�� Use the DIVIDE command to divide the current data by the �memory� data�

The result is left in the current data array and the image��dat data is left in the memory�

Note� The images can be input in the reverse order but an additionalEXCHANGE commandwill 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�

Page 74: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

� The MACROS � LOG FILE Interface

The MACROS � LOG FILE Interface is a support interface which allows creation andrunning of macros including running simple macros on whole sequences of �les and the creationof log �les of the FIT�D output and user input� The main menu is shown in Figure ���

Figure ��� The MACROS � LOG FILE Menu Commands

EXIT

?

HELP

CREATE MACRO

STOP MACRO

RUN MACRO

RUN SEQUENCE

OPEN LOG FILE

CLOSE LOG FILE

EXIT� Leave the MACROS � LOG FILE submenu and return to the interfaces menu�

CREATE MACRO� Open a user speci�ed �le and start saving a macro of the current seriesof operations� The user is prompted with the name of a �le in which to save the macro�fitd�mac by default�� Enter YES to use the suggested �le or NO to select another�le using the �le selection tool� See Section ��� Page � for full details on creating andusing simple macros�

RUN SEQUENCE� Run a user speci�ed macro on a series of �les� At present this onlyallows for relatively simple macros i�e� macros which work on zero or one input �le andzero or one output �le� This covers most real cases but more complicated macros canbe run using the SEQUENCE command in the �KEYBOARD� Interface� The userselects the macro �le to run using the �le selection tool and the �rst and last �les inthe sequence� The user is then prompted FILE INCREMENT which is the step betweeninputting �les in the sequence� Normally this will be � but to skip every other �le thevalue � would be entered� The OUTPUT FILES EXTENSION is then de�ned� If the macroincludes input and output �les the output �les will be created in the same directory andwith the same �le names as the input �les but a di�erent �le extension will be used�Here the �le extension for the output �les is de�ned� If no output �les are de�ned thenthis value can be ignored�

� Help text with short explanation of commands�

STOP MACRO� Closes a previously opened macro �le� stops the recording of a sequence ofoperations� See Section ��� Page � for full details on creating and using simple macros�

OPEN LOG� Open a user speci�ed �le and start saving a macro of the current series ofoperations� The user is prompted with the name of a �le in which to save the macro�fitd�log by default�� Enter YES to use the suggested �le or NO to select another�le using the �le selection tool�

HELP� Detailed help text on the interface and the available commands�

Page 75: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

RUN MACRO� Run a macro once� The �le selection tool is used to select the macro �leto run� Whilst it must be done manually a single macro �le can be set up to run on awhole sequence of input and�or output �les�

CLOSE LOG FILE� Close a previously opened log �le� stop outputting a record of theFIT�D output and user input to a �le�

��� Creation and Using Simple Macro Files

Often it is necessary to process a large number of �les using the same sequence of data analysisoperations� This task is made much easier through �macro� �les and the RUN SEQUENCEcommand� Here macros are designed to do the simple job of inputting data from one �le andoutputting it in another �although the output �le can be missing��

To create the macro �le perform the following steps�

�� Enter the MACROS � LOG FILE interface

�� Select the CREATE MACRO command and de�ne the name of the �le to contain themacro�

�� EXIT the MACROS � LOG FILE interface and perform the full sequence of inputanalysis and output commands on one of the �les in the sequence� Be careful to makesure all values which may change or remember defaults are set� �Normally the user canrely on most default values but for the macro to be really robust it is better to spendthe time setting the values so the macro contains all the necessary values and there isno reliance on default values which may be wrong�

�� EXIT whichever interface you have been using and reenter the MACROS � LOGFILE interface�

� Select the STOP MACRO command to �nish recording the sequence�

�� Edit the �le with you favourite editor �you can use �Control��Z to use the sameterminal window as FIT�D and then fg to return to FIT�D or work from anotherterminal window�� Replace the input �le name with the �symbol� �IN and any output�le name with �OUT�

The macro is now ready to be run�

The macro can be run repeatedly on a series of �les by using theRUN SEQUENCE command�See Section ��� Page �� for details of allowable �le series� The macro �le to run is selected asare the �rst and last �les in the series� The �increment� between input �le is input� Files ina series must be named with a changing numerical part� This is automatically recognised andthe �rst and last numbers in the series de�ned� To process every �le between these numbers�assuming the �les exist� enter � �or � in the case that the last �le has a larger number than the�rst�� To skip alternate �les enter � �or �� and so on� If for some reason all the �les have anextra � after the changing numerical part e�g� they are numbered file ��dat� file �dat�

file ��dat etc� enter ���

Page 76: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

The RUN SEQUENCE command will automatically generate the input �le names from thisinformation and they will replace the �IN �symbol� which has been placed within the macro�

If the macro de�nes an output �le using the �OUT �symbol� then the command will alsogenerate the series of output �le names� These are the same as the input �le names but witha user speci�ed extension replacing any extension of the input �les� The last user input beforethe macro is automatically run is OUTPUT FILE EXTENSION which is the output �le extensionused to form the output �le names� The generated output �le names automatically replace the�OUT �symbol� each time the macro is run in the sequence�

The progress of the macro is output in the terminal window�

Page 77: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

� The MFIT MULTIPLE �D FITTING� Interface

Both �D and �D models may be �tted to experimental data using a variety of minimisationmethods� �D model �tting is available within the MFIT �MULTIPLE �D FITTING�interface� This interface contains the equivalent of the MFIT program ���� ��D �tting isavailable in the �KEYBOARD� interface within the FIT submenu�� An example of thegraphics output and the main menu is shown in Figure �� Page ���

Figure ��� The MFIT �MULTIPLE �D FITTING� Main Menu

0 100 200 300 400 500

-40-20

02040

Columns

Res

idua

ls

0 100 200 300 400 500

50

100

150

200

250

300

Simulated Data

Inte

nsity

EXIT FULL OUTPUT ?

CONSTRAINTS INITIALISE INPUT HELP

Z-SCALING PRINT EXCHANGE MASK

ZOOM IN DISPLAY OPTIONS OPTIMISE

RESULTS SET-UP

The main menu contains the following commands�

EXIT� ExitsMFIT �MULTIPLE �D FITTING� interface and returns to main �scienti�cinterface� menu� Note� data can be moved from one interface to another�

FULL� Sets the extent of the �region of interest �ROI�� or �active data region �ADR�� tobe the whole of the currently de�ned data� Note� the �ltering commands only a�ect thecurrent region of interest�

OUTPUT� General GUI output menu� Saves the current �region of interest �ROI�� in aselected �le with a choice of �le formats�

� Help text with short explanation of commands�

Page 78: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

CONSTRAINTS� Allows individual �tting parameters to be constrained to �xed values orleft free to evolve�

INITIALISE� Interactive graphical de�nition of a �t model� With a choice of �tting functions� �See Section ��� Page ����

INPUT� starts an interactive �le selection tool to allow selection of directories and of a �lefor input �see Section �� Page ����

HELP� Detailed help text on the interface and the available commands�

ZSCALING� starts a submenu which allows the false colour� grey scale used to displayimage intensities to be changed� Di�erent automatic and �xed scaling methods can beselected�

PRINT� Save the currently displayed data image as a PostScript �le� You are prompted forthe name of the output �le to create� After the �le is fully written it may be sent to aPostScript printer for printing�

EXCHANGE� transfers data from the �main program array� to the �memory array� andvice versa� This may be useful to save some data whilst another operation is overwritingthe �main program array��

MASK� Interactive graphical de�nition of data regions to be masked o� �or unmasked��Masked pixels and elements are ignored in the �tting�

ZOOMIN� allows a subregion of the data to be selected and displayed� It should be notedthat all operations only work on the current selected region�

DISPLAY� Enter the GUI general display menu assuming that data has been de�ned�

OPTIONS� Starts the general GUI OPTIONS submenu which allows various display options to be modi�ed and control of the graphical output style� Used to alter the colourtable etc� after data has been input�

OPTIMISE� Tries to optimise the �t model to the data values� This button may be pressedmore than once�

RESULTS� Display of the �tted model parameters� This is displayed in a text window andmay be saved to an output �le�

SETUP� Graphical form allowing setting of control parameters�

TRANSPOSE� Transpose data so that columns before the rows and vive versa� The �ttingworks on the rows so the TRANSPOSE command is necessary to �t the column wisedata�

��� Entering an Initial Model and Model Optimisation

Fit models may be de�ned using the INITIALISE submenu� A �t model may be constructed from an arbitrary number of peak functions �Gaussian Lorentzian and Voigt� and

Page 79: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure ��� The INITIALISE SubMenu

EXIT

?

HELP

EXP. DECAY

GAUSSIAN

LORENTZIAN

POLYNOMIAL

SINUSOIDAL

VOIGTIAN

UN-ZOOM

ZOOM IN

trigonometric or exponential decay functions and a polynomial function of speci�ed order� TheINITIALISE submenu is shown in Figure �� Page ���

A model is built up by successfully selecting a function type to add to the model� e�g� To adda Gaussian peak function to the model�

�� Select the GAUSSIAN button�

�� The message CLICK ON PEAK TOP appears and the graphics cursor is active� Youshould click reasonable accurately on the estimated top of the peak� This position is usedfor the initial peak position and as part of the initial peak height calculation�

�� The message CLICK ON PEAK AT HALF HEIGHT appears and the graphicscursor is active� You should click reasonable accurately on the estimated side of the peakat half height� Either side will do� This position together with the peak top positionis used to calculate the initial standard deviation width of the peak and it�s maximumheight�

As functions are added they are drawn on the diagram in blue�

For a general background function the POLYNOMIAL button allows an user speci�ed polynomial to be added to the model� The user is prompted for the order of the polynomial toadd and the order of the initial polynomial function to be �tted� The initial polynomial isautomatically �tted to the residuals between the data and the currently input function values�Therefore generally it is best to add any polynomial background function to the model last�

The SETUP form allows the control parameters to be varied e�g� Weighted �tting or not �provided variance arrays exist�� The CONSTRAINTS form allows individual model parametersto be constrained or set to freely vary�

The OPTIMISE button optimises the model to the data according to the current controlparameters� The �tted data is output in the �memory�� If the current region of interestcontains more than one row the subsequent rows of data will also be �tted using the �ttedparameters of the previous �t as their initial parameters�

The display of the �tted model and the data is shown in the upper X�Y graph in Figure ��Page �� and beneath is a display of the residuals� If error estimates are available for the datavalues these too will be displayed� This graphical display of the results may be saved as aPostScript �le using the PRINT button �while this is displayed in the graphics window��

Page 80: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

�� The ONLINE CRYSTALLOGRAPHY Interface

As well as an �o�line� data analysis program FIT�Dmay be used as an �online� data displayand manipulation program� Figure �� page �� shows the ONLINE CRYSTALLOGRAPHY interface� Data may be input and displayed as with the other menus and additionallythe AUTO INPUT button allows �les in a sequence to be automatically input and displayedas they are saved by the data acquisition system� An optional �alarm� may be set which willring if the time for an image to appear is greater than a speci�ed length�

Figure ��� The ONLINE CRYSTALLOGRAPHY Main Menu

EXIT

?

HELP

AUTO INPUT

DISPLAY

EXCHANGE

FULL

INPUT

OPTIONS

MOVEMENT

PRINT

UN-ZOOM

ZOOM IN

Z-SCALING

NEXT FILE

PREV FILE

SET GEOMETRY

PEAK SEARCH

SPY-GLASS

EXIT� Exit Interface and return to main interfaces menu

EXCHANGE� Swap current data with the �memory�� see Section �� Page ���

PRINT� Output current graphics to a PostScript �le�

PREV FILE� Input �previous� �le in a �le sequence�

� List of commands with short descriptions�

FULL� View image of full data� set the ROI to be the whole of the de�ned data�

UNZOOM� Zoom out to see more of the data� �Also changes the ADR��

SET GEOMETRY� De�ne di�raction geometry i�e� beam centre wavelength sample todetector distance� This must be de�ned if the corresponding dspacings of di�ractionpeaks are to be calculated�

HELP� Detailed help text�

INPUT� Input data from a �le on disk� This de�nes the �le type and may be the size forfurther input using the �NEXT FILE� or �PREV FILE� commands� see Section ��Page ���

ZOOM IN� View a smaller region in greater detail� �Also changes the ADR��

PEAK SEARCH� Find display and calculate statistics on di�raction peaks� A number ofcontrol parameters allow the peak search to be optimised to �nd the maximum numberof genuine peaks whilst rejecting noise and other defects� The found peaks and estimatesof integrated intensities and sigmas may optionally be saved in an ASCII �le�

Page 81: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

AUTO INPUT� Automatically input �les from a sequence with option of performing a peaksearch on input and of setting an alarm if a new image is not available after a de�nedinterval�

OPTIONS� Display style control menu� see Section � Page ���

ZSCALING� Automatic or �xed user control of intensity display range� It is importantto consider whether �xed range scaling or automatic rescaling is more suitable whendisplaying a sequence of images� see Section �� Page ���

SPYGLASS� Cursor controlled �realtime� zoom window�

DISPLAY� Graphical display possibilities� see Section �� Page � �

MOVEMENT� Easily controlled movement around an image� see Section �� Page ��

NEXT FILE� Input �next� �le in a �le sequence�

MASK� Interactive masking of �bad� data regions� These are ignored in thePEAK SEARCHcommand� see Section �� Page ��

The peak search option identi�es peaks uses centroiding �with background removal� to improvethe initial peak positions calculates Dspacing and performs a simple box integration� Thisallows estimates of the number peaks with di�erent I�Sigma�I� to be displayed and if thedi�raction geometry has been de�ned the number of peaks in di�erent resolution shells and theaverage I�Sigma�I� in each shell is displayed� The peak positions Dspacings and intensitiesmay be saved to an ASCII output �le for further use e�g� Input to an indexing program�

The AUTO INPUT command allows a sequence of images to be input displayed and optionally searched for peaks and statistics output� Similarly the NEXT FILE and PREVFILE allow easy input of following or previous �les in a sequence� �All �les are assumed to beof the same format and sizes as the a �le input using the INPUT button��

Page 82: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

�� The POWDER DIFFRACTION �D� Interface

The POWDER DIFFRACTION ��D� interface allows DebyeScherrer rings which havebeen recorded of a �D detector to be integrated to the equivalent of a �theta scan with azerodimensional detector ����� An example of an input image and the main menu are shownin Figure �� Page ��� To aid with this the MASK submenu allows interactive de�nition ofmasked areas i�e� pixels which will be ignored during further operations� The TILT buttonallows the beam centre and any nonorthogonality of the detector to the main beam to bere�ned and this tilt is used by the INTEGRATE command� Other types of output arealso available� The CAKE submenu allows di�erent regions of the image to be de�ned withgraphical coordinate input for the starting azimuth end azimuth and inner and outer radii ofthe integrated region� The number of output bins in both the azimuthal and the �theta orradial direction are user speci�ed� This allows a variety of di�erent output possibilities e�g�A number of di�erent �theta scans for di�erent azimuth ranges� a �D pro�le of intensity ofa ring as a function of azimuth �e�g� for texture studies�� or a polar transform of the data�The output formats include one of the GSAS formats �� � one of the Cerius formats� and ageneral purpose ASCII two column format which may easily be edited�

The POWDER DIFFRACTION ��D� Main Menu contains the following commands�

EXIT� Exit POWDER DIFFRACTION ��D� menu and return to main interfaces menu

BEAM CENTRE� Determine beam centre by a choice of methods

FULL� View image of full data

OUTPUT� Save data in an output �le

� List of available commands with short explanations

CAKE� Versatile multiple �theta scans integration

INPUT� Input data from a �le on disk

TILT� Fit tilt and beam centre to powder rings

HELP� Help text on this graphical menu

CORRECTION� Spatial distortion correction

INTEGRATE� �D to �D �theta integration

ZSCALING� Automatic or user control of intensity display range �see Section �� Page ���

PRINT� Output current graphics to PostScript �le

EXCHANGE� Swap current data with the �memory�

MASK� De�ned maskedo� regions of the image

ZOOM IN� De�ne smaller graphical display region

�Crystallographic software package from Molecular Simulations

Page 83: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure ��� The POWDER DIFFRACTION ��D� Main Menu

200 400 600 800 1000 1200 1400

200 400 600 800 1000 1200 1400

200

400

600

800

1000

1200

1400

200

400

600

800

1000

1200

1400

ccssi001.bin

Columns

Row

s

1000 1500 2000 2500 3000 3500 4000 4500 5000 5500

Intensity

EXIT BEAM CENTRE FULL OUTPUT

? CAKE INPUT TILT

HELP CORRECTION INTEGRATE Z-SCALING

PRINT EXCHANGE MASK ZOOM IN

CALIBRANT DISPLAY OPTIONS UN-ZOOM

Page 84: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

CALIBRANT� Re�ne wavelength distance tilt etc from powder pattern with known Dspacings�

DISPLAY� Further graphical display possibilities �see Section �� Page � �

OPTIONS� Graphics display control menu

UNZOOM� Zoom out to see more of the data

���� The INPUT Command

The POWDER DIFFRACTION ��D� Interface INPUT command is di�erent from otherINPUT commands in that it has an additional graphical form to control correction of spatialdistortion and nonuniformity of intensity response on input�

The initial selection of the input �le and format is the same as the other INPUT commands�See Section �� Page �� for further information�

When the raw data has been input a graphical form similar to the one shown in Figure �� isdisplayed�

The form allows the following options�

FLATFIELD� Controls the application of a �at�eld correction to the data immediately oninput� If YES is selected the input data will be divided pixel be pixel by the data inputfrom the �le de�ned by FF FILE�

FF FILE� This uses the �le selection tool to input a �le to be used for �at�eld correction�

FF SCALE� If the �at�eld �le data has not been normalised you may want multiply thedata by a scale factor� In this case this should be set to YES� The multiplier is set withFF MULTIPLIER�

FF MULTIPLIER� The scale factor to multiply the result of any �at�elded data�

SPATIAL DIS� Control correction for spatial distortion or not� If YES then the �le de�nedby SD FILE is used to de�ne the distortion function�

SD FILE� This uses the �le selection tool to input a �le to be used for the spatial distortioncorrection�

As any spatial distortion correction is applied a progress report is output in the terminalwindow�

���� The TILT Command

The TILT command allows any nonorthogonality of the detector to the direct beam �tilt�and the direct beam centre on the detector to be determined ����� This is achieved by leastsquares �tting of powder rings �or rings from other randomly orientated samples e�g� wax��

Page 85: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

Figure ��� The Distortion Correction Control Form

CONTROL OF DETECTOR

DISTORTION CORRECTION

O.K. CANCEL ? HELP INFO

DESCRIPTIONS VALUES CHANGE

APPLY FLAT FIELD

CORRECTION

NAME OF FLAT-FIELD FILE

APPLY SCALING AFTER FLAT

FIELD CORRECTION

FLAT FIELD MULTIPLIER TO

APPLY

APPLY SPATIAL DISTORTION

CORRECTION

NAME OF SPATIALDISTORTION FILE

YES/data/a/hammers

l/POWDER/

flat_field.bin

NO

100.0000

YES/disks/g/hammer

sl/TEMP/

grid105.spline

FLAT-FIELD

FF FILE

FF SCALE

FF MULTIPLIER

SPATIAL DIS.

SD FILE

Click on variable to change, or ’O.K.’

Page 86: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

One or more powder rings are used to re�ne beam centre and nonorthogonality parameters�This form allows a number of choices in the manner in which this works�

This operation works on the current selected data region and does not take into account�maskedo�� data� You may want to use theMASK command to masko� data prior to usingthe TILT command� Or if problems are encountered during the TILT evaluation problemdata regions may be identi�ed and maskedout prior to another try with TILT�

An initial approximate beam centre is obtained from a choice of methods� This beam centreis then used to de�ne a search region around one powder ring� This ring should be strong andwell de�ned� The whole of the ring should be within the search region through the de�nedazimuthal range�

Other rings may also be selected to be used to re�ne the beam centre and tilt parameters�Ideally two or more rings should be used but one will work� Complete rings at high angle willhave the largest e�ect�

From the starting ring coordinates a best �t circle is found followed at an ellipse� The powderring section centres are recalculated for all the rings� The beam centre and tilt angles arere�ned to these positions� There is the option of rejecting badly �tting positions and re�ttingthe data�

For a given set of ellipses two possible beam centre � tilt angle combinations are theoreticallypossible and indistinghable� Only if the beam centre and� or the tilt angles are �xed is therean unique solution� If the beam centre and the tilt are being �tted you will be asked to choosebetween the two solutions� �In practice owing to the uncertainty in the data the same solutionmay be produced for both minimisations�� If there are two solutions you may be able to choosethe correct solution by other knowledge from the data e�g� scatter from the beamstop� If youcan�t choose between the solutions do not worry� the calculated twotheta angles from the datawill be the same�

First the Experimental Geometry Control Form is presented� An example is shown inFigure ���

This form is not too important as many of the values will be determined automatically by thecommand� However the pixel size should be correct if strange results are to be avoided andDISTANCE does a�ect slightly the interpretation of the powder rings� Other values such asthe wavelength are not important for the TILT command but can be usefully set for lateroperations�

When the correct values have been set click on OK�

The TILT� BEAM CENTRE REFINEMENT Control form now appears� This is shownin Figure � �

The following �buttons� are available�

ANGULAR SECTIONS� This the number of angular sections around ��� degrees of thepowder rings which are used to calculate the centre of the rings� The beam centre and tiltare �tted to these positions on each ring� If the data is very noisy or shows poor powderaveraging then a smaller number may be better� �No theoretical criterion exists to set an

Page 87: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure ��� The Experimental Geometry Control Form

EXPERIMENTAL GEOMETRY

CONTROL FORMO.K. CANCEL ? HELP INFO

DESCRIPTIONS VALUES CHANGESIZE OF HORIZONTAL

PIXELS (MICRONS)SIZE OF VERTICAL PIXELS

(MICRONS)

SAMPLE TO DETECTORDISTANCE (MM)

WAVELENGTH (ANGSTROMS)

X-PIXEL COORDINATE OFDIRECT BEAM

Y-PIXEL COORDINATE OFDIRECT BEAM

ROTATION ANGLE OF

TILTING PLANE (DEGREES)

ANGLE OF DETECTOR TILTIN PLANE (DEGREES)

100.0000

100.0000

315.0000

.987536

0.0

0.0

0.0

0.0

X-PIXEL SIZE

Y-PIXEL SIZE

DISTANCE

WAVELENGTH

X-BEAM CENTRE

Y-BEAM CENTRE

TILT ROTATION

ANGLE OF TILT

Click on variable to change, or ’O.K.’

Page 88: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure � � The TILT� BEAM CENTRE REFINEMENT Control Form

TILT / BEAM CENTRE REFINEMENT

(FITTING TO POWDER RINGS)

O.K. CANCEL ? HELP INFO

DESCRIPTIONS VALUES CHANGE

NUMBER OF AZIMUTHAL

SECTIONS

REJECT OUT-LYING

POSITIONS AND RE-REFINE

REJECT LIMIT FROM IDEAL

(STANDARD DEVIATIONS)

OUTPUT FULL INFORMATION

FIND BEST FIT BEAM

CENTRE

FIND BEST DETECTOR TILT

ANGLES

90

YES

4.000000

YES

YES

YES

ANGULAR SECTIONS

REJECT OUTLIERS

REJECT LIMIT

FULL INFO

REFINE BEAM

REFINE TILT

Click on variable to change, or ’O.K.’

Page 89: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

optimum value so trail and error is recommended� Clearly this value should not be toosmall��

REJECT OUTLIERS� This option allows badly �tting �ring� positions to be rejected andthe data re�tted� This is to make the �t procedure more robust and to allow for erroneouspositions owing to contaminating Bragg peaks etc�

REJECT LIMIT� If REJECT OUTLIERS is YES then this is the number of standarddeviations away from the best �t predicted position after which �outliers� are rejected�

FULL INFO� YES for terminal screen output of information relating every stage of the�tting of the powder rings�

REFINE BEAM� YES to �t the beam centre position as well as the tilt angles� NO tore�ne only the tilt angles �if variable�� This is usually used when the beam centre hasbeen determined from a direct beam mark�

REFINE TILT� YES to �t the detector nonorthogonality to the beam �the tilt�� NOwill keep the tilt angles �xed and only �t the beam centre �if variable�� NO is oftenused when the tilt angles have been determined accurately from a high quality calibrantmeasurement�

Set the required parameters and click OK to continue�

Next the BEAM CENTRE MENU appears� This is shown in Figure �� Page ��� This isused to set an initial beam centre which will then be re�ned if REFINE BEAM has beenset to YES�

If the beam centre has been accurately recorded e�g� with a semitransparent beamstop then�tting with a �D Gaussian may be the best method of setting the beam centre and it maythen be better not to re�ne it using the powder ring positions�

For further information on the BEAM CENTRE MENU see Section ���� Page ���

Depending on whether or not a circle has been selected in de�ning the beam centre the usermay be requested to select a powder ring for the initial tilt determination�

Next the RING PROFILE SEARCH LIMIT is de�ned by graphical input� Relative tothe de�ned circle this de�nes an annuli symmetric about the ring� This pro�le limit will alsobe used for other rings which are selected for �tting� The search is limited to ring positionswithin the annuli so this should be large enough that all rings �t inside but small enough notto include other rings�

The annuli are draw in white on the image�

Other rings to be used for the tilt re�nement are now selected by clicking on them� A singlering is su�cient but more well de�ned rings will clearly lead to more accurate results� When�nished click within the prompt box�

Starting from the initial beam centre the centre of each sector of powder ring will be determinedfor the di�erent sectors� This is then �tted with an ellipse to obtain a better estimate of thebeam centre� The central positions of all sectors of all the selected rings are then found and

Page 90: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

the tilt and�or beam centre parameters are re�nement to give the best �t to the experimentaldata positions�

Unless the beam centre is known there are theoretically two equally possible and indistinguishable solutions to the tilt angles from the shape of the ellipses� These have opposite tilt anglesbut di�ering beam centres� FIT�D tries to �nd both solutions but owing to noise it may �ndthe same one twice� Details of both solutions are output in the terminal window and the user isasked to choose one of them� If some knowledge of the beam centre exists it may be possible todetermine the true solution� If not it is probably not important as both solutions theoreticallylead to the same �� angles when the data is integrated�

���� The INTEGRATE Command

The INTEGRATE command allows integration of arbitrary �D regions to a variety of �Dscans� Presently �� DSpacing QSpace and equal radial distance element scans may beproduced� The ZOOM IN command may be used to select a ROI for integration and theMASK command may be used to masko� �bad� pixels within the ROI so that their value donot in�uence the results of the integration�

First the EXPERIMENTAL GEOMETRY CONTROL FORM appears� An exampleof this form is shown in Figure �� Page ��� The values may already have been de�ned e�g�within the TILT command� Clearly these values are extremely important if the resulting scanis to be correct� When the values are correctly set click the OK button�

Next the CONTROL OF RADIAL� �THETA� OR Q SCAN REBINNING PARAMETERS control form appears� An example of this form is shown in Figure ���

The following control parameters are available�

SCAN TYPE� Allows one of � di�erent types of integrated scans to be selected�

�THETA� This is an equal angle scan equivalent to a �� scan on a powder di�ractometer� The scale is in degrees�

QSPACE� This is similar to the �THETA scan but the output elements are inequal Qrange bins� The scale is in inverse nanometres� The de�nition of Q is������sin������ where �� is the angle of the scattering as recorded on the detectorrelative to the direct beam�

RADIAL� This is an equal radial distance element scan� The scale is in millimetres�

DSPACINGS� This converts pixel angles to equivalent Dspacings and outputs anscan in equal Dspacing distance pixels�

CONSERVE INT� NO means that the output intensities are normalised by the number ofcontributing pixels �although geometrical corrections may be applied�� This is appropriatefor producing the equivalent of a �� scan and for a Qspace scan but does not conversetotal intensity� For applications which require integrated intensities to be conserved thisshould be set to YES�

Page 91: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure ��� The CONTROL OF RADIAL �THETA OR Q SCAN REBINNING PARAMETERS Control Form

CONTROL OF RADIAL, 2-THETA, OR Q

SCAN RE-BINNING PARAMETERS

O.K. CANCEL ? HELP INFO

DESCRIPTIONS VALUES CHANGESCAN TYPE (D, RADIAL,

2-THETA, Q-SPACE)

INTENSITY CONSERVATION

APPLY POLARISATIONCORRECTION

POLARISATION FACTOR

GEOMETRICAL CORRECTION

TO INTENSITIES

MAXIMUM 2-THETA ANGLE OF

SCAN (DEGREES)

NUMBER OF BINS IN OUTPUT

SCAN

2-THETA

NO

YES

.970000

YES

21.00723

1214

SCAN TYPE

CONSERVE INT.

POLARISATION

FACTOR

GEOMETRY COR.

MAX. ANGLE

SCAN BINS

Click on variable to change, or ’O.K.’

Page 92: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

POLARISATION� YES to apply a polarisation correction to the intensities during theintegration�

FACTOR� This is the polarisation factor which is used if the polarisation correction is applied�

The polarisation factor is de�ned as �Ih � Iv���Ih � Iv� where Ih is the horizontal component and Iv is the vertical component� �Horizontal should normally correspond to theXdirection of the image��

GEOMETRY COR� YES corrects a �at �scan� to the equivalent of a �� scan or a Qspace scan� �CONSERVE INT should be set to NO�� These are the e�ect of change ofdistance and obliqueness at higher angles for the �at image plate compared to a detectoron a �� arm always facing the sample�

MAX ANGLE� Maximum angle of the output scan in degrees�

SCAN BINS� Number of bins in the output scan� This may be increased up to the size ofthe program array in the �rst dimension� Larger values lead to oversampling with mayhelp obtain better pro�les�

When the required parameters have been set click on the OK button� Whilst the data isbeing integrated a progress report will appear in the terminal window�

The �D data will be replaced by the �D integrated scan but the �D is saved in the �memory�and can be recalled using the EXCHANGE command�

��� The BEAM CENTRE Command

The BEAM CENTRE Command allows the beam centre to be de�ned or rede�ned withoutchanging any other experimental geometric parameters� This may be useful when the detectortilt angles are accurately determined using a high quality calibrant measurement but dataimages su�er some nonreproducibility in positions� The BEAM CENTRE MENU is shownin �gure ���

Figure ��� The BEAM CENTRE MENU

? HELP

2-D GAUSSIAN FIT AVERAGED GRAPHICAL

CIRCLE COORDINATES ELLIPSE COORDINATES

GRAPHICAL COORDINATE FIT 1-D PROJECTION

KEYBOARD NO CHANGE

The following commands are available�

� List of commands with short description

Page 93: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

HELP� More detailed help on available commands

�D GAUSSIAN FIT� Automatic �tting of a �D Gaussian function on the direct beammark� The user should click on the beam mark to start the �tting�

AVERAGED GRAPHICAL� Set beam centre from the average of entered coordinates�This will work well if there are clearly de�ned symmetric peaks�

CIRCLE COORDINATES� Set the beam centre from the least squares �t of a circle to �or more entered coordinates� This is useful if a well de�ned powder ring is present�

ELLIPSE COORDINATES� Set the beam centre from the least squares �t of an ellipse to or more entered coordinates� This is useful if a well de�ned powder ring is present�

GRAPHICAL COORDINATE� Single graphical coordinate click to de�ne the beam centre� This is clearly rough and ready but may be su�cient for many purposes in particularan initial beam centre for re�nement�

FIT �D PROJECTION� This option is designed for grazing incidence SAXS data� Arectangular region is speci�ed in the same manner as for the PROJECTION command�Two coordinates de�ne the projection line and other two coordinates de�ne the width ofthe �D projection region� The �D projection is displayed and a menu allowing maskingand unmasking of data points� The symmetry point of the �D data is re�ned� Forthis to work optimally the intensities must be symmetric e�g� there must not be di�eringabsorption e�ects� The best symmetry point on the �D projection line is used to calculatethe �D coordinate� This is presented to the user as the default X�Y coordinate for thebeam centre�

KEYBOARD� Enter beam centre coordinate from input values from the keyboard�

NO CHANGE� Use the existing position�

���� The CALIBRANT Command

The CALIBRANT button allows the �tting of the powder pattern from a standard calibrantsample� The known Dspacings of the di�racting planes allow the beam centre and tilt to bede�ned with greater accuracy than with an unknown sample and if reasonably high angle datais present allow the sample to detector distance and the wavelength to be re�ned independently�This has been veri�ed to agree to within the accuracy that may be obtained from scanning anabsorption edge using a Ge detector on ID�� at the ESRF�

Clearly for best results a very high quality powder sample should be used and a well exposedimage should be obtained�

First the SELECT CALIBRATION SAMPLE choice menu appears� This is shown inFigure ���

The following choice of calibrants is available and includes the commonly used samples fromthe American National Institute of Standards and Technology�

CERIUM DIOXIDE� Ceria powder sample e�g� NIST standard

Page 94: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure ��� The SELECT CALIBRATION SAMPLE Choice Menu

CANCEL CERIUM DIOXIDE LANTHANUM HEXABORIDE

? SODIUM CHLORIDE PARAFFIN WAX

HELP SILICON

LANTHANUM HEXABORIDE� LaB� powder sample e�g� NIST standard

SODIUM CHLORIDE� NaCl Common salt �beware of moisture�

PARAFFINWAX� Macromolecular crystallographers �standard� calibration wax� PARAFFIN WAX is included since many crystallographers use this for distance calibration�However don�t expect high accuracy and if only low angle data is available don�t try tore�ne both wavelength and distance together�

SILICON� Silicon powder sample e�g� NIST standard

After the appropriate calibrant sample has been selected the CALIBRANT PATTERNREFINEMENT control form appears� This is shown in Figure ���

The following �buttons� are available�

DISTANCE� The sample to detector distance in millimetres�

WAVELENGTH� The radiation wavelength in Angstroms�

XPIXEL SIZE� The horizontal �as displayed� size of detector pixels in microns�

YPIXEL SIZE� The vertical �as displayed� size of detector pixels in microns�

ANGULAR SECTIONS� This the number of angular sections around ��� degrees of thepowder rings which are used to calculate the centre of the rings� The beam centre and tiltare �tted to these positions on each ring� If the data is very noisy or shows poor powderaveraging then a smaller number may be better� �No theoretical criterion exists to set anoptimum value so trail and error is recommended� Clearly this value should not be toosmall��

REJECT OUTLIERS� This option allows badly �tting �ring� positions to be rejected andthe data re�tted� This is to make the �t procedure more robust and to allow for erroneouspositions owing to contaminating Bragg peaks etc�

REJECT LIMIT� If REJECT OUTLIERS is YES then this is the number of standarddeviations away from the best �t predicted position after which �outliers� are rejected�

FULL INFO� YES for terminal screen output of information relating every stage of the�tting of the powder rings�

Page 95: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

Figure ��� The CALIBRANT PATTERN REFINEMENT Control Form

CALIBRANT PATTERN REFINEMENT

OF DISTANCE WAVELENGTH ETC.

O.K. CANCEL ? HELP INFO

DESCRIPTIONS VALUES CHANGESAMPLE TO DETECTOR

DISTANCE (MM) (STARTING)

WAVELENGTH (ANGSTROMS)(STARTING)

SIZE OF HORIZONTALPIXELS (MICRONS)

SIZE OF VERTICAL PIXELS(MICRONS)

NUMBER OF AZIMUTHALSECTIONS

REJECT OUT-LYINGPOSITIONS AND RE-REFINE

REJECT LIMIT FROM IDEAL(STANDARD DEVIATIONS)

OUTPUT FULL INFORMATION

REFINE X/Y BEAM CENTREREFINE SAMPLE TO

DETECTOR DISTANCE

REFINE X-RAY WAVELENGTH

REFINE DETECTORNON-ORTHOGONALITY

FIT INTERMEDIATE NUMBEROF RINGS

315.0000

.987536

100.0000

100.0000

90YES

4.000000

YESYESYESNOYESNO

DISTANCE

WAVELENGTH

X-PIXEL SIZE

Y-PIXEL SIZE

ANGULAR SECTIONS

REJECT OUTLIERS

REJECT LIMIT

FULL INFO

REFINE BEAM X/Y

REFINE DISTANCE

REFINE WAVELENGTH

REFINE TILT

EXTRA ITERATIONS

Click on variable to change, or ’O.K.’

Page 96: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

REFINE BEAM X�Y� YES to �t the beam centre position as well as the tilt angles� NOto re�ne only the tilt angles �if variable�� This is usually used when the beam centre hasbeen determined from a direct beam mark�

REFINE DISTANCE� YES to re�ne the sample to detector distance from the angles ofthe calibrant powder rings�

REFINE WAVELENGTH� YES to re�ne the radiation wavelength from the angles of thecalibrant powder rings�

REFINE TILT� YES to �t the detector nonorthogonality to the beam �the tilt��

EXTRA ITERATIONS� Sometimes the initial values are not good enough to �nd higherangle rings� If YES an extra step is introduced which �nds intermediate angle rings andre�nes using them prior to trying to use all available rings� This should normally not benecessary�

As can be seen it is possible to re�ne or not all the di�erent parameters� It is possibleto re�ne all parameters together but normally only the sample to detector distance or thewavelength should be re�ned� However with high quality high angle data is possible to re�neboth together and get results as good as those obtained by scanning edges�

Set the required parameters and click OK to continue�

The user is prompted to de�ne a ring of the calibrant pattern by clicking on the ring � or moretimes� Normally the inner ring is requested� This de�nes the inner ring and an initial beamcentre�

This should be last user intervention provided the initialisation is not too inaccurate� If theposition of the ring does not correspond within ��� of the given distance and wavelength thenaWARNING message will be output and the operation will terminate� In such a case checkthe initial values and change as required�

When the initialisation is good enough the routine will successively search for more ring positions and re�ne the re�nable parameters as requested� The coordinates use and the ringspredicted are drawn on the image as the command proceeds�

���� The CAKE Command

The CAKE command is so called because it allows an arbitrary user �cake� of data to bede�ned and integrated to one of a large choice of single and multiple scans�

When the CAKE command is �rst entered an initial �cake� is de�ned� First the beam centreis de�ned in the same manner as the BEAM CENTRE command� see Section ���� Page ���This is followed by graphical input for the STARTING AZIMUTH END AZIMUTHINNER LIMIT and lastly the OUTER LIMIT� All these values expect the OUTERLIMIT have defaults which may be used instead by clicking within the prompt boxes�

The de�ned �cake� or integration area will be drawn on top of the image in inverse video� TheCAKE submenu now appears� This is shown in Figure ��� If the CAKE submenu is exited

Page 97: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

and reentered within the same FIT�D session the de�ned �cake� is remembered�

Figure ��� The CAKE SubMenu

EXIT

?

HELP

BEAM CENTRE

INTEGRATE

END AZIMUTH

EXCHANGE

FULL

INNER RADIUS

OUTER RADIUS

START AZIMUTH

UN-ZOOM

ZOOM IN

Z-SCALING

MASK

ASPECT RATIO

The following commands are available�

EXIT� Exit CAKE submenu and return to calling menu�

INTEGRATE� Integrate currently de�ned �cake� region with a choice of the number ofazimuthal and radial��theta output pixels� This allows enormous �exibility in de�ningintensity versus azimuthal angle scans �� scans multiple �� scans and polar transformations�

INNER RADIUS� Change inner radius��theta angle of the currently de�ned �cake� integration region�

ZOOM IN� Graphical region de�nition

� List of available commands and short descriptions�

END AZIMUTH� Change end azimuth of the currently de�ned �cake� integration region�

OUTER RADIUS� Change outer radial��theta angle of the currently de�ned �cake� integration region�

ZSCALING� Automatic or user control of intensity display range� see Section �� Page ���

HELP� Detailed help text

EXCHANGE� Swap current data with the �memory�� see Section �� Page ���

START AZIMUTH� Change starting azimuthal angle of the currently de�ned �cake� integration region�

MASK� Mask or Unmask data �masked pixels are not rebinned�� see Section �� Page ��

BEAM CENTRE� Change beam centre which de�nes the zero angle for integration� seeSection ���� Page ���

FULL� Set ROI to be all of the currently de�ned data�

UNZOOM� Zoom out to see more of the data

Page 98: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

ASPECT RATIO� Control automatic correct aspect ratio �or not�� After integration theoutput is often highly nonsquare� For better display it is often better to set AUTOMATIC CORRECT ASPECT RATIO IMAGE DISPLAY to NO�

When a suitable �cake� has been de�ned and �bad� pixels masked out the INTEGRATIONcommand should be selected� The TYPE OF AZIMUTHAL�RADIAL OR �THETATRANSFORM control form appears� An example is shown in Figure ���

The following parameters may be controlled�

START AZIMUTH� Change starting azimuthal angle of the currently de�ned �cake� integration region�

END AZIMUTH� Change end azimuth of the currently de�ned �cake� integration region�

INNER RADIUS� Change inner radius��theta angle of the currently de�ned �cake� integration region�

OUTER RADIUS� Change outer radial��theta angle of the currently de�ned �cake� integration region�

SCAN TYPE� Allows one of � di�erent types of integrated scans to be selected�

�THETA� This is an equal angle scan equivalent to a �� scan on a powder di�ractometer� The scale is in degrees�

QSPACE� This is similar to the �THETA scan but the output elements are inequal Qrange bins� The scale is in inverse nanometres� The de�nition of Q is������sin������ where �� is the angle of the scattering as recorded on the detectorrelative to the direct beam�

RADIAL� This is an equal radial distance element scan� The scale is in millimetres�

DSPACINGS� This converts pixel angles to equivalent Dspacings and outputs anscan in equal Dspacing distance pixels�

AZIMUTH BINS� Number of bins in the output scan in the azimuthal sense� This may beincreased up to the size of the program array in the second dimension�

RADIAL BINS� Number of bins in the output scan in the radial �� or Qspace sense� Thismay be increased up to the size of the program array in the �rst dimension�

CONSERVE INT� NO means that the output intensities are normalised by the number ofcontributing pixels �although geometrical corrections may be applied�� This is appropriatefor producing the equivalent of a �� scan and for a Qspace scan but does not conversetotal intensity� For applications which require integrated intensities to be conserved thisshould be set to YES�

POLARISATION� YES to apply a polarisation correction to the intensities during theintegration�

Page 99: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure ��� The TYPE OF AZIMUTHAL�RADIAL OR �THETA TRANSFORMControl Form

TYPE OF AZIMUTH/RADIAL OR

2-THETA TRANSFORMATIONO.K. CANCEL ? HELP INFO

DESCRIPTIONS VALUES CHANGESTARTING AZIMUTH ANGLE

(DEGREES)

END AZIMUTH ANGLE(DEGREES)

INNER RADIAL LIMIT(PIXELS)

OUTER RADIAL LIMIT(PIXELS)

SCAN TYPE (RADIAL,2-THETA, Q-SPACE)

NUMBER OF AZIMUTHAL BINS

NUMBER OF RADIAL/2-THETABINS

INTENSITY CONSERVATION

APPLY POLARISATIONCORRECTION

POLARISATION FACTORSAMPLE TO "DETECTOR"

DISTANCE (MM)

GEOMETRICAL CORRECTIONTO INTENSITIES

0.0360.0000

0.01147.606

2-THETA

3601148NOYES

.990000

315.0000

YES

START AZIMUTH

END AZIMUTH

INNER RADIUS

OUTER RADIUS

SCAN TYPE

AZIMUTH BINS

RADIAL BINS

CONSERVE INT.

POLARISATION

FACTOR

DISTANCE

GEOMETRY COR.

Click on variable to change, or ’O.K.’

Page 100: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

FACTOR� This is the polarisation factor which is used if the polarisation correction is applied�

The polarisation factor is de�ned as �Ih � Iv���Ih � Iv� where Ih is the horizontal component and Iv is the vertical component� �Horizontal should normally correspond to theXdirection of the image��

DISTANCE� The sample to detector distance in millimetres�

GEOMETRY COR� YES corrects a �at �scan� to the equivalent of a �� scan or a Qspace scan� �CONSERVE INT should be set to NO�� These are the e�ect of change ofdistance and obliqueness at higher angles for the �at image plate compared to a detectoron a �� arm always facing the sample�

By setting azimuthal bins to � a single �D radial����Qspace scan can be obtained�

By setting the number of radial bins to � and selecting the �cake� as an annulus about a ringor an arc peak an integration of intensity versus azimuth may be obtained�

Leaving both these numbers greater than � a �D polar transform is obtained� In the output array the Xdirection is used to store the radial����Qspace bins and the Ydirection theazimuthal bins���

An example of the result of such a transform is shown in Figure ���

Here the powder rings have become straight lines at equal �� angle� Any wobble in the linesshows inaccuracy in the beam centre or the detector tilt angles or spatial distortion in thedetector or maybe deviatoric stress in the sample�

The black region at zero and low �� is the beamstop shadow and the black regions at high ��are area outside the rectangular input region�

��Prior to V�� �� the storage was the opposite way around� It was changed so that output of radial����Q�space scans could easily be input and �tted in the MFIT interface� If �tting is required in the azimuthaldirection the command TRANSPOSE can be used�

Page 101: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Figure ��� Example of a Polar Transform of a Powder Pattern

0 50 100 150 200 250 300 350

0 50 100 150 200 250 300 350

0

2

4

6

8

10

12

14

16

18

0

2

4

6

8

10

12

14

16

18

ccssi001.bin: Azimuth/2-theta

Azimuth (Degrees)

2-T

heta

Ang

le (

Deg

rees

)

0 20 40 60 80 100 120 140 160

Page 102: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� The SAXS�GISAXS Interface

This interface is similar to the POWDER DIFFRACTION ��D� interface but is beingtailored for the needs of small angle scattering� It is still under development so not all thecommands have been implemented at present�

The main menu is shown in Figure ���

Figure ��� The SAXS�GISAXS Main Menu

EXIT BEAM CENTRE FULL OUTPUT

? CAKE INPUT NORMALISE

HELP PROJECTION INTEGRATE Z-SCALING

PRINT EXCHANGE MASK ZOOM IN

DISPLAY OPTIONS 1-D TRANSFORMS UN-ZOOM

The SAXS�GISAXS Main Menu contains the following commands�

EXIT Exit menu�

BEAM CENTRE Determine beam centre by a choice of methods�

FULL View image of full data�

OUTPUT Save data in an output �le�

This help on the menu choices�

CAKE Versatile multiple �theta scans integration �see Section ���� Page ����

INPUT Input data from a �le on disk�

NORMALISE Apply intensity normalisation corrections� �Not yet implemented��

HELP Help text on this grphical menu�

PROJECTION Integrate rectangular region to �D scan� This uses the beam centre and auser input coordinate to de�ne an integration line� A second user input coordinate de�nesthe width of the integration region� Pixels within this region are e�ectively �collapsed�onto the integration line and then rebinned to the required �D output scan� This typeof integration is speci�cally for grazing incidence data�

INTEGRATE �D to �D �theta integration�

ZSCALING Automatic or user control of intensity display range�

PRINT Output current graphics to PostScript �le�

EXCHANGE Swap current data with the �memory��

Page 103: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

MASK De�ned maskedo� regions of the image�

ZOOM IN De�ne smaller graphical display region�

DISPLAY Further graphical display possibilities�

OPTIONS Graphics display control menu�

�D TRANSFORMS Choice of conversion of intensity and Q scales� Allows �D integratedscan data to be transformed by the general equation�

�Log�I�q�a � qbversus�Log�qc ���

The conversion of the intensity and Q scales to log is optional and the values of a� b� andc are user controlled�

UNZOOM Zoom out to see more of the data�

�� The TEST Interface

The TEST integerface is for program development and testing purposes� Normally users willnot be concerned with this interface�

Page 104: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� The KEYBOARD INTERFACE� Introduction And

General Use

��� FIT�D Prompts and Required Input

By default all user prompts are short but further information is always available by entering aquestion mark ����

Menu commands may be shortened to any nonambiguous command� upper lower or mixedcase input is �ne�

Generally prompts propose to the user a default suggestion and often de�ne a limited range foracceptable input values� Values outside the de�ned range will not be accepted and FIT�D willreprompt with a warning message and an explanation of the required input� When a defaultis given the user can enter � Return� to obtain the default value� Default values are usedto suggest sensible sizes of values and to guide the user through some of the menu commands�

e�g� To de�ne the Xdimension �horizontal as seen on the screen� the following prompt is issuedand information produced to an input which is outside the acceptable range of input�

X DIMENSION FOR ARRAYS �Range � to �� ���� ��

Must be an integer in the defined range

Here you are asked to define the size of the program arrays� These will

be used to store data �inside� FITD� Normally you will want the arrays

to be at least as large as the image data to be input� If the dimensions

are larger this does little harm� but is wasteful of system resources�

If the arrays are smaller then not all of an image can be input at full

resolution� Some input options allow an image to be re�binned on input

or for a sub�region of the image to be input�

X DIMENSION FOR ARRAYS �Range � to �� ����

The return of default values should save you much typing but leads to a problem for enteringblank character strings� If you try to enter a blank character string for a character input whichhas a default the default string will be taken� To allow easy input of blank strings a specialprogram variable has been de�ned� ��BLANK � �Program variables are covered in Section ����Page � ��� Here all you need know is that a method is available to enter a blank characterstring� e�g� To set the title of a dataset to be blank the following prompt and input would beused�

Main menu ENTER COMMAND �GAUSSIAN� title

NEW TITLE �Simulated Data� ��BLANK

Previously issued commands may be recovered edited and reused using the arrow keys ��command line history recall�� in the same manner as the �TCshell� or emacs� The uparrow keymay be used to go backwards through the �history� and the downarrow key forwards� Oncea history line has been selected it may be edited using the left and rightarrow keys the delete

Page 105: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

key and by typing text which will be inserted automatically� The � Return� key may beused to enter the whole line of text regardless of the position of the cursor���

When entering a �le name it is possible to type only part of the �le name and have the nameautomatically completed� After typing one or more characters of the �le name you may typethe �TAB� key and FIT�D will complete or partially complete the �le name up to a di�erencebetween two �le names� If the characters uniquely de�ne a �le the name will be completed�emacs uses will be familiar with this functionality as it is provided by the GNU Readlinelibrary�

Any text which extends for more than a page ��� lines� is controlled by a �pager� which allowsforward and backward scrolling and keyword searching�

Generally the user can enter a double backslash �nn� instead of the normal input to �escape�from a particular command��� This should return the program to the main menu���

Commands may be sent to the operating system from any of the keyboard input menus �V������A dollar needs to be typed before the command to be sent� e�g� To send the command ls �al

to a Unix system you would enter ls �al� e�g�

Main menu ENTER COMMAND �IMAGE� ls �al

Note� i� Unix systems do not seem to be able to interpret aliases when sending a commandin this fashion� ii� Any output to the terminal from the operating system is not included in alog �le�

��� Important Main Menu Commands

The keyboard interface main menu features commands of many di�erent types to be able toperform basic image operations visualisation style customisation and other support operationssuch as input and output� Only specialist commands related to �D detector system calibrationand to �tting have been �hidden� in submenus���

The commands may be grouped by type i�e��

Arithmetic CADD� CDIVIDE� and CMULTIPLY are all scalar operations which prompt for thevalue of the scalar and apply the operation throughout the ADR� LOG takes the logarithmbase �� throughout the ADR and RAISE TO A POWER takes all elements in the ADR to

��More commands are available� but these are the most important ones� GNU Readline documentationdescribes fully the available possibilities�

��Previously��Control��D �Unix� or�Control��Z �VMS� were the normal �User escape� commands�however FIT�D now uses the GNU Readline library for terminal input which enables command line historyrecall and �le name completion� but using �Control��D for its own purposes�

��It is possible that there are still some occasions when this �user escape� option does not work as it should�If this happens please inform me of the command so that it can be recti�ed for future versions�

��For keyboard driven programs many users dislike having to go up and down many menus and sub�menusto �nd commands� The calibration and �tting operations have nevertheless been put in separate sub�menu tore�ect the much greater specialist knowledge required to use these routines�

Page 106: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

the requested power� ADD� SUBTRACT� DIVIDE� MULTIPLY� and LOG are all commandswhich work on two images �one in the memory� and perform the stated operation elementby element throughout the ADR�

Geometry MOVE and REFLECT allow rotation translation and re�ection of data the output is inthe memory� FLIP allows the data to be re�ected about its horizontal or vertical middle�TRANSPOSE transposes the ADR output in the memory i�e� DATA�x� y� is transferred toMEMORY�y� x��

Filtering BLUR� MEDIAN FILTER and SPATIAL FILTER perform �ltering operations of the ADRoutput in the memory�

Visualisation IMAGE� CONTOUR PLOT and ��D PLOT allow the ADR to be visualised in a number of di�erent forms�

Style Control COLOUR TABLE and ROTATE LUT allow the colour table to be changed� Manyother commands allow aspects of the graphics output style to be controlled e�g� GRID

allows horizontal and vertical grid lines to be added to the graphics�

The most important menu commands are�

INPUT DATA� REGION� ROI� IMAGE� PRINT GRAPHICS� CALIBRATION� FIT�

and EXIT�

INPUT DATA allows data to be input one of a number of de�ned �le formats� More formats willbe added as appropriate�

REGION allows the region that commands act upon to be changed� Initially the region will bethe whole data but often it is very useful to restrict actions to only a subset of the data� Thissets the ACTIVE DATA REGION �ADR�� Understanding the ADR concept is very importantto e�cient and powerful use of FIT�D�

ROI also allows the ADR to be changed but works using pixel numbers instead of data coordinates�

IMAGE plots previously input data as a false colour image according to the current attributes�style� which have been set by the user�

PRINT GRAPHICS will output the current graphics in a PostScript output �le� The �rst timethis is called the user is prompted for the name of the output �le�

CALIBRATION enters the calibration submenu with commands allowing calibration data to beanalysed and calibrations de�ned and applied to subsequent scienti�c data�

FIT enters the �tting submenu with commands allowing a �t model to be de�ned and minimised�

EXIT �or QUIT� is used to exit FIT�D demands con�rmation to avoid accidental loss of results�

Page 107: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

��� FIT�D Terminal Output

Initially header text is output to the terminal� This contains the version number of the versionof FIT�D being used and may contain some information on new possibilities or warningsconcerning changed functionality� In the case of problems it is useful to note the versionnumber being used �See Section ���� Page �����

On startup you are prompted for the size of the program arrays to be created to hold imagedata and whether or not to create variance arrays� When these questions are answered FIT�Denters the main menu loop� This is recognisable by a prompt of the following type�

Main menu ENTER COMMAND �INPUT DATA�

The text Main menu tells you that you are in the main menu as opposed to one of variouspossible submenus� The text ENTER COMMAND �!!!!!!� tells you that FIT�D is waiting fora menu command to be entered� The text within the square brackets is a suggested defaultcommand� On startup the suggested default is the INPUT DATA command but at later stagesmany other commands are suggested as defaults�

When one of the possible submenus is entered the command prompt is changed to re�ect thesubmenu entered� e�g�

Calibration sub�menu ENTER COMMAND �FIND PEAKS�

is the prompt output when the CALIBRATION command is issued and the calibration submenuis entered�

Commands which require various numerical constants or text strings to be de�ned will outputprompts similar to those output for the size of the program array dimensions� e�g� The CADDcommand needs to input the addition constant value�

ADDITION CONSTANT ����

All such prompts are in capital letters� The ���� is as for the menu command prompts adefault return value� Further information on required inputs �obtained by entering a questionmark ���� is in mixed case� e�g�

Enter real value to add to active data region

ADDITION CONSTANT ����

In addition to the normal prompt text other program output may appear spontaneously duringthe execution of certain commands� These messages fall into three general categories and areall started with text to indicate the category�

Page 108: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

INFO These are information messages such as progress reports for operations which maytake a long time or quantities and results calculated by FIT�D�

WARNING These are generally warning messages which the user should take note of butwhich hopefully do not require exiting FIT�D� Such a warning may be issued when a �lewas not found�

ERROR These are generally important error messages which may mean further processing isimpossible� Such a message is issued when virtual memory allocation fails�

The exact di�erence between an information warning or serious error message is impossible tode�ne� Thus these are only general categories� Sometimes a WARNING message can be treatedas information and processing can carry on without a change of strategy� Similarly an ERROR

message can sometimes be treated as only a warning by an experienced user� e�g� If virtualmemory allocation fails it may be possible to reduce the requirements and try again�

�� The �Pager�

When more than a page of text is output to the user it is controlled by a �pager�� This allowsthe user to move easily backwards and forwards through the text as well as allowing some morepowerful options such as keyword searching�

The text is output a number of lines at the time� f or � Return� gives the next set of linesb may be used to get the previous set of lines s goes to the start of the text q to quit the textand a line number followed by � Return� may be typed to go immediately to a required linenumber in the text�

� or h gives a list of the available commands which are all a single letter or a number� Theletters may be entered in upper or lower case� n allows the number of lines in a �page� to beuser set�

Keywords may be searched for with the � and � commands for forwards and backwards searching respectively� The searching is �autowrapping� i�e� if a keyword is not found at by the endof the text �forwards search� the search is carried on from the beginning of the text� The useris prompted for repeat searching� By default the searching is insensitive to letter case� Thisbehaviour may be toggled on and o� using the command c�

��� On�line HELP

Online help is available using the HELP command� This provides �pages� of information similarto the information in this document� The output of the help text is controlled by a �pager�so that the user can scroll backwards and forwards and search through the text for keywords�See Section ���� Page �����

Further information is available for every prompt which may be obtained by entering a questionmark ���� �The initial user prompt messages are deliberately kept to one line��

Page 109: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

��� Modifying Text

The commands TITLE� X�AXIS LABEL� Y�AXIS LABEL� and Z�AXIS LABEL allow the corresponding items to be replaced or de�ned� e�g� TITLE allows a new title to be de�ned and TEXT

allows accompanying text to be de�ned�

��� Modifying Graphics Style

The style of all graphical items can be altered using the SET !!!! STYLE commands� e�g� SETANNOTATION STYLE can be used to change the text font size and colour used to draw theannotation labels�

Page 110: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

� The KEYBOARD INTERFACE� Command Summary

Here the �keyboard� interface main menu commands are described in detail in alphabetic order�

���� ��D INTERPOLATION

Applies a �D linear scaling interpolation to data points in the current ADR�

���� ��D SURFACE PLOT

Allows the ADR of the current data to be viewed as a �d surface together with colour� Theview angle may controlled by the user�

Users should not try to view large numbers of pixels with many colours as this can requirevery large amounts of system memory� Users are recommended to use REGION to restrict theviewing region and REBIN to further reduce the number of pixels� COLOUR TABLE should be usedto reduce the number of colour indices by setting MINIMUM INDEX and MAXIMUM INDEX to usea limited range of colour indices� �System memory requirements will be roughly proportionalto the number of pixels multiplied by the number of colour indices��

Based on the starting view position the surface is calculated and drawn from back to front�This means that no hidden surface removal is necessary yet the surface will appear correctly�Graphical menu �buttons� allow the user to change the angle and zoom in and out� Howeverit is possible to change the viewing angle such that it is outside the range for which the backto front drawing method is correct�

To obtain hardcopy is it necessary to click on the PRINT �button� within the menu and specifya �le name�

Note� This command is still under development�

���� �

Entering a question mark will produce a list of all the available main main commands followedby a brief description of the corresponding operation� The list is controlled by the pager �SeeSection ���� Page ����� �Further information on the commands may be obtained by thecommand HELP��

��� ADD

Adds the contents of the �memory� to the current data array throughout the ADR� If the�memory� data is not de�ned for any of the pixels in the current data ADR this operation

Page 111: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

will fail and a warning message will be produced� The INFORMATION command may be used toobtain the current sizes of the current data and �memory� images and the ADR for each�

���� ANNOTATION LABEL

All graphical display �images contour plots X�Y graphs� may contain additional annotationlabels� These text labels may be arbitrarily placed and may include arrows to point to areas ofthe graphics� The annotation labels and arrows may be de�ned in either page coordinates ordata coordinates �See Section �� Page ����� By using data coordinates the relative position ofthe label or arrows will not change if di�erent regions of the data are displayed�

Many di�erent annotation labels may be added and their style may be controlled individually using SET ANNOTATION STYLE �See Section � ��� Page �� � and SET ARROW STYLE �SeeSection � ��� Page �� ��

���� ASPECT RATIO

This option controls the �aspect ratio� of data displayed as images� By default all images willbe displayed in their correct aspect ratio i�e� the size of the image will be proportional to thenumber of pixels in each dimension� An alternative way of thinking of this is to say that theindividual pixels are drawn as squares�

Sometimes especially with images with highly di�ering numbers of pixels in their dimensionsit is preferable to not use the correct aspect ratio for display� The prompt�

AUTOMATIC CORRECT ASPECT RATIO IMAGE DISPLAY �YES�

allows this to be controlled�

The following example sets the graphics system so as to not use the correct aspect ratio�

AUTOMATIC CORRECT ASPECT RATIO IMAGE DISPLAY �YES� �

Enter ��YES�� if you want image display with automatic correct aspect

ratios i�e� the pixels are square� Enter ��NO�� to use all the available

display region� This may result in non�square pixels� but may be

preferable for very non�square images�

AUTOMATIC CORRECT ASPECT RATIO IMAGE DISPLAY �YES� n

If automatic correct aspect ratio is not set then the image will �ll all the region which hascurrently be de�ned for it�

�The aspect ratio can also be controlled from the OPTIONS menu of the GUI��

Page 112: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

���� AUTOCORRELATION

Calculates the autocorrelation function of the current ADR� At present this must be a powerof two pixels in length for both of the two dimensions� The circular autocorrelation function iscalculated� To calculate a noncircular autocorrelation �rst place the region in a larger region ofzero valued pixels� At least �n� elements are necessary to completely avoid any wraparound�

The prompt�

CENTRE OUTPUT �YES�

appears� If the default �YES� is accepted then the zero �frequency� will be centred in theoutput otherwise the zero �frequency� correlation will be the �rst pixel�

���� AXES SCALES

AXES SCALES allows the scales for the X and Yaxes to be changed� This can be useful andsometimes necessary since various commands e�g� �D Surface Display use the size of the axiselements to determine display and calculations�

Each axis has a starting value for the �rst element and a step value between all successiveelements�

You will be prompted�

�ST X�AXIS ELEMENT VALUE ����

X�AXIS ELEMENT INCREMENT ����

�ST Y�AXIS ELEMENT VALUE ����

Y�AXIS ELEMENT INCREMENT ����

���� BANNER

This command allows the FIT�D graphics window header or banner page to be saved to aPostScript �le for printing or inclusion in a document ���

You are prompted for the name of the �le to store the PostScript output�

����� BLUR

Blurs �smoothes� data in the ADR by convolution with a tophat function of user speci�edsize��� The output is in the memory�

��This is a command that I use for making FIT�D posters� and documentation���The present implementation is much faster than the previous version ��� times for �� � top�hat��

Page 113: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

The user speci�es the number of pixels which de�ne the tophat rectangle� If the number ofpixels if even then the centre of gravity of peaks will be slightly changed �right and up�� Ifthe number is odd then the e�ect of the convolution is symmetric and no change in centre ofgravity occurs�

����� BRAGGS� EQUATION

BRAGGS� EQUATION allows a number of di�erent simple uses of Braggs� equation� From known�� angles and wavelength �or energy� the corresponding dspacings may be calculated usingthe D�SPACING submenu option� From known dspacings and wavelength the corresponding�� angles may be calculated using the TWO THETA ANGLE option� From known dspacings and�� angles the wavelength �and photon energy� may be calculated using WAVELENGTH�ENERGY �The commands EXIT or QUIT can be used to return to the main menu�

Here is an example of use which converts a �� angle at one wavelength into the equivalentdi�raction peak angle at a di�erent wavelength�

Main menu ENTER COMMAND �INPUT DATA� bragg

Bragg equation sub�menu ENTER COMMAND �D�SPACING�

WAVELENGTH �Angstroms� �� for keV �

�Range � to ��E��� ��������

INFO Energy � ������� keV

TWO THETA ANGLE �Degrees� �Range � to ���� ��� �����

INFO D�spacing �Angstroms� � ������

Bragg equation sub�menu ENTER COMMAND �TWO THETA ANGLE�

WAVELENGTH �Angstroms� �� for keV �

�Range � to ��E��� �������� �

ENERGY OF RADIATION �keV� �Range ��E�� to ���

�������� ����

INFO Wavelength � ������� Angstroms

D�SPACING �Angstroms� �Range ��E�� to ��E���

��������

INFO Two theta angle �Degrees� � ������

Bragg equation sub�menu ENTER COMMAND �D�SPACING� exit

����� CADD �Constant ADDition�

Adds a constant to every element throughout the ADR� The user is prompted for the value ofthe constant�

����� CALCULATOR

The CALCULATOR command enters the reverse Polish notation calculator submenu� The submenu commands are mainly the normal calculator arithmetic and function commands� At

Page 114: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

any time values may be entered which are stored one by one on the �stack� or an operatorcommand may be entered to perform an operation on one or more of the values previouslyentered on the stack� The result replaces the values operated upon� In addition to operatorcommands such as !� �� �� � stack manipulation and display commands are available� For afull list of the available commands type �� As always the command EXIT or the command QUITis used to return to the main menu� The calculator may be used in normal arithmetic modebut also supports complex arithmetic� To enter complex constants type two values separatedby a space and�or a comma�

The complete list of available commands and their function is�

� List of available operators and commands

� Add top two elements of stack

� Subtract lower element of stack from top element

! Multiple top two elements of stack

� Divide top element of stack by lower element

��X Form reciprocal of top of stack

ABSOLUTE Absolute value of top element� Sqrt�r��� � i����

ACOSINE Take Arc Cosine of top element of stack

ARCCOSINE Take Arc Cosine of top element of stack

ARCSINE Take Arc Sine of top element of stack

ARCTANGENT Take Arc Tangent of top element of stack

ASINE Take Arc Sine of top element of stack

ATANGENT Take Arc Tangent of top element of stack

ADDITION Add top two elements of stack

CLEAR Clear stack �remove all elements�

COSINE Take cosine of top element of stack

DIVISION Divide top element of stack by lower element

DUPLICATE Copy top of stack onto stack

ENERGY Convert wavelength �Angstroms� to photon energy �keV�

EXCHANGE Swap top two elements of stack

EXIT Exit �t submenu

EXPONENTIAL e to the power of the top element of stack

INTEGER Truncate value to an integer

Page 115: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

LN Take natural logarithm of top element

LOGARITHM Take logarithm base �� of top element

MAXIMUM Greater of top two elements of the stack

MEMORY Output value of memory

MODULUS Remainder when top of stack divided by lower value

MINIMUM Minimum of top two elements of the stack

MULTIPLICATION Multiple top two elements of stack

NEGATION Multiple top element by ���

PI Ratio of circumference to diameter of a circle

POP Remove top element from stack

POWER Raise top element to the power of the lower element

PUSH Duplicate top element �adds to stack�

QUIT Exit calculator submenu

R� Place value from register � onto stack

R Place value from register � onto stack

R� Place value from register � onto stack

R� Place value from register � onto stack

QUIT Exit �t submenu

RECALL Place value from memory onto stack

RECIPROCAL ��x reciprocal of top element

REGISTERS Values of current registers

S� Store top element in register �

S Store top element in register �

S� Store top element in register �

S� Store top element in register �

SINE Take sine of top element of stack

SQUARE ROOT Replace value by its square root

SQRT Replace value by its square root

STACK Shows contents of the stack

STORE Save value of top element in memory

Page 116: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

SUBTRACTION Subtract lower element from top element

SYMBOL Store top of stack as a named program variable

TANGENT Take tangent of top element of stack

VARIABLE Store top of stack as a named program variable

WAVELENGTH Photon energy �keV� to wavelength�Angstroms�

Note� Since the commands may be entered in any shortened nonambiguous form commonforms of naming the functions will work e�g� sin� cos� exp� tan are all understood�

The VARIABLE command allows the value in the top of the stack to be stored as a programvariable for later use and use in macros �see Section �� Page �� ��

����� Examples of Calculator Usage

At �rst a reverse polish notation calculator may seem complicated to use but with a smallamount of practice it is very easy but of course di�erent ���

Before any operation e�g� multiplication of two numbers can be performed the operands e�g�the two numbers must be �rst entered onto the �stack�� Operands �numbers� are entered ontothe stack simply by typing their value followed by the � Return� key� Each new value isplaced on the top of the �stack� previous values being stored underneath it�

The following example shows the program output produced when multiplying ����� and �� ���

Main menu ENTER COMMAND �INPUT DATA� calc

ENTER VALUE OR OPERATOR ����

ENTER VALUE OR OPERATOR �����

ENTER VALUE OR OPERATOR !

RESULT ������ �E�

ENTER VALUE OR OPERATOR exit

The following example shows how to calculate cos������sin����� �note trigonometric functionswork in degrees��

ENTER VALUE OR OPERATOR

ENTER VALUE OR OPERATOR cos

RESULT ������� �E�

ENTER VALUE OR OPERATOR

ENTER VALUE OR OPERATOR pow

RESULT ���� �E�

ENTER VALUE OR OPERATOR

��There is a mis�conception that reverse polish notation calculators are �better�� This is completely un�true�they are neither better nor worse� just much simpler to program� as no parser is necessary�

Page 117: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

ENTER VALUE OR OPERATOR sin

RESULT ���� �E�

ENTER VALUE OR OPERATOR

ENTER VALUE OR OPERATOR pow

RESULT �������� �E�

ENTER VALUE OR OPERATOR �

RESULT �� �E�

The following example shows the entry of complex numbers and their multiplication�

ENTER VALUE OR OPERATOR � ��

ENTER VALUE OR OPERATOR ��

ENTER VALUE OR OPERATOR !

RESULT ��� � ��

The following example shows how to �nd out the photon energy �in keV� corresponding to awavelength of ��� A�

ENTER VALUE OR OPERATOR �

ENTER VALUE OR OPERATOR energy

RESULT ������ �E�

���� CALIBRATION

Enters submenu for calibration and correction or spatial distortions� See Section �� Page ���for full description of available commands and estimation of calibration functions and application for correcting images�

����� CDIVIDE �Constant DIVIDE�

Divides every element throughout the ADR by a constant� The user is prompted for the valueof the constant�

����� CHANGES

Paged text with details of changes which occurred in di�erent versions of FIT�D�

����� CLEAR DATA

Sets all elements in the ADR to zero� If variance array exists the corresponding elements arealso set to zero�

Page 118: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

����� CLOSE LOG

Closes a log �le if already open �if not does nothing��

����� CMULTIPLY �Constant MULTIPLY�

Multiplies every element throughout the ADR by a constant� The user is prompted for thevalue of the constant�

����� COLOUR TABLE

COLOUR TABLE allows the type of false colour table used to represent intensity values of �Dimages to be changed� A choice of a number of di�erent colour schemes is available to the user���The di�erent available colour schemes are referred by a name e�g� TEMPERATURE� GREY�SCALE�

GEOGRAPHICAL� As with entering menu commands the shortest nonambiguous letter sequencemay be entered and a question mark ��� may be entered to obtain a list all available choices�

Users are recommended to try out the di�erent colour tables as di�erent data and di�erentaspects of of data may be highlighted by di�erent colour tables� The choice includes grey scales�Generally colour allows most detail to be seen in a single image but colour can sometimes beconfusing and grey scales may be useful to allow the brains natural image processing to spotfeatures or trends in the data�

In addition to the variety of colour tables the user has control on the range of colour indicesused on the workstation or Xterminal to display the image and on the number of separatecolour levels used to display the image�

Since windowing systems allow several di�erent windows to have their own colour tables it ispossible to have more de�ned colours than the physical possibilities of the hardware �normally� � colours for ESRF workstations�� If this happens then when a user clicks in a di�erentwindow the colours of other windows may well change �this e�ect is known as ��ash��� To tryto avoid ��ash� FIT�D does not by default use all of the colour table� MINIMUM INDEX andMAXIMUM INDEX control the range of colour table indices that FIT�D uses for setting coloursand displaying images� �Because the precise number of colours used by other windows can varyit is possible that ��ash� occurs even using the default settings�� If these values are changedthe colour table indices a�ected will be altered as part of this command but the indices usedto display the image will not be changed so it is necessary to use the PLOT DATA command toredisplay the data as desired�

By displaying a very limited number of di�erent colours it is possible to obtain a kind of colourcontour plot� Whilst not perfect this is far �cheaper� in terms of calculation than a truecolour contour plot� NUMBER OF LEVELS allows the number of separate displayed colours to bechanged�

��This range is likely to be added to in the future�

Page 119: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

����� CONCATENATION

During complicated macros it is often useful to be able to de�ne new variables e�g� �le namesbased on the values of other variables �see Section �� Page � ��� The joining together of twoor more character strings to form a longer character string is known as concatenation�

This command allows two strings to be joined together and used to de�ne the value of a newprogram variable� This is best demonstrated with a realistic example�

If the two variables �FILE BASE and �EXTENSION have been de�ned we can de�ne a new variable�FILE NAME to be the concatenation of the two with the following�

Main menu ENTER COMMAND �PLOT DATA� concat

ENTER FIRST STRING �fitd�� �FILE�BASE

ENTER SECOND STRING �fd� �EXTENSION

INFO Concatenation

file�bin

ENTER VARIABLE NAME ��FILE�OUT� �FILE�NAME

����� CONTOUR PLOT

This will display the ADR of the current data in contour plot form� It should be noted thatthis is more calculation intensive than producing a false colour image�

�At present no attribute control is available but if control over the number of contour linesand their style is required it can be added��

����� CREATE DATA

Normally if you try an instruction such as IMAGE before any data has been input you will receivea warning message telling you that �rst you must INPUT DATA or CREATE DATA� CREATE DATA

makes FIT�D create program data although initially the data array elements are all zero�This can be useful for simulation purposes�

The user is prompted for the size of arti�cial data to create� This must clearly be not greaterin size than the current program arrays�

���� CURVE STYLES

This is a shorter form of the command SET CURVE STYLES �See Section � ��� Page �����

Page 120: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

����� DEDUCE FILE SEQUENCE

Often it is desired to run a series of data analysis operations on a whole series of �les� This canbe achieved by running a macro on a whole series of �les using the �SEQUENCE� command�Section � ��� Page ���� or by writing a single macro with a loop which runs on di�erent �les�see Section �� Page � ���

When a macro is to be run on a series of �les it is necessary to deduce the �le sequence� i�e�the number of the �rst and last �le in the sequence the base part of the �le name and the�le extensions� DEDUCE FILE SEQUENCE allows a starting �le name and an end �le name to beentered which may of course be program variables and if possible deduces the parameters ofthe sequence and sets a number of internal program variables�

� ��PREFIX � This is a character string set to the nonchanging characters at the start ofthe �le names�

� ��START � This is an integer value from the starting �le in the series

� ��END � This is an integer value from the last �le in the series

� ��STEP � This is an integer value for the step from one �le in the series to the next� Thiswill normally be set to � or to � if the last �le number is less than the �rst �le number�

� ��VARIABLE � This is a logical �boolean� value �TRUE or FALSE� which tells whether ornot the number of characters used to store the changing numerical part is variable or�xed� e�g� file ��dat to file ��dat has a variable number of characters whereasfile ��dat to file ��dat has a �xed number of characters�

� ��NUM CHARS � When ��VARIABLE is FALSE this is an integer value which is the numberof characters used to store the changing numerical part of the �le names�

� ��POSTFIX � This is a character string with any nonchanging part of the �le names afterthe changing numerical part but before any �le extension� �Often this will be blank��

� ��EXTENSION � This is a character string with any nonchanging part of the �le nameafter and including the decimal point��

e�g� If �FILE �ST equals �users�a�smith�data�poly ��dat and �FILE LAST equals�users�a�smith�data�poly ���dat then�

Main menu ENTER COMMAND �PLOT DATA� DEDUCE

ENTER NAME OF STARTING FILE �fitd�����fd� �FILE��ST

ENTER NAME OF END FILE �fitd���fd� �FILE�LAST

Main menu ENTER COMMAND �CONCATENATION� LIST VARIABLES

��PREFIX � �users�a�smith�data�poly�

��START � �

��END � ��

�Normally� a ��le extension� does not include the decimal point i�e� is the characters after the decimal point�however� de�ning the �extension� with or without the decimal point allows more �exibility�

Page 121: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

��STEP � �

��VARIABLE � FALSE

��NUM�CHARS � �

��POSTFIX �

��EXTENSION � �dat

This command is useful for creating macros which work with �le series�

����� DEFINE VARIABLE

Internal program variables may be de�ned using the DEFINE VARIABLE command� This issimilar to the Unix !alias� command or the VMS !DEFINE� or !ASSIGN� commands� A �token�can be de�ned as a variable and given a data type and a value� The variable names data typesand �values� are stored in a variable translation table� Once de�ned whenever the variable isencountered it will be replaced by its �value� prior to further input processing� The variablemust be separated from other characters by one or more spaces a comma or a �Tab��

This is very powerful but also very dangerous and potentially very confusing� Users arerecommended to only use unlikely character strings for variables e�g� Start every variable witha hash sign �"�� Certain commands de�ne variables and values� these all start with a doublehash �""��

Rede�ning an existing variable will overwrite its previous value� If the data type changes awarning message will be output� Variables may be removed from the variable translation tableby using the UN�DEFINE VARIABLE command �see Section � ���� Page ����� A list of currentlyde�ned variables types and values may be output using the LIST VARIABLES command ��seeSection � � � Page �����

Variables may be used as a manner of �parametrising� a macro� By prede�ning variables for�le names variables may be used within a macro� By rede�ning the variables with di�erent �lenames the macro may be rerun on di�erent �les� Variables are further explained in Section ��Page � � and in particular an example is given of de�ning variables for �parametrising� a macroin Section ���� Page � ��

Here is an simple example of setting the variable �VALUE to store a �oating point real valuewill be value of ������� It may be noticed that the choice of data types is unique in the �rstcharacter so single letters can be entered to set the data type�

Main menu ENTER COMMAND �INPUT DATA� define

ENTER NAME OF VARIABLE ��IN� �VALUE

ENTER DATA TYPE OF VARIABLE �

BOOLEAN VALUE �Same as ��LOGICAL �BOOLEAN� VALUE���

CHARACTER STRING VALUE Alpha�numeric character string value

FLOATING POINT �REAL� VALUE Floating point value

INTEGER VALUE Store as an integer value

LOGICAL �BOOLEAN� VALUE Logical ��true�� or ��false�� value

REAL VALUE �Same as ��FLOATING POINT �REAL� VALUE���

STRING VALUE �Same as ��CHARACTER STRING VALUE���

Page 122: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

ENTER DATA TYPE OF VARIABLE r

ENTER FLOATING POINT VALUE ����

����� DIFFRACTION PATTERN

This allows the di�raction pattern produced by an arbitrary triclinic unit cell to be predicted�at present this assumes ��� degree rotation about a rotation axis�� For the di�raction patternto be predicted it is necessary to have de�ned the geometry of the experimental setup� thismust be done beforehand using GEOMETRY �EXPERIMENT� �See Section � ��� Page �����

FIT�D calculates the position of the centre of each Bragg peak for a range of hkl indices� Theuser is prompted for the cell parameters and for the range of indices�

The user is allowed the option of creating an overlay diagram of the predicted di�raction patternon top of an image of the ADR�

�At present the unit cell interaxial angles are entered in a form di�erent from the usual crystallographic conventions� If crystallographers are interested in this command the form of inputcan be changed��

����� DIMENSIONS

Changes the size of program arrays and allows the �memory� arrays and variance arrays tobe used or not� The user is prompted for the new size of program arrays� WARNING�this operation destroys any data that was already present in the current data array or in thememory� The user should save any data �OUTPUT DATA� before performing this operation� Ifthe �memory� arrays are not created many of the menu commands with be disabled� Similarlycertain commands require that the variance arrays exist so cannot work without de�ned variancearrays�

As with all other operations which allocate memory this may fail owing to system limits� Ifthis does fail trying to continue regardless will almost certainly lead to false results or furthererrors� See Section ��� Page ���

This example shows the program dialogue when the DIMENSIONS is used to create programarrays which are ���� � ���� elements with �memory� arrays and variance arrays�

Main menu ENTER COMMAND �INPUT DATA� dim

ARRAY X DIMENSION �Range � to �� ��� �

ARRAY Y DIMENSION �Range � to �� ��� �

CREATE MEMORY �YES�

CREATE VARIANCE ARRAYS �NO� yes

This example shows the program dialogue when the DIMENSIONS is used to create programarrays which are ���� � ���� elements but without �memory� arrays nor variance arrays toreduce computer memory usage�

Page 123: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Main menu ENTER COMMAND �INPUT DATA� dim

ARRAY X DIMENSION �Range � to �� ���

ARRAY Y DIMENSION �Range � to �� ���

CREATE MEMORY �YES� n

CREATE VARIANCE ARRAYS �YES� n

����� DISPLAY LIMITS

When a large region of data is displayed as an image there is an upper limit of the maximumnumber of pixels to be output by the graphics system to a PostScript �le��� If necessary priorto display the region is automatically rebinned to a smaller size� The data is rebinned by anequal factor in both directions and scaled by the number of rebinned pixels so the range isapproximately the same as the range of the full data� This both reduces image �le size andmakes printing faster�

The upper limit may changed by the user so that higher or lower resolution images may beprinted�

����� DIVIDE

Divides element by element the ADR of current data by the memory� If a zero is encounteredin the memory data the output element will be set to ���������e�� and an error messagewill be output at the end of the operation� If error propagation is being carried out and a zerooccurs in a memory element the variance array value is similarly set to ���������e���

�Over�ow and under�ow may occur if the numbers are su�ciently large or small��

����� END GRAPHICS FILE

Closes the �le used for graphics output �after the PRINT GRAPHICS command�� This allowsdi�erent �les to be used for di�erent graphics� A subsequent PRINT GRAPHICS command willprompt for the name of a new �le�

�This may be useful for putting di�erent diagrams in di�erent �les for later inclusion into aLATEX or other type of document or for forcing the same question sequence during a macro��

����� ENTROPY

The histogram of pixel intensity values is calculated from � � to � � units� The raw datashould be integer valued for this operation to be meaningful�

Calculates the zero order entropy of the ADR and the theoretical maximum compression ratiocompared to �� bit raw storage which may be achieved by entropy encoding�

��For screen output the screen itself will provide a limit�

Page 124: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�Other information may also be output� This is being used to investigate and develop datacompression algorithms��

����� EXCHANGE

Exchange current data with the memory contents� The previous data in the memory becomesthe current data and the previous current data becomes the memory data� Axis values textlabels and the ADR are similarly swapped�

�The program in fact exchanges the pointers to various arrays instead of swapping element byelement� This makes EXCHANGE a fast operation independent of the size of the program arrayunlike the STORE and RECALL commands which must operate element by element��

���� EXIT

Exit from program� FIT�D prompts for con�rmation to avoid accidental loss of work� Aftercon�rmation the graphics window should disappear and in a few seconds the normal operationsystem prompt should appear in the terminal window�

����� FAST IMAGE

This command was used as a faster method of printing when the GPHIGS graphics system wasbeing used� Now this command is obsolete�

This command will be removed in ����� so do not use in macros

����� FILTER

Not implemented at present This can be reimplemented if required

Fourier Filtering of data with sharp cuto� �lter�

����� FIT

This command enters the �tting submenu� The �tting submenu contains a variety of commands which allow �t models to be de�ned minimised and the inspection of subsequent results�

Fitting is a complicated and much more specialist subject than the other data analysis operations described in this document� The commands within the FIT submenu are explained inSection �� Page ����

Page 125: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

����� FLIP

The FLIP command allows the ADR to be re�ected about its middle either horizontally orvertically� FIT�D gives the following prompt�

FLIP LEFT TO RIGHT ��NO� � TOP�BOTTOM�

Entering Y will �ip the image about its vertical middle and N will �ip the ADR about itshorizontal middle� The operation is performed in place so the memory is not a�ected�

����� FONT

Same as SET FONT See Section � ��� Page ����

���� FUJI LINEARISATION

This command should generally no longer be used as the Fuji BAS format is automaticallycorrected on input� However the command remains in the case that it may still be useful�

The FUJI LINEARISATION command allows Fuji image plate intensities from a BAS ImagePlate scanner as read in from a binary �le to be converted to a linear scale� At present theimages are stored in a log form and must be converted to a linear scale� The conversion formulais�

PSL�mm� # ��� � ������S� � ��LDxy��b���� ���

where S is the sensitivityL is the latitudeb number of bitsDxy is the stored integer pixel value

These values are Fuji terms and are given in the �inf �le�

The user is prompted for the values of the conversion parameters S� L� and b�

NOTE� No error propagation is performed���

���� FULL REGION

Fast method of making the ADR cover all the de�ned data�

��Prior to V�� � a similar formula was used� with less user control�

Page 126: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

���� GAUSSIAN

The user can de�ne a �D Gaussian function which is added to the data within the current ADR�The user de�nes the peak centre the maximum intensity the orientation and the standarddeviation size in pixels of the two axes� �The peak intensity may be negative to allow peaks tobe subtracted��

Here is an example of the program dialogue�

Main menu ENTER COMMAND �INPUT DATA� gauss

PEAK CENTRE X�COORDINATE ����

PEAK CENTRE Y�COORDINATE ����

PEAK MAXIMUM INTENSITY ����

ORIENTATION OF FIRST AXIS �Range ���� to ���� ��� �

STANDARD DEVIATION WIDTH FOR FIRST AXIS

�Range � to ���E���� ����

STANDARD DEVIATION WIDTH FOR SECOND AXIS

�Range � to ���E���� ����

���� GEOMETRY �EXPERIMENT�

A number of commands are only possible if an experimental geometry has been de�ned e�g�DIFFRACTION PATTERN which predicts the centres of Bragg peaks on a detector�

GEOMETRY �EXPERIMENT� allows the user to de�ne general aspects of a real or simulated experiment such as energy �or wavelength� sample to detector distance and pixel sizes�

The centre of the beam on the detector may be de�ned in one of three di�erent methods�

AVERAGED GRAPHICAL The user clicks on a series of pairs of symmetric points �peaks� and theprogram calculates the beam centre to be the average of the input coordinates�

ELLIPSE �BEST FIT� The user clicks on �ve or more coordinates which should lie on an ellipse�From the coordinates entered the best �t ellipse in the least squares sense is found�

GRAPHICAL COORDINATE The user clicks on the estimated centre of the beam �useful for semitransparent beamstops��

KEYBOARD The user is prompted for keyboard input of the X and Y coordinates of the beamcentre� �The user must know the values by some other method��

LEAST SQUARES The user clicks on three or more coordinates which should lie on a circle�From the coordinates entered the best �t circle in the least squares sense is found�

�The PEEP command will output angles and corresponding dspacings once the geometry hasbeen de�ned��

Page 127: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

��� GRID

User can turn on and o� horizontal and vertical coarse and �ne grid lines� The coarse gridlines are drawn wherever there are �large ticks� on the axes and the �ne grid lines are drawnwhere there are �small ticks��

���� GUI

This command enters the FIT�D �Graphics User Interface� �GUI� from the �keyboard� interface� Thus even if FIT�D is startedup in the �keyboard� interface all of the GUI commandsare still accessible� The only di�erence to normal GUI operation is when the GUI is exited�Control returns to the �keyboard� interface main menu without any con�rmation�

For information on the GUI interface see Section � Page ���

���� HELP

Help text controlled by a �pager� allowing backwards and forwards scrolling searching forkeywords and many other possibilities �See Section ���� Page ����� The HELP will produceonline documentation similar to this document�

�Within the HELP facility type � for more information on the pager and the available pagingcommands��

���� HISTOGRAM

Calculates the frequency histogram of the pixel values within the current ADR�

First the range of pixel values is calculated and displayed and the user is asked to specify theminimum and maximum values over which the range of values for the frequency histogram isto be de�ned� Then the number of histogram bins is de�ned� This can be at most the numberof pixels in the �rst array dimension� These values together de�ne the size of each histogrambin�

Here is an example which de�nes each histogram bin width to be one intensity unit�

Main menu ENTER COMMAND �Z�SCALE� histogram

INFO Active data region minimum value � �E�

Active data region maximum value � ����E��

HISTOGRAM MINIMUM VALUE �Range � to ����E��� ���

HISTOGRAM MAXIMUM VALUE �Range � to ����E���

�����E��� �

NUMBER OF HISTOGRAM BINS �Range � to �� ���

Page 128: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

The frequency histogram is output in the �memory��

���� I�C

Convert an integer value to a character string and store as a user named program variable oftype character string� This is designed especially for use within macros�

The character string can be de�ned with a �xed number of characters or a variable number�

VARIABLE LENGTH OUTPUT �NO�

and if �xed the number of characters is de�ned�

ENTER NUMBER OF OUTPUT CHARACTERS ���

The character string is saved as a named program variable�

ENTER VARIABLE NAME ��CVALUE�

The following example shows the command being used together with a program variable�

Main menu ENTER COMMAND �PLOT DATA� Define

ENTER VARIABLE NAME ��CVALUE� �IVALUE

ENTER DATA TYPE OF VARIABLE INTEGER

ENTER VARIABLE VALUE ��� �

Main menu ENTER COMMAND �Z�SCALE� ic

ENTER INTEGER ��� �IVALUE

VARIABLE LENGTH OUTPUT �NO� n

ENTER NUMBER OF OUTPUT CHARACTERS ��� �

ENTER VARIABLE NAME ��CVALUE�

Main menu ENTER COMMAND �CONCATENATION� list

s �CVALUE � �

i �IVALUE � �

���� IMAGE

Display of the ADR of the current data as a �D false colour pixel image with graphical inputto change displayed region and set display attributes� This is the same as the graphical userinterface MOVEMENT command� see Section �� Page � for further information�

Figure � Page �� shows an example of the display window complete with the graphical menuchoices�

Many of the keyboard interface main menu commands change the behaviour of the displayedgraphics�

Page 129: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

ANNOTATION LABELS Add annotation labels to the graphics �See Section � � Page ����

DISPLAY LIMITS Set the maximum number of pixels which will be used in either the X or theYdirection to output the image �this only a�ects the output to �le�� Larger images orimage regions will be automatically rebinned to make the number of pixels smaller thanthe limit� �See Section � ��� Page ����

GRID Control horizontal and vertical coarse and �ne grid lines on top of image �See Section � ��� Page ����

SET !!!! The set commands will change the aspect of the displayed graphical items �SeeSection � ��� Page �� and following SET commands�

TITLE Change title of image� Section � ���� Page ����

X�AXIS LABEL Change text for Xaxis label �See Section � ���� Page ����

Y�AXIS LABEL Change text for Yaxis label �See Section � ���� Page ����

Z�AXIS LABEL Change text for Zaxis �intensity� label �See Section � ���� Page ����

Z�SCALE Change scaling mode for the Zscale �intensity�� By default the data is alwaysautomatically scaled to display the full range of data values within the display region�See Section � ���� Page �� �

����� INFORMATION

Produces information on the internal state of FIT�D such as the present size of programarrays and whether or not current data and memory data are presently de�ned� If so thecurrent values of the ADR are also output�

����� INPUT DATA

Input of data from de�ned �le formats into FIT�D�s internal database� A number of di�erentformats are available and more will be added as appropriate� Di�erent formats have di�erentlevels of sophistication �or lack of sophistication� and hence the amount of user input varies�At the time of writing the following formats are available�

��D ASCII FREE FORMAT This allows �D data from ASCII text �les to be input

�D ASCII FREE FORMAT This allows �exible input of �D data from ASCII text �les containing lists of pixel values

BINARY �UNFORMATTED� This allows unformatted binary data to be input

BSL FORMAT This is the Daresbury BSL format based on the Hamburg OTOKO format

CHIPLOT FORMAT Simple ASCII X�Y column format data as used by the program CHIPLOT

Page 130: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

COMPRESSED DIFFRACTION DATA Inputs data which has been stored in the �Compacted Di�raction Data� format

DIP� �MAC SCIENCE� This allows a special two byte binary � ���� �� image to be input

ESRF DATA FORMAT Inputs �les which have been stored using a limited subset of the �ESRFdata format� ��les from the SAXS endstation on BL���

FITD STANDARD FORMAT This is the standard format which a �exible self describing format

FUJI BAS� Fuji BAS���� image plate scanner format �also BAS� ���

GAS �D DETECTOR �ESRF� Direct input of raw format �les written on the beamlines �separate ASCII header �le and a binary �histogramming memory� �le�

HAMAMATSU PHOTONICS Integer! binary data described by a short header� Produced by theHamamatsu Photonics K�K� C���� CCD cameras which are used at the Photon Factoryfor the Xray image intensi�er�CCD readout detectors�

IMAGEQUANT For input of data from the Molecular Dynamics Imaging plate PC systems �aTIFF based format �le�

MAR RESEARCH FORMAT MarResearch image plate system format�

NEW MAR CODE Same as MAR RESEARCH FORMAT

PDS FORMAT The �Powder Di�raction Standard� format ����

PHOTOMETRICS CCD FORMAT Integer! binary data described by a short header� Producedby the Xray image intensi�er�CCD readout detector system���

PMC FORMAT PhotoMetrics Compressed XRII�CCD data� This is data from the PhotometricsCCD camera but which has been compressed using the program pmipmc�

PRINCETON CCD FORMAT Integer! Integer!� or IEEE REAL!� binary data described by ashort header� Produced by the Xray image intensi�er�CCD readout detector system��Very similar but slightly di�erent format to the Photometrics format��

TIFF Input of simple � and �byte per pixel TIFF �les

UNKNOWN Attempt to deduce format on noncompressed data

USER INTENSITIES Interactive entry of data values

WESS FORMAT For input of �lm densitometer data �Unformatted unsigned byte data�

Some of these formats are described in greater detail below�

��Note� For a short time this input option was called XRII� until it was realised that there were two dierent�le formats produced by the two dierent CCD cameras used with the X�ray image intensi�er systems�

Page 131: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

����� ��D ASCII FREE FORMAT

This allows �D data to be input from an ASCII �le with a large amount of �exibility in treatingcolumn information�

The program prompts for the �le name�

Enter name of file containing ��D data

FILE NAME �fe��scan�

A sample of the start of the �le is output to help the user chose the correct columns for inputof the angular and intensity data�

Sample of start of the input file

��� �����

��� �

��� ���

��� ���

�� ����

�� ����

A variety of questions allow the user to specify the starting line and character position for thedata and which columns of data to use for Xcoordinates and the Ycoordinates� By entering for the number of coordinates to be input the program automatically inputs as many coordinatesas possible� Alternatively the number of coordinates to input may be speci�ed�

Here is an example of the program dialogue�

Main menu ENTER COMMAND �INPUT DATA�

FILE FORMAT �FITD STANDARD FORMAT� ��D

Enter name of file containing ��D data

FILE NAME �source�scan� �scratch�EXPERIMENTS�bl��cell���edit�scan

Sample of start of the input file

� DETECTOR vct� Ch� Monitor Seconds

��� ���� ��

� ��� ���� ��

��� ��� ��

� ��� ��� ��

� ��� ���� ��

TYPE OF DATA FORMAT �VERTICAL COLUMNS�

NUMBER OF LINES TO IGNORE �Range to �� �� �

NUMBER OF CHARACTERS TO IGNORE �Range to ��� ��

NUMBER OF COORDINATES �Range to �� ���

Columns of numbers for data�set �

COLUMN NUMBER FOR X�COORDINATES �Range to �� ���

COLUMN NUMBER FOR Y�COORDINATES �Range � to �� ���

INFO �� X�Y coordinates per data�set have been found

Page 132: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

����� �D ASCII FREE FORMAT

This allows a �D image to be de�ned and input from numbers in an ASCII �le� The numbersmay be input in free format so a variety of column formats may be input�

The numbers may be separated by one of more spaces and �Tabs� or by commas spacesand �Tabs�� Most common forms of scienti�c notation are supported�

The program prompts for the �le name�

Enter name of file containing ��D data

FILE NAME �file�ascii�

The size of the image to be de�ned is then input�

X NUMBER PIXELS �Range � to �� ���

Y NUMBER PIXELS �Range � to �� ���

This de�nes the width and the height of the image to be input�

A sample of the start of the �le is output to help the user chose the correct line to start input�

Sample of start of the input file

Test File for �D input

�� � ��

�� �

��

��

���

You are asked how many lines to ignore so that a short header section may be �jumped� over�In the above example the �rst line is a text line so should be ignored� e�g�

NUMBER OF LINES TO IGNORE �Range to �� �� �

Every �number� which can be converted will be input and used to de�ne the next pixel value�Thus the number of values per line may be variable as in the above example�

����� BINARY �UNFORMATTED�

Unformatted binary data can be input provided the user knows the size of the data image�Presently single byte integer �Integer!� �Integer!�� and �Real!�� data can be input using

Page 133: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

this option� The single byte �Integer!� and �Integer!�� data may be signed or unsignedand either byte order may be treated� FIT�D prompts for data size and options for byte orderand sign�unsigned data�

If the size of the data is not known it may be possible to set a small value for the Ydirectionand vary the Xdirection until the image wraps properly �provided of course it is possible toidentify a true image�� Similarly using the wrong byte order should produce very strange resultswhen the image is viewed�

�It should be noted that the GUI input form has the additional ability to be able to specify ano�set from the start of the �le in order to jump over known length headers��

The following example shows a a binary image of ���� � �� � pixels being input in �byteunsigned integers without byte swapping�

Main menu ENTER COMMAND �INPUT DATA� input

FILE FORMAT �PRINCETON CCD FORMAT� bin

INPUT FILE NAME �no�data�dat� grid�bin

WARNING No ��info� file� so unknown image size� and pixel sizes

�Pixel sizes defaulted to � x � microns��

X NUMBER PIXELS �Range � to �� ����

Y NUMBER PIXELS �Range � to �� �����

DATA TYPE �INTEGER ��BYTE�� �

��BYTE INTEGER Signed or unsigned� either byte order

BYTE VALUES Single signed or unsigned integers

INTEGER ��BYTE� Signed or unsigned either byte order

REAL ���BYTE IEEE� Floating point real numbers

DATA TYPE �INTEGER ��BYTE��

PERFORM BYTE SWAPPING �NO� n

SIGNED DATA �NO� n

Main menu ENTER COMMAND �IMAGE� plo

����� BSL FORMAT

The BSL format is essentially the same as the OTOKO format developed at Hamburg� Itconsists of an ASCII header �le and a number of binary image data �les� The images arestored in �oating point reals� �This may cause problems when �les are moved between nonIEEE and IEEE �oat point reals systems��

This may also cause problems between littleendian and bigendian systems since the endianessof the stored data is not recorded�

FIT�D will open the header �le and obtain information concerning the images which may beinput� The user will be prompted for the number of the image to input�

Page 134: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

����� CHIPLOT FORMAT

The standard �PLOT data format is a very simple format allowing input of one or moredatasets together with title and axis labels and accompanying text� Error estimates may bede�ned�

The �le should be a formatted variable length record ASCII �le� Such a �le may be createdwith an editor or a BASIC program using PRINT � statements or a Fortran program usingformatted WRITE statements�

The minimum �le format is as follows�

Title and Axes Labels The �rst three lines contain character strings �i�e� text� that will beused to label the graph� The �rst line is the title of the graph the second is the label tobe written for the Xaxis and the third line is the label for the Yaxis�

Number of Data points and DataSets The fourth line speci�es how many data pointsare present in each of the datasets and how many datasets to input� This line shouldcontain two integers separated by a one or more spaces or a comma� If the second integeris missing it is assumed that only one curve is required�

The Data Points The next ��� lines of the �le should contain the data to be plotted� where��� is the number of data points speci�ed in line four� Each line should contain the valuefor the Xcoordinate and the values of the Ycoordinates for the di�erent curves� �Note�All the curves share the same Xcoordinates�� e�g� If only one curve is to be drawn eachline should have two values the values being separated by a blank space or a comma�Such a line may be as follows�

� ���

or equivalent

��� ���e�

Here the lines represents the coordinate ���������� If the number does not contain adecimal point it is assumed to be whole number�

The following example shows a �le which produces a single curve� Note on line four of the �lethe number of curves is not speci�ed so one is assumed�

Page 135: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Figure �� SINGLE DATA�SET

X AXIS UNITS

Y AXIS UNITS

� �e�

�� ���e�

�� ���e�

� ���e�

� ���e�

� �e�

� ���e�

� e�

� ��e�

� ���e�

ASCII X�Y column output from other programs can be easily converted to this format forinput�

����� DIP� �Mac Science�

The DIP���� Mac Science scanner produces images of � ���� �� pixels with each pixel intensity stored in two bytes� As the scanner uses two di�erent photomultiplier tubes the �gain�is di�erent for di�erent pixels�

The intensity values are decoded according to the following scheme�

If �Ie � �� � Id # Ie

If �Ie � �� � Id # �Ie � � � � �����

Where Ie are the intensity values of the input encoded pixels and Id are the intensities of thecorrected values�

The user is asked for the name of the �le to input and whether byte swapping is necessary�For a Sun Silicon Graphics or HP workstation byte swapping will generally not be necessary�

�Note� The orientation of the image is not necessarily correct at present� When the inputorientation is correctly known this input may be adjusted to conform with the normal ESRFimage display convention �looking from sample towards the detector��

����� ��ESRF Data Format��

FIT�D now contains its own code to input a limited subset of the so called �ESRF dataformat�� Unfortunately the format is very poorly de�ned and in practice is more de�ned by thesoftware which writes the data than by the documentation� The two being completely di�erent

Page 136: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

in a number of fundamental aspects� This option should only be used on the understandingthat it is unsupported �unsupportable��

This routine should hopefully be able to input �les produced by the SAXS endstation of ESRFBeamline �� However some older �les may fail owing to �byte �oating point numbers beingwritten across word boundaries� If this happens a warning message will explain the problemand inform the user of the number of spaces which should be added to the header to make the�le conform to word boundaries� These should be added at the end of the header section beforethe curly bracket �g��

Only �les with all the header information occurring before the binary image data are �supported� and no data compression is supported�

As one �le can potentially contain many images the user is prompted for the number of therequired image�

����� FUJI BAS�

The Fuji BAS���� image plate scanners produce an ASCII header �le and a binary data �le�This option will read the header �le and �nd out the size of the image and parameters necessaryto convert the stored logarithmic scaled data to a linear scale� The binary data is input andautomatically converted to the linear scale�

This input option will also work for BAS� �� scanners�

����� GAS �D DETECTOR �ESRF�

WARNING� The data format used to output data from the ESRF �D Gas�lleddetectors is poorly de�ned and may change This option is believed to work� butno guarantee is given that it is either presently correct� or will continue to becorrect Please check input data carefully If problems are encountered� or theformat changes FIT�D will be modi�ed accordingly

This format is used to input data directly as produced by the �D Gas�lled multiwire proportional counter detectors used at the ESRF �the detectors themselves are produced by Andr$eGabriel at the EMBL Grenoble�� The data is output within two �les� an ASCII header �ledescribing the size type of data and the number of images held within a binary image �le�The binary image �le is general referred to as the �histogramming memory�� This may containmany images�

The user is prompted for the �le name of the header �le�

INPUT HEADER FILE NAME �wes����� wes����

The header �le is checked to exist and be a valid header �le� FIT�D outputs the number ofimages in the �le the size of the images and the number of bits used to store each pixel value�The program array size must be big enough to input an entire image�

Page 137: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

If more than one image is contained in the binary image �le FIT�D prompts for the numberof the image to be input� The choice of byteswapping and of inputing signed or unsigned datais given� Since the data is written by a Motorola ����� series processor the raw data is writtenin big endian byte order� Byteswapping should not be necessary on HP Sun and SiliconGraphics workstations but should be necessary on Vax workstations �and on PC�s��

From the header �le name the name of the binary image �le is constructed �hm is concatenatedto the header �le name�� The data is input in the format de�ned in the header �le�

This is an example of the FIT�D log for the input of a gas�lled detector image�

Main menu ENTER COMMAND �INPUT DATA�

FILE FORMAT �FITD STANDARD FORMAT� gas

INPUT HEADER FILE NAME �wes����� wes����

INFO The file contains one image �frame� of �� ! �� pixels�

Each pixel is stored using �� bits�

PERFORM BYTE SWAPPING �NO� �

Enter ��YES�� to swap the byte order on input� Normally byte swapping

should not be necessary for HP� Sun� and Silicon Graphics

workstations� It will normally be necessary for VAX workstations�

PERFORM BYTE SWAPPING �NO�

SIGNED DATA �NO�

������ HAMAMATSU PHOTONICS

The HAMAMATSU PHOTONICS format inputs data from the Hamamatsu Photonics K�K� C����CCD cameras which are used at the Photon Factory for the Xray image intensi�er�CCD readout detectors� This is an Integer! binary data format described by a short header� Any byteswapping which needs to be performed will be carried out automatically�

If the image is too big for the current program arrays then a warning message will be producedand only part of the image will be input�

������ IMAGEQUANT

This is the �le format used by the Molecular Dynamics Imaging Plate scanner� It is a TIFFbased �le format but does not strictly follow the TIFF standard� The Molecular Dynamicsscanner produces images from A� imaging plates which are �� ������ pixels for the coarseresolution scan ���� �m� and ��������� pixels for the �ne resolution scan ��� �m��

The Molecular Dynamics scanner produces and displays the image as seen from behind thedetector but the ESRF standard is for images as seen from the sample� Thus the image is leftto right reversed when view by FIT�D as compared the PC�

FIT�D o�ers the possibility to input only a region of the total image and the possibility torebin pixels on input to make the very large images smaller and more manageable� An exampleprompt and user input is as follows�

Page 138: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

DATA FILE NAME �lysip��gel� data�gel

X REBIN NUMBER �Range � to ���� ���

Y REBIN NUMBER �Range � to ���� ���

LEFT�HAND PIXEL OF IMAGE REGION ��� �

LOWER PIXEL OF IMAGE REGION ��� �

RIGHT�HAND PIXEL OF IMAGE REGION �Range � to ���� ����� �

UPPER PIXEL OF IMAGE REGION �Range � to ���� ����� �

INFO Full image size � ��� ! ��� pixels

������ MAR RESEARCH FORMAT � NEW MAR CODE

The MarResearch online image plate scanners produce a number of di�erent �le formats� Theraw output from the scanner is a spiral readout scan� This is not suitable for input to FIT�Dbut usually this is immediately transformed to a Cartesian raster �le�

The original �le format contained a �xed length header of one record followed by the data in asimple binary format and maybe a number of overload records at the end of the �le� FIT�Dwill input this format including information such as the sample to detector distance from theheader and the overload records�

A new format now exists and there is the possibility to store compressed data� From FIT�DV����� support exists to input these new �les including the compressed data�

�Note� At present the orientation of the images may still be wrong since there appears to bea complicated historical scheme where di�erent sized images are stored in a di�erent manner��

������ PMC FORMAT

This is data from the Photometrics CCD camera but which has been compressed using theprogram pmipmc� pmipmc is a program which can run on a PC or workstation which keepsthe same header �presently the �rst ��� bytes� but compresses the image data according to asimple compression algorithm

with the value of the �rst image pixel being stored immediately after the header bytes�

pmipmc is designed to allow lossless data compression at source prior to data transfer overethernet� A typical transfer time is �� seconds per uncompressed image and the compressedimages may be nearly one third of the size of the raw data� Thus the transfer may be muchfaster if the data can be compressed on the PC� Once compressed it is faster to read it incompressed so FIT�D has this input option�

pmipmc does not change the byte raster order which is normally from left to right as seen bya cameraman and from top to bottom� On input FIT�D will correct the image so that it isseen from the crystal side and the byte order is from bottom to top�

The raw data can su�er from appreciable spatial distortion and nonuniformity of response�Commands within the CALIBRATION submenu exist to help calibrate and correct these e�ects�see Section �� Page �����

Page 139: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�Note� At present the orientation of the CCD camera can change which will also change thesense of the output image� Soon the mechanical holder should stop this uncertainty��

������ PRINCETON CCD FORMAT

This is the �le format produced by the Princeton CCD camera� one of three CCD cameras usedwith the ESRF Xray Image Intensi�er systems� It is a simple binary format with a ���� byteheader followed by signed or unsigned two byte integer data signed �byte integer data or IEEE�oating point real data� There is an old version of the format and a newer similar but slightlydi�erent version� Both are automatically recognised and input �V������� All input types arenow supported �V������� The full size image of the present ESRF systems is ������� � pixelsbut smaller images may be produced �the header contains the size information��

The Princeton camera and software produces and displays the image as seen from behind thedetector but the ESRF standard is for images as seen from the sample� Thus the image is leftto right reversed when view by FIT�D as compared the PC� The orientation may be changedby the PC software and by the actual orientation of the CCD camera� FIT�D will display upwith the same sense as up in the PC images but this may or may not be up in the sense of theexperiment�

The raw data can su�er from appreciable spatial distortion and nonuniformity of response�Commands within the CALIBRATION submenu exist to help calibrate and correct these e�ects�see Section �� Page �����

If more than one image has been stored in a �le FIT�D will output a prompt asking for therequired image �V����� e�g��

IMAGE NUMBER �Range � to �� ���

������ TIFF

This allows input of simple TIFF �les� The TIFF �standard� allows many di�erent optionsmany of which are not supported� Simple �� bit per pixel and � bit per pixel formats arepresently supported� Note� no image compression is presently supported� This format hasbeen added primarily to allow input of data from the EMBL Drum scanner which is used forneutron di�raction at the ILL�

NOTE� This option should not be used for input of data from the Molecular Dynamics ���E scanner The option IMAGEQUANT should be used instead �see Section � � ����Page �����

FIT�D o�ers the possibility to input only a region of the total image and the possibility torebin pixels on input to make the very large images smaller and more manageable� An exampleprompt and user input is as follows�

DATA FILE NAME �test�tiff� data�tiff

INFO Full image size � � ! � pixels

Page 140: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

X REBIN NUMBER �Range � to �� ���

Y REBIN NUMBER �Range � to �� ���

LEFT�HAND PIXEL OF IMAGE REGION ��� �

LOWER PIXEL OF IMAGE REGION ��� �

RIGHT�HAND PIXEL OF IMAGE REGION �Range � to �� ��� �

UPPER PIXEL OF IMAGE REGION �Range � to �� ��� �

Note� If TIFF �les need to be input into FIT�D which use options not presently supportedplease inform me and I will try to cater for them�

������ UNKNOWN

This option will try to deduce the data format purely from byte to byte and then pixel to pixelcorrelations within the data� This cannot work with compressed data

With raw noncompressed data the bytes should should regular correlations so that it is possibleto estimate with a good success rate the number of bytes used in each pixel�

Having determined the number of bytes in a pixel it is relatively easy for integer data to deducethe byte ordering since the lower signi�cant bytes tend to change more rapidly than the highsigni�cant bytes�

The number of pixels in a row can then be determined by peaks in the �D linear autocorrelationfunction although very structured images can lead to false results�

Finally visual inspection can determine the start of the image�

������ USER INTENSITIES

Data values may be input interactively to form a �D line of data values� This can be veryuseful for quickly calculating statistical quantities using the STATISTICS command �See Section � ���� Page ���� after the data has been de�ned� Data values can also be easily enteredand plotted using the PLOT command �See Section � ��� Page � ���

The program prompts continual for more data values� the user must use �user escape� toterminate entry of data values� �User escape� is two backslashes �nn���� After all the datavalues have been entered the user may change the entered values to correct mistakes� A typicalprompt and user input session may be as follows�

INFO Continue entering numbers as required� then use �USER ESCAPE�

INFO �USER ESCAPE� is double backslash �""�

ENTER DATA VALUE ���

ENTER DATA VALUE ��

��Previously �Control��D �Unix� or �Control��Z �VMS� was used for �user escape�� but this hashad to be changed owing to the usage of GNU Readline which provides command history recall and �le namecompletion�

Page 141: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

ENTER DATA VALUE ���e

ENTER DATA VALUE ���

ENTER DATA VALUE ����

ENTER DATA VALUE ""

DATA VALUE TO CHANGE � � quit� �Range to �� �� �

ENTER NEW DATA VALUE ����� ���

DATA VALUE TO CHANGE � � quit� �Range to �� ���

Where �user escape� was entered for the last ENTER DATA VALUE prompt�

����� INTERNAL MEMORY

The INTERNAL MEMORY command allows the ADR of a number of di�erent arrays or regions ofarrays to be stored internally �V������ �This is in addition to the program �memory��� Thiscommand is powerful and dangerous since each extra array that is stored requires more virtualmemory from the operating system� Thus the total demands for virtual memory grow and itmay easily be possible to reach the system limits� If this happens a warning message shouldbe produced but you should be able to carry on using FIT�D but without the extra savedarray� However excessive memory usage should be avoided as it can interfere with other usersand the operating system�

Note� This �internal memory� operation only saves and recovers the current ADR and notwhole of the data arrays� If variance arrays are de�ned these will also be saved and recovered�

The user is prompted whether to save the current data or to recover previously saved data�e�g�

INFO There are currently active data regions stored internally

SAVE ACTIVE DATA REGION ���NO�� TO RECOVER� �YES� �

You are given the choice of saving the current active data region �ADR�

or recovering a previously saved region �if one exists�� Enter ��YES�� to

save the current ADR within internal program memory� or ��NO�� to recover

a previously saved ADR� Note Each time an ADR is saved the program

needs to allocate more dynamic memory� so this command should be used

with care� and may fail if the computer system cannot allocate more

memory�

SAVE ACTIVE DATA REGION ���NO�� TO RECOVER� �YES�

If the current ADR is to be saved the user is prompted for the number of the memory storeto use� If none have been used there is no choice however if memory stores have already beende�ned there is a choice between overwriting the a previous store or using a new one� If possibleuse an existing store to avoid using even more virtual memory� e�g�

INTERNAL STORE NUMBER �Range � to �� ��� �

Enter number of internal memory to use to store active data region�

By default a new memory will be used� unless they are all being used�

Page 142: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

however each time a new memory is used more virtual memory is necessary�

INTERNAL STORE NUMBER �Range � to �� ���

When data has been stored a list of the titles of each stored ADR will be output when theINTERNAL MEMORY command is issued� e�g�

INFO There are currently active data regions stored internally

� Simulated Data

A sub�region of the data

To recover a previously saved region enter NO to the SAVE ACTIVE DATA REGION prompt andspecify the memory store from which to recover data� e�g�

SAVE ACTIVE DATA REGION ���NO�� TO RECOVER� �NO�

INTERNAL STORE NUMBER �Range � to � �� �

Enter number of internal memory to recover a previously stored active

data region�

INTERNAL STORE NUMBER �Range � to � �� �

The data is copied from the memory store into the program array in the same ADR as wasused to store the data� Other data which may be present in the program array is not a�ected�The data in the memory store is still present�

�Note� At present memory stores once created cannot be completed destroyed but virtualmemory may be recovered by de�ning very small ADR�s and overwriting the previously storedADR with the new very small one��

����� LINEARISE FILM

Corrects the nonlinearity response of �lm data� The correction applied is a quadratic whichhas been found to agree with experimental results� It is necessary to know the type of �lmand the maximum optical density measured by the microdensitometer�

���� LIST VARIABLES

Outputs to the terminal �and to a log �le if open� a list of the currently de�ned programvariables data types and their values� If no variables are currently de�ned an informationmessage to this e�ect is output�

e�g� After the STATISTICS command has been used a number of program variables are automatically de�ned so the following output may be obtained�

Main menu ENTER COMMAND �CLOSE LOG� list

Page 143: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

r ��MINIMUM � �������E�

r ��MAXIMUM � �����E��

r ��MEAN � �������E��

r ��RMS � �������E��

r ��SIGMA � ������E��

r ��SKEWNESS � �������E�

r ��TOTAL � �������E��

The data type is given �rst� The following letters are used with the corresponding meaning forthe data type of the value�

i Integer value

l Logical �boolean� value

r Floating point real value

s Character string value

u Data type unknown �e�g� enter with �sym from the commandline

� Invalid variable �This should be rarely seen but can occur if there is no more space availablefor storing string values��

����� LOGARITHM

Take logarithm base �� of all elements in the ADR�

If any of the elements are zero or negative the user will be prompted for the lower thresholdvalue to be used to set these elements� If variances exist they will be set to the absolute valueof the input lower threshold�

����� MACRO

Allows a previously de�ned macro �le to be run� The user is prompted for the �le name of themacro �le� The manner to de�ne and use macros are explained in Section �� Page �� � �Alsosee START MACRO Section � ���� Page �����

FIT�D will try to follow the instructions in the �le until the end of the �le� The �le replacesthe normal keyboard and graphics cursor input�

����� MEDIAN FILTER

Filters data within ADR by taking median value within a user de�ned window for each datapoint� The output is in the memory�

Page 144: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Median �ltering is a nonlinear �ltering technique which is sometimes useful as it can preservesharp features �e�g� lines� in an image whilst �ltering noise�

The disadvantage is that it is di�cult to treat analytically the e�ect of a median �lter� Thereis no error propagation

����� MESSAGE

The MESSAGE command allows user messages to be included in interactive macros� Lines of textare de�ned and �nished with the user escape �nn�� The message will appear on the graphicssystem� This is normally used within macros�

Here is a very simple example of the MESSAGE command�

Main menu ENTER COMMAND �DEFINE VARIABLE� message

INFO Enter message text or user escape �""� to exit

TEXT

TEXT Hello World

TEXT

TEXT ""

The line �Hello World� will appear in the middle of the graphics screen�

����� MOVE�ROTATE

The user can specify a rotation about a �xed point followed by a translation� The user is alsoprompted for the output region of the memory where the data may be output� The pixel valueswithin this region will initially be set to zero and incremented by any input pixels which aretransformed to lie on top of output pixels� The output is in the memory�

Alternatively it is possible to specify the coordinates of two independent points on the inputdata and two corresponding output points� The program will use these to calculate a requiredrotation and translation� For this to be correct the distance between the two input and twooutput coordinates should ideally be the same� If the distances are di�erent the rotation anglewill be calculated to align exactly the lines and the translation will be calculated so that thecentre point between each pair of points is aligned i�e� the discrepancy will be equal for twopoints�

����� MULTIPLY

Multiply element by element each element of the current data ADR with the correspondingelement in the memory� The memory ADR must be de�ned for every element in the currentdata ADR otherwise a warning message will be output�

Page 145: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

����� NORMALISE

Divides element by element each element of the current data ADR by the initial maximumelement in the ADR �provided the maximum is greater than ��������� If the maximum isbelow this value zero or negative a warning message will be issued and the data will be leftunchanged� If a variance array exists error propagation will be performed�

This operation is performed inplace in the current data arrays� The ADR of the current datais replaced by the normalised values�

����� OFFSET�SCALE

When two datasets have been taken of essentially the same experiment but perhaps with adi�erence of scaling this command tries to estimate the scale factor between the two datasets� This process is complicated by signal independent noise such as �lm fog for �lm data andelectronic noise in many other detectors�

OFFSET�SCALE estimates a signal independent o�set and scale factor between two images �onein the memory�� For this to be possible there must be a range of intensity values in bothimages�

�NOTE� This operation is presently under development� Tests show the results to be correctfor nonnoisy images but the results in the presence of noise are not very stable� Hopefully thestability can be improved��

����� OPEN LOG

Allows a �le to be opened to contain a log of the program until the CLOSE LOG command isissued or the program is terminated� The user is prompted for the name of �le to be created tocontain the log� The log �le contains all the input and output as seen on the screen� Producinglog �les can be particularly useful if problems are encountered or bugs are suspected� The log�le can be an invaluable record of the analysis that a set of data has undergone�

After the CLOSE LOG command or the program has been exited the log �le may be edited andthe useful information extracted for many purposes e�g� tables of �gures may be entered to aspreadsheet program for further manipulation and display�

�The OPEN LOG command cannot be used for �replaying� an analysis but this can be achievedby creating a macro see Section �� Page �� ��

��This value is chosen to stop over�ow and under�ow when performing the normalisation� For the errorpropagation it is necessary to divide by the square of the maximum value�

Page 146: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

���� OUTPUT DATA

Output data in ADR to named data �le in one of a choice of data formats� More outputformats will be added as is appropriate� At present the following output formats or commandsare available�

�CAM �D powder di�raction format for input to CERIUS

��BYTE INTEGERS Binary integer�� output of active data region

BINARY �UNFORMATTED� Simple dump of active data region

BSL FORMAT Daresbury SAXS format based on Hamburg OTOKO format

CBF Prototype output of the proposed IUCr �Crystallographic Binary File� Format

CHIPLOT �D row or column output for X�Y graph plotting

COMPRESSED DIFFRACTION DATA Compacted di�raction data format

DENZO MAR FORMAT Experimental output format for input to DENZO

DUMP �Same as �BINARY �UNFORMATTED��� backwards compatibility�

FITD STANDARD FORMAT Self describing readable binary

GSAS GSAS powder di�raction format

HEADER FILES ASCII header �les are created describing information contained in the BINARY�UNFORMATTED� output �les �this is the default behaviour�

MCA FORMAT ASCII � columns per line g���� data only

NO HEADER FILES Do not create ASCII header �les when the BINARY �UNFORMATTED� formatis used

SPREAD SHEET ASCII one line of ADR in one record

TIFF INTEGERS Simple � or �byte output �no compression�

Each output option is described more fully in the following subsections�

����� �CAM

This is simple ASCII text format for the output of �D data� It is the recommended inputformat for inputing data into the CeriusTM software suite�

The user is asked for the name of the output �le and whether to output rows or columns andwhich row or column to output� This allows a single line from a �D image to be output� e�g�

Enter name of output file

FILE NAME �cerius��cam�

OUTPUT ROWS �YES�

NUMBER OF ROW TO OUTPUT �Range � to �� ���

Page 147: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

����� BINARY �UNFORMATTED�

This is an unformatted binary �dump� of the ADR of the current data� At present only �byte per pixel unsigned integers are available� This can be used to output data in a suitableformat for input to MOSFLM DENZO ���� INTLAUE IDL or many other programs��� Theformat can be read into FIT�D using the BINARY �UNFORMATTED� choice from the INPUTDATA command� Whilst �exible this format has the disadvantage that the output �le doesnot contain the information as to the size of the image� To help FIT�D can output a separate�header information� �le and the number of pixels in the X and the Ydirections is output tothe user�

The data is output in a �D raster starting from the bottom lefthand pixel� X �horizontal� isthe fastest changing pixel index� Going from left to right� Y �vertical� changes more slowly�After all the pixel on one row have been output the row number is incremented and pixels onthe next row are output� The rows are output from bottom to top� The top righthand pixelis the last to be output�

By default FIT�D will create a �header� with the same base name as the binary output �lebut with �info appended to the base name� This �le is human �readable� and contains variousinformation telling not only the size of the data but also information on the manner in whichthe data has been output� If header �les are not wanted this facility may be disabled by typingNO HEADER FILES to the FILE FORMAT prompt� It may be reenabled by typing HEADER FILES

to the FILE FORMAT prompt�

The user is prompted with various questions by this option� The explanation of the questionsis best demonstrated by an example�

The following text is the program input�output sequence generated by FIT�D when the currentactive data region contains �� by �� pixels�

Main menu ENTER COMMAND �INPUT DATA� output

FILE FORMAT �FITD STANDARD FORMAT� binary

BINARY FILE NAME �fitd�bin�

INFO Data region is ! pixels

RECORD LENGTH �BYTES� �Range � to �� ��� �

Length of fixed length records in file in bytes

RECORD LENGTH �BYTES� �Range � to �� ���

FIRST RECORD FOR OUTPUT �Range � to �� ��� �

Number of first record to write data from array

FIRST RECORD FOR OUTPUT �Range � to �� ���

BIG ENDIAN FORMAT INTEGERS �NO� �

YES for big endian integer �Sun�HP�SG�� NO for little endian �VAX� PC� MAR�

BIG ENDIAN FORMAT INTEGERS �NO� yes

INFO Data minimum value � ��������

INFO Data maximum value � �������

��MOSFLM is a program for the initial indexing and integration of protein crystallography diraction patterns

written by Andrew Leslie at Cambridge� England� DENZO is also a protein crystallography indexing and inte�gration program� written by Zbyszek Otwinowski� now at the University of Texas� USA� INTLAUE is writtenby various people and is available from John W Campbell� at DRAL� England� IDL is a commercial packageavailable for those with money�

Page 148: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

LOWER LIMIT OF RANGE �Range ����E��� to �������� ��� �

Enter lowest value to be scaled to output range

LOWER LIMIT OF RANGE �Range ����E��� to �������� ���

UPPER LIMIT OF RANGE �Range � to ���E���� �������� �

Enter Highest value to be scaled to output range

UPPER LIMIT OF RANGE �Range � to ���E���� ��������

Note� The entry � has been used to show online prompt information�

The Main menu ENTER COMMAND �INPUT DATA� output selects the OUTPUT DATA command�FILE FORMAT �FITD STANDARD FORMAT� binary selects the BINARY �UNFORMATTED� formatfor �le output� BINARY FILE NAME �fitd�bin� will create an output �le called fitd�binas the default is accepted�

INFO Data region is ! pixels is information showing how many pixels are outputin each direction in the data �le� This information will be useful when inputing the data intoanother program�

RECORD LENGTH �BYTES� �Range � to �� ��� asks the length of �Fortran�records to be created� Generally the default value is just accepted however a larger value maybe used and the user is given the choice to pad out records with blanks� This can be usefulfor creating a pseudoMarResearch format �le �

FIRST RECORD FOR OUTPUT �Range � to �� ��� allows blank records to be createdat the beginning of the �le� Again generally this can be ignored �default is no blank records�but for pseudoMarResearch output this may be used�

BIG ENDIAN FORMAT INTEGERS �NO� yes determines the byte order which is used to outputthe integer pixel values� Di�erent computers write out several byte integers numbers ��byte�byte integers� in one of two di�erent orders� �Big endian� means that the �rst byte of theinteger number is the most signi�cant byte whereas �little endian� means that the �rst byteis the least signi�cant and the most signi�cant is the last byte��� DECVax�s IBMPC�s andcompatibles use little endian format integers whereas Hewlett Packard ��� series Sun� andSilicon Graphics use big endian integers� �FIT�D converts integers into the required byteordering prior to output so can create data suitable for either format regardless of the type ofcomputer which is being used��

INFO Data minimum value � ��������

INFO Data maximum value � �������

LOWER LIMIT OF RANGE �Range ����E��� to �������� ���

UPPER LIMIT OF RANGE �Range � to ���E���� ��������

This �nal section shows the range of data values present in the ADR and allows the user to setthe range of data values which will be scaled to the �byte unsigned integer output range ���� � �� The reason for this complication is simple� within FIT�D the data values may rangefrom approximately ����� to ����� and values may be as small as ������ Such a large range

���Big endian� format is consistent with the convention for the numbering bits with a byte� and with normalorder of digits within a number� Whereas �Little Endian� is consistent with the manner in which we write �inthe �west�� and think of a bit�byte stream arriving�

Page 149: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

cannot be scaled into � �� intensity levels without enormous discretisation� Since in generalnot all the range is used the problem is usually not too severe� By asking for the LOWER LIMIT

OF RANGE and the UPPER LIMIT OF RANGE FIT�D allows the user to control any truncationof the data range and the level of discretisation of the range�

If the data range falls within ��� to � � �� these values will be o�ered as the default values� Ifthis is the case data values will be rounded to their nearest integer value prior to being output�any fractional intensity information is lost in the output �le�� Apart from this rounding valuesin the output �le will have the same intensity as within FIT�D�

If there are values above � � �� then the maximum value will be o�ered as top of the range�If this is accepted then there will be no thresholding truncation of data values but all valueswill be scaled down proportionally to �t into the range ��� to � � ���

Values of LOWER LIMIT OF RANGE apart from ��� should be considered very carefully� If this isnot zero then the output data has this value as an o�set and is no longer linear unless thiso�set is reapplied�

Here is an example of a �header� �le which was created from an ADR from ���� ���� to ����� ��� From this information it is possible to know the ADR which was used to produce thedata� This is not possible from the binary data �le alone� Pixel sizes and the byte order inwhich the integers are output are recorded�

Name of binary file containing image data � fitd�bin

Number of pixels �horizontal�vertical� � �� �

Integer data Number of bytes per pixel � �signed�

The data has been written in �little endian� format� �Normal for VAX�PCs�

Nominal horizontal pixel size � �� �microns�

Nominal vertical pixel size � �� �microns�

Pixel number of first output pixel �pixel offsets� � � ��

Title � fitd�bin

X�axis label � Columns

Y�axis label � Rows

Z�axis label � Intensity

Input data value scaled to lowest file value � �E�

Input data value scaled to highest file value � ������E��

Record length � �� �bytes�� First output record � �

����� BSL FORMAT

The BSL format is essentially the same as the OTOKO format developed at Hamburg� Itconsists of an ASCII header �le and a number of binary image data �les� The images arestored in �oating point reals� �This may cause problems when �les are moved between nonIEEE and IEEE �oat point reals systems��

This may also cause problems between littleendian and bigendian systems since the endianessof the stored data is not recorded�

FIT�D outputs one image in the �le�

Page 150: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

����� CBF

�CBF� is the �Crystallographic Binary File� which is analogous to the �Crystallographic Information File� �CIF�� CIF is the standard for transporting and archiving ASCII data withinthe international crystallographic community� �CBF� is a related format which is as close toCIF as possible whilst allowing large datsets to be stored in e�cient binary forms�

This option is presently only for development and testing purposes since the data names arenot completely �xed and may change�

����� CHIPLOT

Single rows or columns of the data may be output as �D series of X�Y coordinates for plottingwith CHIPLOT� The values are output in a simple ASCII format together with title and axislabel information�

As well as the name of the output �le the user is prompted for output of rows of data orcolumns of data and which row or column to output e�g�

Main menu ENTER COMMAND �GAUSSIAN� output

FILE FORMAT �FITD STANDARD FORMAT� chiplot

Enter name of output file

FILE NAME �chiplot�dat�

OUTPUT ROWS �YES�

NUMBER OF ROW TO OUTPUT �Range � to � ��� �

The �rst line of the �le contains the title of the data the second line the Xaxis label and thethird line the Zaxis �intensity� label� The fourth line indicates the number of following datapoints and whether or not error values are given�

e�g� Here is the start of such a data �le�

Simulated Data

Columns

Intensity

��E�� �E�

���E� ��E�

��E� ����E�

���

����� COMPRESSED DIFFRACTION DATA

This format allows typical di�raction data to be stored in an e�cient �byte integer format�

Page 151: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

����� DENZO MAR FORMAT

This is a temporary manner in which to output data corrected for detector distortions in aformat suitable for processing with DENZO and certain other programs� The format is verysimilar to the BINARY �UNFORMATTED� output �see Section � ����� Page ���� but the data istransposed prior to output and an extra blank record is output before the start of the imagedata�

This is not a true Mar format �le as the header record is left blank but at present this appearsto be good enough for inputting data to DENZO�

����� DUMP

This is exactly the same as BINARY �UNFORMATTED� format �see Section � ����� Page ������The option was previously called DUMP but BINARY �UNFORMATTED� is preferable as this isthe option for input of the same data type� The DUMP option is conserved for backwardscompatibility��

����� FITD STANDARD FORMAT

This �exible format saves the ADR of the current data together with any variances axis dataand text labels� Data may be saved and input into FIT�D using the INPUT DATA commandwith no loss of information �within the ADR��

You are recommended NOT to use this format for taking data away from the ESRF unlessyou have FIT�D or equivalent input routines�

������ GSAS

This format is for input to the GSAS �General Structural Analysis System� program �� � of�D �� scans such as are created by integrating �D powder rings to �D scans�

������ MCA FORMAT

An ASCII dump of data values in � columns per line Fortran g���� format�

������ SPREAD SHEET

This is an ASCII format where each line of the ADR is output as one line of the �le� Eachvalue is output in an adaptable format �Fortran �pe��� format��� separated by a space� Aheader line is output �rst which contains the size of the data �number of Xaxis elements andnumber of Yaxis elements� followed by the starting pixel of the output region�

��Fortran �g� format would have been used� but it is not handled correctly on HP�UX�

Page 152: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

If the ADR is small enough this may be convenient for outputting values to examine of the theterminal� e�g� Here a by � region has been output which contains a di�raction spot�

� � Start pixel � � �� ���

�����E� ������E� �������E� �����E� �����E�

�������E� ����E� �������E� �������E� ����E�

�����E� ������E�� ������E�� ������E�� �������E�

����E�� ������E�� ����E�� ������E�� �����E��

�����E�� ������E�� ������E�� �����E�� �������E��

�����E�� ������E�� �����E�� ������E�� �����E��

������E� �������E� ����E� �������E� �������E�

������E� �������E� �������E� �����E� �����E�

������ TIFF INTEGERS

This allows the current ADR to be stored in a TIFF �le in either � or �bytes per pixel format�The user is prompted for the name of the output �le and whether � or �byte per pixel outputis required� The minimum and maximum values encountered within the ADR are output andthe user is asked for the minimum and maximum data values to be scaled to the �limiteddynamic range� output values� With �byte output only � � output levels are available andwith �byte output � �� levels are available� For more details on this scaling see the BINARY�UNFORMATED� documentation Section � ����� Page ����

This is an example of the program output�

FILE FORMAT �FITD STANDARD FORMAT� tiff

NAME OF TIFF OUTPUT FILE �fitd�tif�

DATA TYPE FOR PIXEL VALUES �� BYTE UNSIGNED INTEGERS�

INFO Data minimum value � �E�

INFO Data maximum value � �����

LOWER LIMIT OF RANGE �Range ����E��� to ������ ���

UPPER LIMIT OF RANGE �Range � to ���E���� �������

Note� For input into xv only �byte per pixel �les should be created� �byte per pixel �les willcause xv to crash� �This is a limitation of xv�� Many other image treatment programs do notdeal properly with �byte per pixel TIFF �les�

����� PAGE POSITION

Allows the position and size of the graphics e�g� image or X�Y graph on the �page� to becontrolled� The coordinates input are those of the maximum region used for the axes frame ofthe image contour plot or graph� Since the title and axis label positions are �attached� to theaxes frame this also changes their position�

Change the position for the image display in the graphics window� This allows you to changethe size of the image display or other graphics within the graphics window�

Page 153: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

�Images and contour plots are drawn with the correct aspect ratio so if the aspect ratio of thepage position region is di�erent not all of the region will be used� The graphic will be centredwithin the region��

����� PAUSE

The PAUSE command waits for the user to press the � Return� �or �Enter�� key beforecontinuing �c�f� the SLEEP command�� This is the case also within macros and allows interactivemacros to wait for user response�

����� PEEP

PEEP allows the user to use the graphics cursor to click on pixels within the current ADRand obtain information associated with those pixels e�g� pixel coordinate pixel number datacoordinate and pixel intensity�

If the experimental geometry has been de�ned �See Section � ��� Page ���� PEEP will alsoproduce angular information and corresponding dspacings�

The user clicks in a large �button� to exit this option�

����� PIXEL REGION

PIXEL REGION is an alternative method to REGION to set the ADR� PIXEL REGION uses pixelnumbers to set the ADR whereas REGION uses data coordinates which may be very di�erentowing to o�sets and rebinning of images�

The user is prompted for the X�Y lower and upper limits of the required ADR� The valuesmust be within the given ranges which are between � and the number of de�ned values forthe lower limits and between the lower limits and the number of de�ned values for the upperlimits� e�g� The prompts and input values may appear as follows�

X�LOWER LIMIT �Range � to ���� ��� �

Y�LOWER LIMIT �Range � to ���� ��� �

X�UPPER LIMIT �Range � to ���� ����� �

Y�UPPER LIMIT �Range � to ���� ����� �

����� PLOT DATA

Plot ADR of data as a �D false colour image �or XY graph if �D�� The ADR is plotted asa false colour image using the current graphics style e�g� current choice of colour table andcurrent text style� If the image is larger than the resolution of the screen window the data isautomatically rescaled to �t within the window�

Page 154: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

The maximum extent of the �page� used to output the image may be changed using PAGE

POSITION �See Section � �� Page � ��� The area set by PAGE POSITION is a maximum extent�to preserve aspect ratio the image may well be drawn smaller in either the horizontal or verticaldirection� The image is always drawn centred within the maximum extent�

����� POISSONIAN NOISE

Adds noise with Poisson statistics to data within ADR� Each element within the ADR is takento be the mean of a Poisson distribution� A random sample is generated from each distribution��This can take a long time for large images��

If variance arrays are present then the values of the data array before adding Poisson statisticswill be used as the variance values�

����� POLARISATION EFFECT

Simulates the e�ect of beam polarisation on Bragg di�racted intensities�

A graphical form is used to control the polarisation factor the pixel sizes the sample to detectordistance and the position of the direct beam on the detector� The detector is assumed to beorthogonal to the direct beam�

The polarisation factor is de�ned as �Ih � Iv���Ih � Iv� where Ih is the horizontal componentand Iv is the vertical component� �Horizontal should normally correspond to the Xdirectionof the image��

Intensities in the ADR are reduced by the e�ect that the de�ned polarisation and geometrywould produce�

����� POSTSCRIPT OPTIONS

The POSTSCRIPT OPTIONS command toggles the PostScript output between colour mode andblack and white mode� If the colour table is purely black and white the black and white modewill produce better quality output on colour printers�

����� POWER SPECTRUM

Calculates the power spectrum of the current ADR� At present this must be a power of twopixels in length for both of the two dimensions�

The output is in the �memory��

Page 155: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���� PREDICTOR

The PREDICTOR command applies one of a choice of simple �predictors� to the current ADR� Theoutput is in the �memory�� Predictors are an important part of data compression algorithmsfor image data� The idea of a predictor is to predict the value of a pixel from surroundingpixels� If the predictor algorithm works well the number of bits needed to store the di�erencebetween the predictions and the actual data is less than the number of bits needed to store theraw data values� Thus they can greatly help in data compression�

A choice of eleven di�erent predictors is provided�

If x is the current pixel and a� b� c� d are the �previous� pixels as shown�

a x

c b d

�� predictor # x� a

�� predictor # x� Int��a � b����

�� predictor # x� Int��a � b� c����

�� predictor # x� Int��a � b� c� d����

� predictor # x� ��a � b� c�

�� predictor # x� Int���a � �b� �c����

�� predictor # x� Int���a � �b� c����

�� For pairs of values a and b replace with a� # Int��a � b���� and b� # a � b �this isreversible� This is applied alternately horizontally and vertically to a speci�ed level thenthe series of a� values are stored as a simple previous value di�erential

�� predictor # x� Int��a � b� �����

��� predictor # x� Int��a � b� c� �����

��� predictor # x� Int��a � b� c� d� �����

�All in integer arithmetic�

This is used to investigate data compression algorithms�

����� PRINT GRAPHICS

Output current screen graphics to a PostScript �le� The �rst time PRINT GRAPHICS is usedit will prompt for the name of an output �le� Subsequent commands will send the graphicsto the same �le unless an END GRAPHICS FILE command is issued to close the �le �See END

Page 156: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

GRAPHICS FILE Section � ��� Page ����� �For graphics to be included in LATEX documentsonly one graphic per �le is presently suitable��

Further PRINT GRAPHICS commands will add new �pages� to the existing �le�

After exiting FIT�D the �les can be set to any PostScript printer or may be viewed using aPostScript previewer such as ghostview� FIT�D will produce colour Postscript if colour hasbeen used on the screen� The �le can be sent to a colour printer or to a black and white printerin which case the colours will be converted to a greyscale�

The user can name the �les as they want but I suggest you always use the ��le extension� �psto distinguish the �les�

Beware� PostScript �les can be large so after printing it is recommended to delete the unnecessary �les�

����� PUBLICATION QUALITY

This command is designed to select quickly all the attributes for graphics quality suitable forpublication� Principally this means that all line widths except those of the grid are set todouble thickness and all fonts are set to the �best� available font��� Thicker lines are generallyneeded for photoreduction�

����� QUESTION

The QUESTION command is used to add interactive input to a macro� Either the GUI or the�keyboard� interface may be used�

The following types of user input may be de�ned�

� CHARACTER STRING� Input a line of text

� GRAPHICAL COORDINATE� Input a coordinate by mouse click

� INPUT FILE� Specify an input �le name

� INTEGER VALUE� Input an integer value

� LOGICAL VALUE� Input a logical �YES�NO� value

� OUTPUT FILE� Specify an output �le name

� REAL VALUE� Input a real value

The user prompt is de�ned as is an optional default value and optional range checking� Theentered value or values are stored in one or more program variables�

��At present the graphics system only supports one font family so that the font do not change� but the fontfamily used� �Times�Roman� should be suitable for most purposes�

Page 157: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

Clearly GRAPHICAL COORDINATE input will always come from the graphics window�

The following example shows the de�nition of a question to input an integer value from theuser�

Main menu ENTER COMMAND �Z�SCALE� question

TYPE OF DATA VALUE TO DEFINE �INTEGER VALUE� int

ENTER USER PROMPT FOR VALUE INPUT ENTER NUMBER OF THE DAY OF THE MONTH

USE GRAPHICAL USER INTERFACE �YES� yes

GIVE USER DEFAULT VALUE �YES� yes

ENTER DEFAULT VALUE FOR INTEGER �

RESTRICT INPUT VALUE RANGE �YES� yes

LOWER LIMIT OF RANGE FOR INTEGER �

UPPER LIMIT OF RANGE FOR INTEGER �Range � to ���������� ��

INFO Enter help text or user escape �""� to exit

TEXT Enter an integer number between � and �� for the number

TEXT of the day of the month�

TEXT ""

ENTER VARIABLE NAME ��VALUE� �DAY

NOTE �������������������������������������������������������������������

INTERACTIVE INPUT REQUIRED FOR THE MACRO

�������������������������������������������������������������������

After the �DAY is entered the GUI integer value window appears and will accept a valid integerbetween � and ���

����� QUIT

Exit from the program �See EXIT Section � ��� Page �����

����� RAISE TO A POWER

RAISE TO A POWER allows all the elements of the ADR of the current data to be raised to adesired power� Depending on the power entered this allows the elements to be squared �POWER� � the square root of the elements obtained �POWER � ��� the reciprocal of the elementscalculated �POWER � ��� or an arbitrary power calculated� The operation is performed inplace the memory is not a�ected�

Depending on the power the range of valid input element values changes e�g� negative numbersare not valid if the square root is being taken� If invalid numbers are encountered the outputwill be given a special value and a warning message will be issued�

The user is prompted for the required power to which the ADR elements are to be raised� e�g�The prompt and input may be as follows to cube all the elements�

Page 158: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

POWER �� �

����� REBIN

Alternative name for RE�BIN command see Section � ��� Page � ��

����� RE�BIN

Rebins data in the ADR by integer and noninteger amounts� The user speci�es the number ofinput pixels to be rebinned into an output pixel in each direction� Output is in the �memory��

e�g� To rebin every two pixels in each direction into one output pixel�

Main menu ENTER COMMAND �INPUT DATA� rebin

X REBIN NUMBER �NUMBER INPUT TO � OUTPUT�

�Range �� to ��� ���

Y REBIN NUMBER �NUMBER INPUT TO � OUTPUT�

�Range �� to ��� ���

X START OUTPUT �Range � to �� ���

Y START OUTPUT �Range � to �� ���

Main menu ENTER COMMAND �EXCHANGE�

����� RECALL

Recalls a dataset from internal memory Data previously stored as current data is lost�

����� REFLECT

Re�ects data in the ADR about a line of re�ection speci�ed by the user� The user is promptedfor the coordinates of two distinct points to de�ne a line of re�ection and for the extent of theoutput region in the �memory��

The re�ected data is output in memory� Only the region of the memory corresponding to thecurrent data ADR is overwritten�

���� REGION

User input of coordinates to specify a new active data region� The user is prompted for thecoordinates of the lower left and upper right limits of the required ADR� The coordinates areall in data coordinates which are then converted to pixel numbers�

Note� The current ADR a�ects almost all data manipulation and data display commands�

Page 159: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

����� RING �ADD POWDER RING�

Adds a simulated powder ring to the current ADR� The powder ring has a Gaussian pro�le of aspeci�ed sigma and may by elliptical owing to detector nonorthogonality �tilt�� The simulatedpowder ring is added directly to the current data array�

The following example shows such a ring being simulated�

Main menu ENTER COMMAND �QUESTION� ring

X�DIRECTION PIXEL SIZE �MICRONS�

�Range ��E�� to ��� ����

Y�DIRECTION PIXEL SIZE �MICRONS�

�Range ��E�� to ��� ����

X�PIXEL COORDINATE OF BEAM CENTRE �����

Y�PIXEL COORDINATE OF BEAM CENTRE �����

SAMPLE TO DETECTOR DISTANCE �MILLIMETRES�

�Range �� to ��E��� ���

TILT PLANE ROTATION ANGLE �DEGREES�

�Range ���� to ���� ��� �

DETECTOR TILT ANGLE �DEGREES� �Range ���� to ����

��� �

OPENING ANGLE OF DIFFRACTION RING �DEGREES�

�Range � to ��� ���

PEAK MAXIMUM INTENSITY ����

STANDARD DEVIATION WIDTH �X�PIXELS� OF RADIAL PROFILE

�Range � to ���E���� ���

Main menu ENTER COMMAND �PLOT DATA�

����� ROI �Region Of Interest�

ROI is an alternative name for the PIXEL REGION command �See Section � ��� Page � ��� Thee�ect is exactly the same�

The command ROI has been added as this is tending to be the name used for this operation inan increasing number of PCbased image display programs� It has been added to FIT�D forcompatibility�

����� ROTATE LUT

Interactive rotation of the colour table controlled by a graphics menu� A number of �buttons�are produced within the graphics window which allow the current colour table to be rotated byset amounts� By clicking in the di�erent �buttons� the user should see the immediate e�ect ofrotating the colour table� The �button� labelled DEFAULT returns the colour table to the valuesthat were de�ned at the start of the operation� The �button� labelled EXIT is used to returnto the main menu�

Page 160: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Note� As the background and text are drawn using two of the colour levels they will changecolour during the rotation of the colour table� Text may no longer be visible� After the ROTATELUT command a PLOT DATA command can be issued to draw the data with the rotated colourtable and correct background and text colours�

����� RUN MACRO

Same as MACRO See Section � � � Page ����

����� SELECT PIXEL OPERATION

The SELECT PIXEL OPERATION command allows particular pixels to be selected for either multiplication or addition operations with a scalar depending on an input intensity value criterion�The user can select either pixels which have an intensity greater than an input constant orpixels which have an intensity less than an input constant� The pixels selected may either bemultiplied by an input scalar or added to an input scalar� The operations take place withinthe main program array�

This operation may be of use in ��agging� overloaded pixels�

Here is an example of the program output when all pixel values with greater than ��� havebeen multiplied by �� �

Main menu ENTER COMMAND �HELP� select

GREATER THAN COMPARISON �YES� �

�YES� if pixels are to be selected by a greater than comparison �exclusive�

�NO� if pixels are to be selected by a lesser than comparison �exclusive��

GREATER THAN COMPARISON �YES�

DECISION PIXEL VALUE �������� �

Input pixel value for comparison

DECISION PIXEL VALUE �������� �

MULTIPLICATION ��NO� � ADDITION� �YES� �

�YES� if the pixel values are to be multiplied by a constant� �NO� if a

constant is to be added to the selected pixels�

MULTIPLICATION ��NO� � ADDITION� �YES�

OPERAND VALUE ��� �

Input value to multiply or add to pixel values

OPERAND VALUE ��� ���

����� SEQUENCE

The SEQUENCE command is almost certainly the most powerful and also the most complicatedcommand within FIT�D� To cope with its complication much explanation of required input isavailable by entering a question mark ��� for each prompt� The SEQUENCE command allows aprede�ned macro to be run automatically on a whole series of �les with automatic de�nition

Page 161: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

of program variables �See Macros Section �� Page �� and the START MACRO commandSection � ���� Page ����� The SEQUENCE command can also be used to repeatedly run amacro without changing any �le names but this possibility is largely uninteresting unless aninput or output �le name is changed�

Often a large number of �les exist in some sequence and it is required to perform some operationon the �les and produce some output or a similar sequence of outputs� The output may data�les or may be graphics PostScript �les� Such a sequence of input �les typically looks like�

lys����pmi

lys���pmi

lys����pmi

lys������pmi

lys������pmi

lys�����pmi

File sequences of this sort can be treated but in fact much more �exibility is available�

� The value of the �rst �le does not need to be one

� Steps other than unity are also available

� The number of characters used to store the numerical part of the �le name is user controlled

� The number of characters used to store the numerical part of the �le name may be variable

� The variable numerical part of the �le name may be at the start middle or end of the�le name

� The �le name �variable value� does not have to vary

� Output �le names can be very similar to input �le names e�g� Only the �le extensionchanges or the name can be de�ned very di�erently e�g� The output �les can be outputin the reverse numerical order to the input �les

The SEQUENCE command allows a macro to be run for each �le in the sequence with controlover the variable values e�g� �le names of a variable number of program variables� A loopis run a number of times controlled by a loop variable which has a start value a maximumvalue and a step increment value� The value of the loop variable can be used to de�ne thevalues �translations� of the program variables�

The starting value of the loop counter variable is set and for each loop�

Page 162: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

� Program variables are de�ned based directly based indirectly or independent of the loopvalue

� A named macro is called and run with the de�ned variable values

� The loop counter value is incremented

� If the loop counter value is within the end condition value the previous operations arerepeated

To de�ne the sequence �rst the loop counter variable�s initial value end limit value �maximumor minimum inclusive limit value depending on increasing or decreasing counter values� andthe increment step value are de�ned� A valid �nite loop must be declared or FIT�D willreprompt for the input values�

LOOP COUNT START VALUE ���

LOOP COUNT END LIMIT VALUE �INCLUSIVE� ��� �

LOOP COUNT INCREMENT STEP ���

The increment step value may be a value other than � and may be negative� If the incrementstep is negative the END LIMIT VALUE must be less than or equal to the START VALUE� The loopwill always be run at least once� if you decide that you do not want to continue the SEQUENCEcommand now or later enter user escape �nn��

When the looping conditions are properly de�ned FIT�D prompts for the name of the macro�le to be run�

INPUT MACRO FILE NAME �fitd�mac�

The entered �le name is checked to exist and be a valid macro �le�

Next the number of automatically controlled program variables and variable values �translations� is de�ned� Program variables can also have been previously de�ned using the DEFINE

VARIABLE command but their values �translations� will be static whereas here they can bede�ned to change dynamically�

NUMBER OF VARIABLES TO DEFINE �Range to � ��

For each such de�nable program variable FIT�D prompts for the name of the variable followedby a number of other prompts which allow di�erent values to be de�ned depending on the loopcounter value� e�g�

ENTER VARIABLE NAME ��IN�

VARIABLE VALUE BASE �lys��� test�

VARIABLE PART FIXED LENGTH �YES�

NUMBER OF CHARACTERS IN VARIABLE PART �Range to � ���

Page 163: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

ARITHMETIC ON LOOP COUNT VALUE �NO� y

MULTIPLIER FOR LOOP COUNT VALUE �����

CONSTANT TO ADD TO MODIFIED LOOP COUNT VALUE ����

VARIABLE VALUE EXTENSION ��pmi� �temp

The ENTER VARIABLE NAME prompt requires names of required variables to be entered� Anystring may be entered but clearly it only makes sense to enter program variables which areused within the macro to be run �See Section �� Page �� �� By default the �rst variable nameis � IN and the second is � OUT�

Variable values are constructed from a �xed initial component a numerically based changingmiddle component and a �xed end component� The variable value may be up to a total of � �characters in length� Any of the three parts may be blank allowing the changing component tobe at the beginning or end and allowing nonchanging variable values� To de�ne a componentas blank a special program variable exists� ��BLANK�� ���BLANK is a special variable which isde�ned by FIT�D on startup��

First the base part of the variable values is entered� VARIABLE VALUE BASE �lys� � �

VARIABLE PART FIXED LENGTH �YES� prompts for whether or not the changing part of thevariable values should contain a �xed number of characters or a variable number�

If a variable number of characters is selected FIT�D prompts for the number of characters� NUMBER OF CHARACTERS IN VARIABLE PART �Range to � ��� � Otherwise thisprompt does not occur�

If a �xed number of characters is chosen numbers which take less characters than the inputnumber are padded out with preceding zeros� If at any time during the sequence the number istoo big to be represented in the given number of characters the sequence processing will stop�If a variable number is chosen only the characters necessary to represent the number will beused�

The loop counter value can be used directly or indirectly to de�ne the variable part of thevariable values� If indirect use is required enter YES to the ARITHMETIC ON LOOP COUNT VALUE

�NO� prompt� The default is NO� Entering YES allows the counter value to be multiplied by aninput multiplier and then added with an input addition constant prior to it being used to formthe variable value� The constants are input as real values and real arithmetic is performed�The result is converted to the nearest integer prior to being used to form part of the variablevalue� The integer used is de�ned�

variable integer value # Nint�Real�loop value� �multiplier � add constant� ���

Where� Real converts an integer number to a real numberNint converts a real number to the nearest integer

MULTIPLIER FOR LOOP COUNT VALUE ����� inputs the multiplier to be used andCONSTANT TO ADD TO MODIFIED LOOP COUNT VALUE ���� inputs the addition constant�

�This special variable is necessary� since just entering a space or returning will select the default value

Page 164: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

By using a negative multiplier and de�ning a suitable addition constant it is easy to de�ne asequence of program variables which count in the opposite direction to the loop counter value�

Finally the latter part of the variable value is entered� VARIABLE VALUE EXTENSION ��pmi� �Note� The required input is not the �le name extension but all the characters following thechanging part of the value including the dot ����

Note� The SEQUENCE command cannot be used within a macro� Thus if you have enteredthe START MACRO command and are in the process of creating a macro entering the SEQUENCEcommand will result in a warning message�

����� Examples of the SEQUENCE Command Usage

For normal use the SEQUENCE command should be relatively straightforward to use but toexploit the full potential may require some careful thought� In either case some examples areuseful�

The following example shows how the macro to correct for spatial distortion de�ned in Section ���� Page � � may be used to process a �le sequence starting with lys��gel and endingwith lys�gel� The corresponding output �les should have the same name as the input �lebut with the extension �dat instead of �gel� The macro �le is called lyso�mac and uses twoprogram variables� �IN for the input �le and �OUT for the output �le� The following is theprogram output and user input for this sequence de�nition�

Main menu ENTER COMMAND �INPUT DATA� sequence

LOOP COUNT START VALUE ��� �

LOOP COUNT MAXIMUM VALUE �INCLUSIVE� ���

LOOP COUNT INCREMENT STEP ���

INPUT MACRO FILE NAME �fitd�mac� lyso�mac

NUMBER OF VARIABLES TO DEFINE �Range to � ��

ENTER VARIABLE NAME ��IN�

VARIABLE VALUE BASE �lys��� lys

VARIABLE PART FIXED LENGTH �YES�

NUMBER OF CHARACTERS IN VARIABLE PART �Range to � ���

ARITHMETIC ON LOOP COUNT VALUE �NO�

VARIABLE VALUE EXTENSION ��pmi� �gel

ENTER VARIABLE NAME ��OUT�

VARIABLE VALUE BASE �lys�

VARIABLE PART FIXED LENGTH �YES�

NUMBER OF CHARACTERS IN VARIABLE PART �Range to � ��

ARITHMETIC ON LOOP COUNT VALUE �NO�

VARIABLE VALUE EXTENSION ��cor� �dat

As an example of a slightly more complicated task we look at renumbering a �le sequence inreverse numerical order� The �rst �le is ice��dat and the last �le is ice��dat� The output�le corresponding to ice��dat is to be called ICE��OUT and the output �le correspondingto ice��dat is to be called ICE��OUT� The macro is called ice�mac and uses the program

Page 165: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

variables� �IN for the input �le and �OUT for the output �le� The following is the programoutput and user input for this sequence de�nition�

Main menu ENTER COMMAND �INPUT DATA� seq

LOOP COUNT START VALUE ��� �

LOOP COUNT MAXIMUM VALUE �INCLUSIVE� �� �

LOOP COUNT INCREMENT STEP ���

INPUT MACRO FILE NAME �ice�mac�

NUMBER OF VARIABLES TO DEFINE �Range to � ���

ENTER VARIABLE NAME ��IN�

VARIABLE VALUE BASE �lys� ice

VARIABLE PART FIXED LENGTH �NO�

ARITHMETIC ON LOOP COUNT VALUE �NO�

VARIABLE VALUE EXTENSION ��gel� �dat

ENTER VARIABLE NAME ��OUT�

VARIABLE VALUE BASE �ice� ICE

VARIABLE PART FIXED LENGTH �NO�

ARITHMETIC ON LOOP COUNT VALUE �NO� y

MULTIPLIER FOR LOOP COUNT VALUE ���� ��

CONSTANT TO ADD TO MODIFIED LOOP COUNT VALUE ��� ��

VARIABLE VALUE EXTENSION ��dat� �OUT

����� SET ANNOTATION STYLE

The user may de�ne the text style �font size character spacing� and direction individually forall possible annotation labels �independently of whether or not they are being used��

����� SET ARROW STYLE

The user may de�ne the arrow style �colour line width arrow head type� for all possibleannotation arrows �independently of whether or not they are being used��

����� SET AXES STYLE

The user may de�ne the axes style �colour line width number of small tick marks� for horizontal and vertical axes�

���� SET BACKGROUND STYLE

By default the background of the graphics window is white and axes lines and text are black�SET BACKGROUND STYLE allows the background colour to be set� A number of basic colours areavailable�

Page 166: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Note� if a chosen colour is not available in the current colour table it will be approximated bythe �closest� available colour�

����� SET COLOUR

By default the axes lines and text are black� SET COLOUR allows the general foreground colourto be set� A number of basic colours are available� When used this will replace all colours aspreviously speci�ed for individual graphics items�

Note� if a chosen colour is not available in the current colour table it will be approximated bythe �closest� available colour�

����� SET CURVE STYLES

SET CURVE STYLES allows the style of representation of all possible curves which may be displayed by the program to be changed� �Typically ��� di�erent curve styles may be set�� Theuser speci�es the range of curves to be a�ected and speci�es whether line marker and�orerror bars are to be displayed� If a line is to be displayed the user is requested to choose colourline type and line width attributes� If markers are to be displayed the user can select the typeof markers to be displayed together with their colour size line width and interior �ll colour�Similarly for error bars the style colour and line width may be selected� �If variance estimatesare not present no error bars will be displayed even if they are selected herewithin��

����� SET ENUMERATION STYLE

The user may control output and style of the enumeration for the X and Yaxes� The size andcolour of characters may be set and the number of �gures used to label the axis positions��At present only one font family is available but for future uses the user is prompted for therequired font��

����� SET FONT

The user may select the text font to be used for all subsequent graphics Roman text e�g� titleslabels etc� The user is prompted for a number corresponding to each of the available fonts ���

�The command PUBLICATION QUALITY �Section � ��� Page � �� also �potentially� changes thetext fonts to the type of font considered best for high quality output��

��At present the graphics system only supports one font family so that the font do not change� but the fontfamily used� �Times�Roman� should be suitable for most purposes�

Page 167: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

����� SET GRID STYLE

The user may de�ne the style of horizontal and vertical �ne and coarse grid lines �colour linewidth line type� e�g�

Main menu ENTER COMMAND �INPUT DATA� set grid

HORIZONTAL COARSE GRID LINE TYPE �Range � to �� ��� �

� � solid� � dashed� � � dotted� � � dot�dash

HORIZONTAL COARSE GRID LINE TYPE �Range � to �� ���

HORIZONTAL COARSE GRID LINE COLOUR �BLACK� �

Enter one of the following available colours

BLACK BLUE BROWN CYAN GREEN GREY MAGENTA ORANGE RED VIOLET WHITE YELLOW

HORIZONTAL COARSE GRID LINE COLOUR �BLACK� orang

HORIZONTAL COARSE GRID LINE WIDTH SCALE FACTOR

�Range � to ��� ����

VERTICAL COARSE GRID LINE TYPE �Range � to �� ���

VERTICAL COARSE GRID LINE COLOUR �BLACK� oran

VERTICAL COARSE GRID LINE WIDTH SCALE FACTOR

�Range � to ��� ����

HORIZONTAL FINE GRID LINE TYPE �Range � to �� ���

HORIZONTAL FINE GRID LINE COLOUR �BLACK� red

HORIZONTAL FINE GRID LINE WIDTH SCALE FACTOR

�Range � to ��� ����

VERTICAL FINE GRID LINE TYPE �Range � to �� ���

VERTICAL FINE GRID LINE COLOUR �BLACK� red

VERTICAL FINE GRID LINE WIDTH SCALE FACTOR

�Range � to ��� ����

Main menu ENTER COMMAND �PLOT DATA� close

������ SET LAYOUT STYLE

The SET LAYOUT STYLE command allows the distances in the graphics diagrams to be changed�All the distances are speci�ed in page coordinate units �i�e� the longer edge is one unit long��

The following example shows the gaps between the axis labels and enumeration being reduced�

Main menu ENTER COMMAND �Z�SCALE� set lay

TITLE TO AXIS GAP �Range ��� to ���

���E�� �e�

X�LABEL TO AXIS GAP �Range ��� to ���

���E�� �e�

Y�LABEL TO AXIS GAP �Range ��� to ���

���E�� �e�

X�AXIS ENUMERATION TO AXIS GAP

�Range ��� to ��� ����E�� �e�

Y�AXIS ENUMERATION TO AXIS GAP

Page 168: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�Range ��� to ��� ����E�� �e�

Main menu ENTER COMMAND �PLOT DATA�

������ SET TICK POSITIONS

By default axes are produced automatically with large tick marks at convenient positions andsmall tick marks inbetween� Owing to the great variety of number ranges it is not alwayspossible to provide ideally spaced tick marks� This command allows the user to specify theirown positions for the large tick marks�

For the X and the Yaxes the user is prompted for automatic positions or not� If nonautomaticpositions are selected the user will be prompted for the start position �in data coordinates�the interval between large tick marks �data coordinates� and the number of large tick marksto draw on the axis� �The number of large tick marks is defaulted to a value which covers theaxes but not outside��

������ SET TITLE STYLE

The SET TITLE STYLE command allows the style of the title text output at the top of graphicaldiagrams to be changed from the default values� The output of the title or not the colourand the character size may be changed� �Other questions are asked but their answers have noe�ect at present��

In the following example the title text is made twice as large and red�

Main menu ENTER COMMAND �Z�SCALE� set title

OUTPUT TITLE �YES� y

TITLE FONT INDICE �Range �� to �� ���

TITLE COLOUR �BLACK� red

TITLE CHARACTER HEIGHT SCALE FACTOR �Range � to ���

����

TITLE CHARACTER WIDTH SCALE FACTOR �Range � to ���

����

TITLE CHARACTER SPACING �Range ��� to ��� ���

Main menu ENTER COMMAND �PLOT DATA�

������ SET X�LABEL STYLE

The SET X�LABEL STYLE command allows the style of the horizontal axis label text outputunderneath the frames of graphical diagrams to be changed from the default values� Theoutput of the Xaxis label or not the colour and the character size may be changed� �Otherquestions are asked but their answers have no e�ect at present��

See the SET TITLE STYLE command �Section � ���� Page ���� for an example of the userprompts�

Page 169: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

����� SET Y�LABEL STYLE

The SET Y�LABEL STYLE command allows the style of the vertical axis label text output to theleft to the frames of graphical diagrams to be changed from the default values� The output ofthe Yaxis label or not the colour and the character size may be changed� �Other questionsare asked but their answers have no e�ect at present��

See the SET TITLE STYLE command �Section � ���� Page ���� for an example of the userprompts�

������ SLEEP

The SLEEP command allows macros to pause for a determined time and then continue withoutany user intervention �c�f� the PAUSE command�� The length of pause is speci�ed in seconds�e�g� The following example pauses for seconds�

Main menu ENTER COMMAND �PLOT DATA� sleep

LENGTH OF PAUSE �seconds� �Range � to ���

���� �

This command is mainly useful for demonstration macros which should run continuously without any user intervention but nevertheless need to pause so that message text can be read�

������ SMOOTH

This is an alternative name for the BLUR command �see Section � ��� Page �����

������ SPATIAL FILTERING

Highpass or lowpass �ltering of the ADR using simple spatial �lters� The user may select lowor highpass �ltering with a choice of three degrees of �ltering for each� The output is in thememory�

NOTE� At present there is no error propagation for this command

������ START MACRO

Start recording commands within a named �le for later reuse as a macro� After the �le isopened all subsequent commands are recorded in the �le until the STOP MACRO command isissued� The macro can later be run with the MACRO command� If the MACRO command itselfis used the contents of the macro are written into the new macro �le� The manner to de�neand use macros are explained in Section �� Page �� � �Also see STOP MACRO Section � ����Page ��� and MACRO Section � � � Page �����

Page 170: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

������ STATISTICS

Calculate a number of basic statistical quantities from the data within the current ADR e�g�mean total counts and standard deviation� A typical program display may be as follows�

Main menu ENTER COMMAND �INPUT DATA� stat

Statistics of active data region �ADR�

DC limits Min � �� � �� � Max � �� � �� �

Pixel number limits Min � � � �� Max � � � ��

Total number of data values � � ! � � �

Minimum data value � �������

Maximum data value � ������

Average �mean� data value � �

Sum of data values � �

Root mean square �RMS� value � ������

Standard deviation value � �������

Skewness parameter � ������

�By changing the ADR and using STATISTICS a basic from of peak integration may be carried out� See IMAGE command Section � ��� Page ��� for the DISPLAY graphical submenucommand STATISTICS for much more �exible polygon integration possibilities��

The following program variables all of data type �oating point real are automatically de�nedby the STATISTICS command with corresponding values�

��MINIMUM Minimum data value within the ADR

��MAXIMUM Minimum data value within the ADR

��MEAN Mean �average� data value within the ADR

��TOTAL Sum of data values within the ADR

��RMS Root mean square value within the ADR

��SIGMA Standard deviation of data values within the ADR

��SKEWNESS The skewness parameter of the data values within the ADR

������ STOP MACRO

Closes a previously opened macro de�nition �le �The STOP MACRO command is not recordedwithin the macro�� �See START MACRO Section � ���� Page ��� and MACRO Section � � �Page �����

Page 171: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

������ STORE

Stores current data set in internal memory� The data is copied from the current data into thememory� Any previous data in the memory is destroyed�

Note� EXCHANGE may often be a much more e�cient alternative to STORE for large datasets�

������ SUBTRACT

Subtract the memory data from the current data throughout the current ADR�

������ SURFACE INTERPOLATION

The user de�nes a number of points in the current data ADR by clicking with the graphicalcursor� The program calculates an average intensity in the ��� pixel region centred on each userde�ned coordinate� Triangulation and bicubic spline interpolation is used to de�ne a surfacethroughout the ADR based on the user de�ned points� The output is in the memory�

For best results the input coordinates should be spaced throughout the ADR and more coordinates need to be de�ned where the surface should change quickly�

�An alternative and generally superior method of estimating background surfaces is availableas part of the FIT submenu��

����� SYMBOL

This is an alternative name for the VARIABLE � DEFINE VARIABLE command� they are identical�see Section � ��� Page �����

������ SYMMETRIC FUNCTION

Adds a circularly symmetric function to the current data calculated from a �D pro�le� The�D pro�le needs to have been previously loaded into the memory �the �rst row in the memoryis used to store the �D pro�le�� The user speci�es the centre of the required function in datacoordinates� The function is added to the current data���

�A �D radial pro�le can be calculated within the FIT submenu using the POWDER

DIFFRACTION command see Section ����� Page �� ��

��From V� onwards this option takes account of radial and image pixel sizes�

Page 172: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

������ TITLE

Allows the user to enter text for the title of the graphics� This will replace the old text�

������ THRESHOLD

The user is prompted for a minimum and a maximum threshold value� Any element of theADR which is below the minimum value is set to this value and any value which is above themaximum value is set to the maximum value�

Note� There is no error propagation for this operation�

������ TRANSPOSE

Provided that the program array sizes are big enough the ADR will be transposed and outputin the memory� i�e� DATA�x�y� will be transferred to MEMORY�y�x�� This will not only set thememory ADR but will also rede�ne the memory de�ned data sizes�

������ UN�DEFINE VARIABLE

Program variables are created by the DEFINE VARIABLE �see Section � ��� Page ���� andVARIABLE commands and automatically by various commands e�g� STATISTICS� As the variabletranslation table is of a �nite size�� and since the DEFINE VARIABLE and VARIABLE automaticallypole through the de�ned variable names as default suggestions it can be useful to be able toremove variables�

UN�DEFINE VARIABLE allows variables to be removed from the translation table� If no variablesexist a warning message is returned� If one or more variables exist the user is prompted forthe �name� of the variable to be removed� One of the existing variables will be proposed as adefault�

The following text shows an example of de�ning a number of variables automatically using theSTATISTICS commands and then removing all of the variables until none are left�

Main menu ENTER COMMAND �INPUT DATA� stat

Statistics of active data region �ADR�

DC limits Min � �� � �� � Max � �� � �� �

Pixel number limits Min � � � �� Max � � � ��

Total number of data values � � ! � � �

Minimum data value � ���

Maximum data value � ����

Average �mean� data value � ��������

Sum of data values � ��������

��Typically ��� variables can be stored�

Page 173: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Root mean square �RMS� value � �����

Standard deviation value � ������

Skewness parameter � ������

Main menu ENTER COMMAND �CLOSE LOG� un�define

ENTER VARIABLE NAME ���MINIMUM�

Main menu ENTER COMMAND �MACRO� un�define

ENTER VARIABLE NAME ���MAXIMUM�

Main menu ENTER COMMAND �MACRO� un�define

ENTER VARIABLE NAME ���MEAN�

Main menu ENTER COMMAND �MACRO� un�define

ENTER VARIABLE NAME ���RMS�

Main menu ENTER COMMAND �MACRO� un�define

ENTER VARIABLE NAME ���SIGMA�

Main menu ENTER COMMAND �MACRO� un�define

ENTER VARIABLE NAME ���SKEWNESS�

Main menu ENTER COMMAND �MACRO� un�define

ENTER VARIABLE NAME ���TOTAL�

Main menu ENTER COMMAND �MACRO� un�define

WARNING No variables are presently defined so you cannot �UN�DEFINE� any

Main menu ENTER COMMAND �MACRO� close

������ UNIT CELL PARAMETERS

Allows the user to convert the standard real space unit cell parameters a� b� c� �� �� and into the reciprocal space parameters a�� b�� c�� ��� ��� and �� All angles are entered anddisplayed in degrees and all distances should be in Angstroms or inverse Angstroms�

The user starts by choosing the direction of the conversion followed by the parameters of theunit cell�

������ VARIABLE

This is an alternative name for the DEFINE VARIABLE command� they are identical �see Section � ��� Page �����

������ VARIANCES DEFINITION

Often data is obtained which essentially is a�ected by counting statistics but which has beenscaled by an unknown scaling factor� To be able to estimate the variance of each data pointit is necessary to be able to estimate the scaling factor� This command estimates the scalingfactor and hence estimates the variance of each datapoint in the ADR�

This task is made slightly more complicated by detector background and by saturation of thedetector�

Page 174: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

The user inputs the range of nonbackground and nonsaturated datavalues� The programoutputs the scaling factor and calculates estimated variances� The variances are calculated byapplying local smoothing to the input data values and multiplying the result by the square ofthe estimated scale factor�

������ V�C

VC exchanges the current data with the variance array �if de�ned�� This can be used to allowthe variances to be altered� This is clearly a highly specialist command� so great careshould be taken if this command is used

����� WAIT

This is an alternative name for the PAUSE command �see Section � ��� Page � ���

������ WEIGHTED AVERAGE

Combines two images �one in the memory� both of which must have corresponding varianceestimates in the �optimal� manner of the weighted average� The operation is truly optimalonly if the variances are correct and the error statistics are independent Gaussian errors� Inpractical situations neither of these conditions are likely to be true but with care in estimatingthe variances the results should be statistically better than simple addition�

������ X�AXIS LABEL

Allows the user to enter text for the label of the Xaxis of the graphics� This will replace theold text�

������ Y�AXIS LABEL

Allows the user to enter text for the label of the Yaxis of the graphics� This will replace theold text�

������ Z�AXIS LABEL

Allows the user to enter text for the label of the Zaxis �intensity� of the graphics� This is thetext that will appear alongside the bar showing the current colour table� This will replace theold text�

Page 175: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

������ Z�SCALE

By default displayed images are automatically scaled to display the complete range of intensitiesin the displayed region� This behaviour can be modi�ed using Z�SCALE� Five Zaxis �intensity�scaling modes are available�

� �� Automatic full data range �default�

� �� User set minimum and maximum

� �� User set minimum but automatic maximum

� �� Automatic minimum and user set maximum

� �� Automatic �Weak Di�raction peak� scaling

Depending on the scaling mode selected you may be prompted for the minimum and the maximum values to be displayed� Once set the scaling mode continues to operate on all subsequentimages until Z�SCALE is used again to change the mode� �This may lead to strange results ifyou forget that you have set a particular scaling range��

The Automatic ��Weak Diffraction peak�� scaling option allows an adaptive scaling option which is designed to automatically adjust the scaling range to display e�ectively weak datapeaks� This is done by examining the image statistics in the the centre of the image or all of theimage if the ADR is small� From the average the standard deviation and the skewness of thedistribution an appropriate display range is calculated� This option is still under developmentto �nd the best scaling under a wide variety of circumstances�

As well as automatic or manual selection of the intensity scaling range the intensity scalemay be either linear or logarithmic �V��� �� The user is prompted for logarithmic scaling �thedefault is �NO��� e�g�

LOGARITHMIC IMAGE SCALING �NO� �

The false colour image display may use either linear intensity scaling

�the default�� or logarithmic intensity scaling� Here you can choose

which to use� Enter ��YES�� for logarithmic scaling� ��NO�� for linear

scaling�

LOGARITHMIC IMAGE SCALING �NO�

If logarithmic scaling is used and the linear scale includes ��� or negative numbers automaticthresholding is applied to avoid the problem of very small numbers� The threshold level dependsof the scale being displayed�

Page 176: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Calibration Submenu

Spatial distortions intensity nonlinearity �at�eld nonuniformity of response and for imageplates the decay of the latent image with time can be calibrated and corrected� The processof measuring a spatial calibration grid de�ning an approximate interpolating function and ofsubsequent correction to images is divided into a number of separate operations� This is toallow the maximum of �exibility to cover di�erent detector systems and di�erent approachesto the calibration process e�g� di�erent interpolating functions� The program tries to guide theuser through a logical sequence of commands for the spatial distortion calibration process butthis may not always correspond to a user�s needs� �Use the ��� to obtain a full list of availablecommands��

The calibration and correction process may be divided into two processes�

Distortion Calibration

Distortion Correction

In the case of spatial distortion this means� a� producing a calibration interpolating splinefunction b� Using the spline function to correct a distorted image� For the uniformity ofresponse the calibration stage means producing a normalised ��at�eld� image �or its inverse�and the correction stage means pixel by pixel division �or multiplication� of the distorted databy the calibrated �at�eld image�

The two operations may be performed completely separately� hopefully a detector system maybe calibrated once and the measured distortion corrected on many subsequent data images�The correction process may eventually be performed on an online processor as the data arebeing acquired� �The correction process is much simpler than the calibration process��

���� De�ning a Spatial Distortion Calibration Function

At present the spatial distortion is measured from a known grid of holes on a calibration mask�� �� ���� The calibration mask should cover the whole of the detector area and should ideallybe placed �at against the detector and exposed to Xrays �or other radiation� at some distancefrom the detector� �The larger the distance the less the problem of parallax�� Alternatively apoint source at the sample position can be used to produce exactly the same parallax as thesample�

The calibration data should be input in the normal manner �See Section � � � Page �����Before entering the calibration submenu the ADR may need to be de�ned �using the REGIONcommand the PIXEL REGION command or the IMAGE graphics submenu�� The calibrationmeasurement and function de�nition is limited to the ADR� Experience shows that it is important to inspect the calibration grid image and to de�ne an ADR which includes all valid gridpeaks but does not include partially recorded grid peaks or other spurious features��� It may

��At the edge of imaging plate images it is possible to have a false line of peaks owing to light scatter o theedge� Such a false line of peaks could be mistaken for genuine peaks and lead to false distortion values whichcan lead to a false distortion function� Partially recorded peaks may also lead to false values for the distortion�

Page 177: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

also be useful to use the Z�SCALE command to select an intensity range to be displayed�

The normal order of commands for distortion calibration is �commands with a dagger �y� arerecommended but not strictly necessary��

FIND PEAKS� Find centres of grid peaks as measured on the detector and estimate initialdistortion values

DISPLAY DISTORTIONy� View �verify� calculated distortion values as �D images

FIT GRID PEAKS� Fit �D interpolating function to measured X and Y distortions

OUTPUT DISTORTION FUNCTIONy� Save distortion function coe�cients in an ASCII �le forsubsequent correction of data�

Additionally the command RE�CALCULATE DISTORTION may be used to change the assumptionsused to de�ne the distortion and the command VIEW PEAKS may be useful to view by row andby column the measured peak centres and the calculated distortion� SAVE PEAKS may be usedto output all the measured peaks to an ASCII �le� This can then be used as input for aspreadsheet or graph plotting program for further processing or display�

���� Spatial Distortion Correction

The distorted data should be input in the normal manner �See Section � � � Page ����� Beforeentering the calibration submenu the ADR may be de�ned if only a subregion of the data isof interest�� �using the REGION command the PIXEL REGION command or the IMAGE graphicssubmenu ZOOM IN graphics command�� If only part of the data is of interest de�ning asmaller ADR will save time� The correction will be applied throughout the ADR �provided theinterpolating function is valid�� If the ADR extents outside the valid region of the interpolatingfunction only the region within these limits will be corrected and the user will be informed ofthe limits�

Enter the calibration submenu using the command CALIBRATION� In general the commandINPUT DISTORTION FUNCTION will be used to recover a previously calculated spatial distortionfunction� �If such a function has already been de�ned this is not necessary��

The correction is applied to the data using the command SPATIAL CORRECTION� This rebinsall pixels in the current ADR and outputs them in the memory� This process may take severalminutes for large images �further optimisation of this process is possible��

Having corrected the spatial distortion the result is in the memory so after using EXIT to leavethe calibration submenu you should use EXCHANGE to make the corrected data the currentdata �this is the default option��

��Previously it was necessary to limit the ADR to the valid region of the interpolating function� This is nowperformed automatically�

Page 178: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

���� Non�Uniformity of Sensitivity Response �Flat�Field Correc�tion�

�Note� The approach described to calibrate and correct for the �at�eld response has beenshown at the ESRF to be able to produce high quality data when used in conjunction with atechnique to produce smooth �ood�eld illumination� Such a technique has been suggested byJeanPierre Moy using �uorescence from elements held in an amorphous lithium borate glass������

Owing to geometry and artifacts of manufacture the sensitivity of di�erent areas of the detectormay vary� This variation may be a low frequency e�ect e�g� geometry e�ects or may be highfrequency e�g� pixel to pixel sensitivity di�erences in a CCD chip� With the assumption thatthe e�ect of the point spread function is not important this can be calibrated by uniformexposure of the detector �� �� It is necessary that the error owing to counting statistics is lessthan the required accuracy of the calibration e�g� if �� accuracy is required in the calibrationimage then a minimum of ����� true counts per pixel are necessary�

In practice it is quasi impossible to satisfy the two requirements� Any source which is closeenough to give a reasonable �ux will not give completely uniform response� If the source is anisotropic point source then the nonuniformity may be a simple geometrical e�ect� In manycases a point source is required as the sensitivity of the detector will change not only as afunction of the detector position but also as a function of ��D� source position� In such a casethe way to calibrate the detector for a di�raction experiment is to have a point source at thesample position�

Unfortunately we have not found convenient Xray sources which are isotropic at the �� level�Thus we need to characterise the source distribution� With the assumption that the sourcesare at least circularly symmetric the intensity distribution of the sources has been characterisedusing a zerodimensional detector on the twotheta arm of a di�ractometer�

Three di�erent types of �ood�eld �� sources have been used each with advantages and disadvantage�

� Radioactive sources give a reasonably smooth distribution and are easily portable allowing source rotation to ensure circular symmetric intensity distribution� They o�eronly low count rates and are only conveniently available in a limited range of energies�Overnight exposures are necessary�

� Amorphous di�use scatterers can give reasonable count rates at the required energy provided a synchrotron source is available but often contain unwanted structure in theangular intensity distribution�

� Fluorescent cells containing a solution of the �uorescent material can be very nearlyisotropic sources at ��o to the illumination and can give reasonable count rates with asynchrotron source� However the energy will always be slightly lower than that of theincoming radiation� We have found that Bragg scattering structure can be minimised byusing lithium borate glasses doped with the �uorescent material ����� These glasses may

��The term ��ood��eld� is used to refer to a smooth� but not completely uniform radiation� whereas the term��at��eld� is used to refer to a completely uniform radiation�

Page 179: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

be thin and machined parallel and may be mounted in the sample position orthogonalto the beam� As they are solid there is no problem of evaporation and there emissiondistribution does not change with time�

With synchrotron sources polarisation will cause the distributions of any Compton scatteringcomponent not to be circularly symmetric but this e�ect can be calculated and corrected� Having calibrated the source intensity distribution the recorded �ood�eld image may be correctedfor source anisotropy polarisation geometrical �

r�fallo� and any absorption e�ects�

��� Data Collection Sequence for the X�ray Image Intensi�erCCDDetector System

This is an overview of a full calibration� data collection strategy necessary to obtain quantitativeresults from the Xray Image Intensi�er�CCD readout detector system �XRII�CCD� ��� ���or similar detector system� It is intended as a check list for anyone performing a crystallographyexperiment� Aspects which require further consideration are discussed in Section ��� �

The following list is for measurements which may be performed separately from the data collection before or after�

�a� Calibration measurements to determine intensity nonlinearity� At present the ESRFXRII�CCD system appears to be su�ciently linear to avoid the need for correction�

�b� Collect response of CCD camera to uniform light source �illuminated piece of paper���Correct for dark count� to get CCD uniformity of response function� �Averaging images will improve accuracy�� �Probably performed before the experiment at the normaloperating temperature��

�c� Place di�use scatterer��uorescent cell at the sample position�

�d� Take �D �� scan of di�use source��uorescent cell distribution� At each angular positionthe counter must be left long enough to reduce counting statistics to the required level��Scans at other angles than the plane of the synchrotron may be useful if it is possible toobtain these��

�e� Recording the �D source distribution on Xray �lm or image plates may be useful toverify the extent to which the intensity distribution is circular symmetric�

�f� Collect reference �� scan without di�use scatterer��uorescent cell or with cell containingonly solvent�

This is a proposed sequence for e�cient collection crystallography and calibration data� Thispresupposes that the detector linearity is known that the CCD pixel to pixel �at�eld responseis available and that a di�use scatterer with a known angular distribution of intensity for therequired wavelength is available� �The order is the result of practical experience��

�a� Place calibration grid on the detector�

Page 180: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�b� Place di�use scatterer��uorescent cell at sample position�

�c� Measure sample to mask distance�

�d� Collect spatial distortion calibration grid image�

�e� Collect �ood�eld image with di�use scatterer��uorescent cell�

�f� Remove di�use scatterer��uorescent cell�

�g� Collect reference image for �ood�eld exposure integration time without �uorescent cellor with cell containing only solvent�

�h� Collect beam centre image or �wax� image unless a semitransparent beamstop is beingused�

�i� Place sample at sample position�

�j� Collect di�raction data images �without changing the magnetic environment e�g� Do notchange the position of large metallic objects such as the di�ractometer cradle��

�k� Collect �dark count� �empty capillary� images for standard data exposure integrationtime�s�� �Averaging images will improve accuracy��

�l� If data must be collected in a di�erent magnetic con�guration the spatial distortion andideally the �ood�eld response should be recalibrated� �Repeat steps �a�h��

�m� Remove sample

�n� Place di�use scatterer��uorescent cell at sample position�

�o� Collect �ood�eld image�

�p� Collect spatial distortion calibration grid image�

�q� Collect reference image for �ood�eld exposure integration time without �uorescent cellor with cell containing only solvent�

�Steps �n�q are included to verify if that the spatial distortion has remained constant since itwas last calibrated��

���� Notes on the Data Collection Sequence for the XRIICCDDetector System

���� Step �b� CCD Camera Uniformity of Response

Obtaining highly accurate uniformity of response calibration measurements from the systemas a whole may be very di�cult however the high spatial frequency variation will mainly berestricted to the CCD chip and the other components will generally contribute only low andmedium frequency components� Hence it is useful to calibrate the CCD chip uniformity ofresponse separately �an easier experiment��

Page 181: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

The e�ect of di�erent temperatures and readout speeds should not be too important� Nevertheless the readout conditions might as well be kept identical�

The CCD camera can be illuminated by an uniform source of visible light e�g� an illuminatedpiece of paper� The exposure camera could be rotated by ��� during the measurement severaltimes to reduce any low frequency unevenness in illumination or such e�ects could be removedin software� An appropriate dark count image should be subtracted from the �at�eld imagesand several �at�eld images should be averaged to reduce statistical noise although this shouldbe less of a problem than for the dark count images�

���� Steps �f� �k� Reference or Dark Count Images

It may be useful to obtain reference images with and without Xrays� Probably referenceimages which include Xray background are the best for subtracting from the �uorescent cellmeasurements� In this manner Xrays not coming from the source position should be eliminatedfrom the �at�eld response� Using a �uorescent cell only containing the solvent should allowstructure coming from the solvent e�g� the water ring to be removed from the �uorescence�ood�elds� Some scaling will be necessary to account for the absorption of the �uorescentsample� In the case of the di�raction data a good reference image will be an empty capillary�

The detector dark count is assumed to vary from pixel to pixel and consist of a constant anda time varying quantity� It is temperature dependent so the CCD camera should be at thetemperature that subsequent data is going to be taken� With the Photometrics camera thismeans ���C will be used���

The dark count characteristics change as a function of readout speed so this should be �xed�Again with the Photometrics camera the readout speed is �xed to ���kHz whereas the Princeton Instruments system allows � ��� and � � kHz�

The dark count images will be subject to statistical noise which should be relatively appreciablesince �hopefully� the dark count images will not be very strong� To reduce this noise sourcethe average of a few di�erent images should be used�

The simplest approach is just to integrate dark count images for exactly the same time periodas the subsequent data images and the �ood�eld images� However if the build up of darkcounts is really as simple as a constant plus a linear time dependent quantity two di�erentmeasurements at di�erent time periods would be su�cient to obtain all these parameters forall di�erent exposure lengths� This model could be tested by making dark current measurementsfor many di�erent integration times and seeing if the values do �t this simple model�

���� Steps �a�c� Spatial Distortion Calibration Grid

The grid should be carefully placed on the detector in a standard orientation �so that the orientation is reproducible�� The sample to mask distance should be measured �as it is e�ectivelythe sample to detector distance for the corrected data��

��At lower temperatures condensation occurs� unless dry nitrogen is used�

Page 182: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

���� Step �c�f� and �e�g� FlatField Calibration

The aim is to calibrate the the �at�eld response of the detector to Xrays coming from thesample position� Owing to the lack of an isotropic Xray source it is necessary to use a sourcewith a anisotropic distribution and calibrate the distribution with a �theta scan of a �Ddetector�

In Steps �d and �f a collimator may be used such that the �D scintillation counter �or similardetector� is only sensitive to Xrays from the sample position� The counting time at each pointshould be su�cient so that counting statistics errors are well below �� � This will probablyrequire a long scan time so either the beam decay needs to be monitored with an I monitor orthe scan needs to be carried out in both directions and averaged �more sophisticated treatmentwould be possible but averaging is probably quite good enough given the ESRF beam decay����

In Step �e the �ood�eld illumination of the XRII will include illumination from sources otherthan the sample e�g� hutch background� We are not interested in the response from othersources so we include Step �f where the �ood�eld source is removed and only the Xraysfrom other sources are measured� By subtracting the two images �measured for equal times�the �ood�eld image we measure is that from the sample point alone �except for secondaryscattering by the air inbetween the sample point and the detector� this should be negligible��

In subtracting the reference image from the �uorescent cell image we are automatically takinginto account the dark current� Again it may be useful to average several images to reducecounting statistics errors�

When correcting the di�raction patterns we will correct an image with both peak and background combined by the �at�eld response to the sample position� Since subsequent softwarewill separate the peak from the background the fact that the background �which does notnecessarily come from the sample position� is also corrected by the �at�eld response to thesample position is unimportant�

���� Calibration Sub�Menu Commands

���� �

List of available commands in the calibration submenu together with brief description of theirfunction� �See HELP��

���� CALCULATE DISTORTION FUNCTION

The complete interpolated distortion spline may be calculated for the whole of the ADR withthis command provided of course a distortion spline has been �tted or input� The values ofthe distortion spline are output in the �memory�� This may be useful to check that unwantedoscillations are not present in the �tted spline surface�

��This works to the extent that the decay is linear�

Page 183: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

���� DECAY CORRECTION

It has been noted by various investigators that the Xray signal recorded on an imaging platedecays between the exposure and the readout by a scanner �� � � � �� ���� This decay canboth reduce the measured intensities and more seriously lead to variable intensity responsealong the scanned plate� The magnitude of this e�ect can be to �� � for short exposureswhich are scanned soon after exposure so has an appreciable e�ect on the integrated datastatistics�

The decay of Fuji white and blue image plates has been accurately measured at the ESRF in along series of calibration measurements by Olof Svensson� The measurements show the decayto be independent of the small temperature variations present in the ESRF Experimental Hall��Note� The decay curve for the Kodak plates is di�erent�� The decay curve measurementshave been �tted by the least squares criterion to the following equation ������

Ft # ���e�t��� � ���� ����e�t��� ���

Ft is the fraction of the original recorded signal remaining after a time t in seconds from theexposure�

The user has the option of using this equation with the decay constants speci�ed and usingscan timing results measured for the Molecular Dynamics ���E scanner or entering their ownconstants for the exponential decay and the scanner times�

The user is prompted for�

FULL USER CONTROL �NO�

If the default of NO is entered FIT�D will prompt for the choice between �� �m and ��� �mscan as this a�ects the time of scanning�

��� MICRON SCAN ��NO� FOR �� MICRON� �YES�

Otherwise FIT�D outputs the basic equation used to approximate the decay and inputs uservalues for the decay time constants and the proportion of the �fast� and �slow� decay components�

The decay is approximated by the sum of two exponential decays� The

fraction is remaining signal t seconds after exposure I�t is defined by

I�t � P�fast ! Exp��t�T�fast�� ��� � P�fast� ! Exp��t�T�slow�

where P�fast is the proportion of the fast decay component

��Originally a dierent equation was used� ��tted� by eye� the values produced by the two equations are verysimilar�

Page 184: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

T�fast is the time constant of the fast decay �in seconds�

T�slow is the time constant of the slow decay �in seconds�

PROPORTION FAST DECAY �Range � to ��� �������

TIME CONSTANT OF FAST DECAY �SECONDS�

�Range � to ��E��� ���������

TIME CONSTANT OF SLOW DECAY �SECONDS�

�Range � to ��E��� ��������

This is followed by an explanation of the times used to calculate the minimum and maximumdecay times for each line and the input of the scanner delay time from the user start �buttonpress� to the start of the physical laser scan of the �rst line the time to scan the image andthe number of lines scanned�

The program calculates for each line in the image the average decay that

has taken place from the longest time from first exposure to the scan�

to the shortest time from the end of the exposure to the scan� To know

this it needs to know how long was the exposure� the time between the

exposure and the user start of the scan �both these questions are asked

later�� the time from the user start of the scan �click with with the

mouse� or similar� to the physical scan of the first line of the image�

and the time to scan each line of the image� The time to scan each line

is calculated from the total time of the physical scan divided by the

number of scanned lines�

START�UP TIME �SECONDS� �Range � to ��� �����

IMAGE SCAN TIME �SECONDS� �Range � to ���� ����

NUMBER OF SCANNED LINES �Range � to �� �����

For both FULL CONTROL or not the user is prompted for the length of the exposure and thetime from the end of the exposure to the start of the scan �user button pressed�� Both timesare in seconds�

EXPOSURE LENGTH �SECONDS� �Range � to ��E���

����

ELAPSE TIME �FROM END OF EXPOSURE TO SCAN� SECONDS�

�Range � to ��E��� ����

From this information the normalised integral of decay is calculated for each line of the scannedimage �the di�erence within a scanned line is insigni�cant�� From the decay values correctionvalues relative to the �rst line of the ADR are calculated and applied to every pixel in theline�

At the end of the correction FIT�D will output the maximum correction factor which wasapplied to the last line to be scanned� This information may be useful in estimating therelative importance of the decay� e�g�

Page 185: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

INFO Maximum correction factor � ������

The correction takes place in the current data the old data values are replaced by the correctedvalues�

Note� If the oscillation method is used to collect crystallographic data and if the total exposuretimes are long then it is important to oscillate the crystals several times during each exposure�This is necessary since the correction assumes that all recorded Xrays have arrived uniformlywith time ��

���� DESTROY GRID PEAKS

Sometimes false peaks may be found on the edge of the grid which can lead to problems in�tting a smooth interpolation function� To overcome this problem DESTROY GRID PEAKS allowsthe user to speci�c peak positions from the found grid and turn the peak to a missing peaks�Note� This operation is not reversible without recommencing the FIND PEAKS operation�

���� DISPLAY DISTORTION

After the FIND PEAKS command it is possible to display the measured X or Ydistortion asestimated over the �D grid of peaks� This command will display the distortion values as a �Dimage� False colour is used to show the values of the distortion� Each pixel is a peak of the grid�Missing peaks are displayed with a zero distortion value� �Strictly the measured positions arenot regularly spaced but the deviation from ideal positions is hopefully not too great so thisdisplay should give a reasonable idea of the distortion function over the detector surface��

�If nothing appears to be displayed in the image it may be because Z�SCALE has been used toselect a �xed intensity range for display� If this is the case return to the main menu set thezscaling to automatic and return to the calibration submenu��

���� EXIT

To return to the main menu EXIT should be entered� As the calibration submenu uses extradynamic memory to store peak positions and the spline coe�cients the user is given the choiceof saving these values or recovering the memory which means the values are lost� If you answerYES any spline correction coe�cients are lost and need to be reinput or calculated�

���� FAST CORRECTION

Corrects data in the current data ADR using a lookup table which must have been previouslyde�ned using LOOK�UP TABLE �SPATIAL DISTORTION� or input from a �le using LOAD LOOK�UP

TABLE�

�Phil Evans at the MRC Cambridge has written software to correct for the decay taking into account thetime that particular hkl re�ections were in the diracting condition�

Page 186: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

This method is much faster than having to recalculate geometrical areas for every data imagebut the stored lookup table is very large so a large amount of computer RAM should beavailable on the system�

���� FIND PEAKS

FIND PEAKS tries to measure the central position of peaks de�ned in a regular grid as the resultof a calibration measurement with a grid of known hole to hole distances� The entire ADR willbe searched for peaks so prior to FIND PEAKS the ADR should be set to the required region�Ideally the ADR should just contain all peaks to be measured�

The search is started by the user de�ning three peaks graphically� A ������� region of theADR is displayed as an image and the user is invited to click on the centre of the starting peakone peak horizontally from the starting peak and one peak vertically from the starting peak���The size of the displayed region may be changed by prior use of the SIZE �IMAGE DISPLAY�

option �see Section �������� Page ����� Clicking on the exact centre is not necessary but theinput coordinate needs to be close to the peak or the peak searching can get lost�

After selecting an initial starting peak it is necessary to select the peak horizontally to the rightof the starting peak and then the peak vertically upwards from the starting peak���

Two parameters are available to allow rejection of noise and spurious features�

MAXIMUM PEAK SEARCH DISTANCE and PEAK DETECTION RATIO�

MAXIMUM PEAK SEARCH DISTANCE sets the maximum distance in pixels from predicted positionof a peak to a found �peak� position� Apart from the �rst three user input peaks every peakhas a predicted position based on the positions of previously found nearby peaks� The predictedposition is used for the start of the peak search� If the peak search goes further than the SEARCHDISTANCE value from the initial position then the peak is deemed to be missing� This valuemay be reduced if the peak search is �following� spurious features or may be increased if thedistortion changes quickly relative to the grid peaks and genuine peaks are not being identi�ed�

PEAK DETECTION RATIO� This parameter allows rejection of noise and spurious features whichhave been found within the search distance� This is the ratio of the crosscorrelation valuefound for a new �peak� relative to that of the last accepted peak� �For genuine peaks thecrosscorrelation values are proportional to intensity�� If too low a value is set noise may bemistaken for peaks whereas if too high a valid is set genuine peaks may be rejected�

PEAK STANDARD DEVIATION WIDTH� Initially the peaks are assumed to be circularly symmetric�D Gaussians in pro�le� The user must enter the standard deviation size of the peaks in pixelunits� �If this value is wrong or the pro�le is not Gaussian the centres should still be correctso long as the actual pro�le is also symmetric and the entered value is about right�� The FITsubmenu may be used to �t �D Gaussians to the peaks prior to calibration �See Section ��Page �����

��Almost any starting peak may now be used� whereas previously it had to be the lower left�hand peak of thegrid�

��It is possible to skip peaks and have the search only �nd every other peak or every third peak� but undernormal circumstances every peak will be used�

Page 187: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

NUMBER OF SUB�PIXELS� This sets the precision to which the peak centres should be determined� the number of subdivisions into which each pixel should be divided when �nding thebest peak position� e�g� A value of will mean that the centre of each peak will be determinedto the best �

�pixel bin in each of the X and Ydirections� The larger the value the longer the

peak search will take and the higher the accuracy provided the data statistics are good enough�

The program will now try to �nd all peaks in the ADR on the regular grid� First a �cross� ofpeaks is searched� Starting from the initial three peaks all peaks along the positive �horizontal�vector are found followed by all peaks along the positive �vertical� vector negative �horizontal�vector and the negative �vertical� vector� This �cross� is used as starting points for the peaksearch in each of the four de�ned quadrants� As such it must not contain any missing peaks���If the �cross� is found to contain missing peaks the peak search stops immediately� Usually analternative starting position will overcome this problem otherwise the ADR may need to berede�ned� If the central �cross� is found without missing peaks this sets the maximum size ofthe grid search� Each of the four quadrants is searched using starting estimated peak positionsfrom the �cross�� Missing peak positions may be encountered and the search will continue tolook for subsequent peaks��� The peak search can take many minutes for large grids so theprogram will periodically inform you on the progress�

When �nished FIT�D outputs the number of peaks found and the size of the grid of peaks�Following the grid size is the number of holes in the whole grid as found� From this numbersthe number of missing peaks can be calculated� �When the beamstop covers some holes orwhere the edge of the grid is not recorded owing to a circular detector some missing peaks arenormal��

GRID SPACING �CENTRE TO CENTRE IN microns�� In order to calculate the distortion fromideal positions the program needs to know the distance between grid holes �this is the centreto centre distance�� The input spacing is in microns� �If this distance is wrong the distortionshape will still be correctly calculated but the deduced average pixel sizes will be wrong��

The option to correct peak positions for the e�ect of o�axis mask vignetting is now given�

CORRECT OFF�AXIS MASK VIGNETTING �YES�

Mask vignetting is the shadowing caused by the �nite thickness of the calibration mask� �Thisoption was introduced in V������ For o�axis hole positions the Xray illumination is nonorthogonal to the mask �the mask is assumed to be orthogonal to the direct Xray beam��Thus the �nite thickness of the mask leads to a shadowing of the hole and the e�ective centreof the grid peak will move outwards slightly� This option allows this e�ect to be estimated andthe peak positions corrected�

If this option is chosen the user will be prompted for the necessary experiment geometricalinformation�

MASK THICKNESS �microns� �Range �� to ��E���

���

��This constraint is caused by the software not by any fundamental reason���The peak search is now much more robust than was previously the case�

Page 188: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

SAMPLE TO DETECTOR DISTANCE �MILLIMETRES�

�Range �� to ��E��� �����

INFO The beam centre does not need to be specified accurately� An

approximate centre is appropriate�

X�PIXEL COORDINATE OF BEAM CENTRE ������

Y�PIXEL COORDINATE OF BEAM CENTRE ������

Note� An approximate beam centre is quite good enough for this correction� The correctionshould normally be a small e�ect and is only worthwhile at short sample to mask distances �%� �mm� or with unusually thick masks� Near the centre there will be almost no e�ect�

Based on the measured peak centres and the input grid spacing the program calculates averagepixel sizes based on the average distance between the furthest peaks on the rows and columnsand based on the RMS pixel sizes found from adjacent peaks� As the grid may not be perfectlyaligned to the detector raster an average rotation is also calculated�

IDEAL X PIXEL SIZE �MICRONS�� � IDEAL Y PIXEL SIZE �MICRONS��The user is prompted for values for the ideal raster pixel sizes �in microns�� These valueswill be used to calculate the �distortion� values and eventually will be the pixel sizes forspatially corrected images� The RMS X and Ysizes are given as default values� Depending onthe �exibility of subsequent processing software it may be necessary to set square pixels� Bydefault the pixel sizes will in general be nonsquare�

GRID ROTATION ANGLE �DEGREES�� This is the angle of rotation of the grid �horizontal� relativeto the detector raster� This avoids grid mask misalignment being counted as distortion� Bydefault the average value of mask rotation based on the ends of the columns and rows of peaksis given� For Molecular Dynamics scanner data the value based only on the columns may bebetter as the scanner is continual moving in the Ydirection as the Xdirection is being scanned�

X�NUMBER OF IDEAL HOLE� � Y�NUMBER OF IDEAL HOLE� De�nes zero distortion reference position� By default the centre of the grid but the de�ned grid position must not be a missingpeak���

These values are used to de�ne initial values for the spatial distortion at each peak position��The distortion is de�ned as the ideal position minus the measured position�� �The distortionvalues can be changed using the RE�CALCULATE DISTORTION command��

It is strongly recommended to use the DISPLAY DISTORTION command to verify that the peaksearching has produced reasonable results prior to further processing�

Here is an example of the program dialogue�

Calibration sub�menu ENTER COMMAND �FIND PEAKS�

MAXIMUM PEAK SEARCH DISTANCE �PIXELS� �Range � to �� ��� �

PEAK DETECTION RATIO �Range � to ���� ���� �

PEAK STANDARD DEVIATION WIDTH �Range � to ��E���

����� ���

NUMBER OF SUB�PIXELS �Range � to �� ��� �

��Again this is not for any fundamental reason�

Page 189: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

INFO Starting peaks found O�K�

INFO Starting peak is at position ��������� ���������

INFO Next first grid axis peak is at position ���� �����

INFO Next second grid axis peak is at position ����� ���������

PROGRESS REPORT FREQUENCY �PEAKS� �Range � to �� ��� �

INFO Starting peak search� this takes some time for big grids

INFO Found � peaks

INFO Found peaks

INFO Found � peaks

INFO Found � peaks

INFO Found � peaks

INFO Found � peaks

INFO Number of peaks found � ��

INFO Number of grid peaks �X�Y� � � � � ����

INFO Time taken � ��� seconds

GRID SPACING �CENTRE TO CENTRE IN microns�

�Range �� to ��E��� ��� �

INFO Average pixel size in X�direction � ������� �� ����� microns

INFO Average pixel size in Y�direction � ������� �� ����� microns

INFO Overall average pixel size � ������� �� ���� microns

INFO RMS pixel size in X�direction � �������

INFO RMS pixel size in Y�direction � �������

INFO Average rotation based on rows � ������� �� ����� degrees

INFO Average rotation based on columns � ������ �� ���� degrees

INFO Average rotation �both rows and columns� �

INFO ������ �� ���� degrees

IDEAL X�PIXEL SIZE �MICRONS� �Range ��E�� to ��E���

��������

IDEAL Y�PIXEL SIZE �MICRONS� �Range ��E�� to ��E���

��������

GRID ROTATION ANGLE �DEGREES�

�Range ���� to ���� �����������

X�NUMBER OF IDEAL HOLE �Range � to �� ����

Y�NUMBER OF IDEAL HOLE �Range � to �� ����

���� FIT GRID PEAKS

Once peak positions have been found and values of the spatial distortions in the X and Ydirections have been calculated the distortion may be �tted by an interpolating function whichwill allow the value of spatial distortion to be estimated throughout the ADR region� At presenttwo �D bicubic spline functions are �tted to the measured distortions� The spline functionsare de�ned on an irregular grid of knot points� It should be noted that whilst the holes arede�ned in a regular grid their measured positions will no longer be on a grid� �By de�ning theinterpolating function on a grid it will be much more e�cient to correct data��

FIT ACCURACY� The user is prompted for the accuracy with which the spline functions should �tthe measured positions� This is the required RMS discrepancy between the measured positions

Page 190: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

and the value of the interpolating spline� This would ideally be equal to the RMS error in peakpositions� Typically a starting value of ��� pixels is useful� �If the value is too small the splinewill �t the noise��

The routine will �nd the minimum number of spline knots necessary to achieve the required�t i�e� the larger the value of the FIT ACCURACY the smoother the function� The numberof knot points used to produce the spline is output� It is recommended to keep this numberto a maximum of about half the number of grid peaks in each direction� By keeping thenumber of knot points relatively low the function is kept smooth and more importantly isbetter constrained by the data� �If the number of knot points is equal to the number of datapoints the cubic functions may well oscillate wildly inbetween the measured positions����

����� FLAT�FIELD CORRECTION

�Note� You should subtract o� any dark current� or other nonsignal related background prior to this operation Spatial distortion correction may also be neededprior to this operation� since a �at uniform pixel size image is assumed�

Ideally an isotropic source would be used to produce a ��at�eld� image which could then beused to correct any nonuniformity in detector response simply by dividing by a normalisedversion� In practice such isotropic sources are unavailable �� �� � �� At present this optioncorrects an input ��ood�eld� image to a ��at�eld� by inputing a �D scan of the source pro�lefrom a scintillation counter on a two theta arm or similar experimental setup ����

First the user must have an appropriate ASCII �le containing the �� scan information� The �leis readin in a free format so the data can be in any vertical column� The scan may have beenobtained using the spec ascan dscan or other methods at other facilities� Prior to input thescan it may need to be edited to remove undesirable data points� As the data points are to be�tted by a polynomial it is important to remove �erroneous� data points such as those frombehind any beamstop���

The program prompts for the �le name�

Enter name of file containing ��D �theta scan of source

FILE NAME �fe��scan�

A sample of the start of the �le is output to help the user chose the correct columns for inputof the angular and intensity data�

Sample of start of the input file

��� �����

��At Version ��� a bug was �xed �I hope� within NAG routines which could cause FIT�D to crash dependingon the value of an non�initialised variable�

��Here the true value of the function is unknown� but since the data images will also miss this data� theprecise values are unimportant� By removing these points the polynomial will simply interpolate in this region�If the data points are not removed a much higher order polynomial would be necessary to �t adequately thesharp feature of the beam�stop shadow� This may introduce unwanted oscillations elsewhere in the �t�

Page 191: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

��� �

��� ���

��� ���

�� ����

�� ����

A variety of questions allow the user to specify the starting line and character position forthe data and which columns of data to use for Xcoordinates �angle� and the Ycoordinates�intensity�� By entering for the number of coordinates to be input the program automaticallyinputs as many coordinates as possible� Alternatively the number of coordinates to input maybe speci�ed�

TYPE OF DATA FORMAT �VERTICAL COLUMNS�

NUMBER OF LINES TO IGNORE �Range to �� ��

NUMBER OF CHARACTERS TO IGNORE �Range to ��� ��

NUMBER OF COORDINATES �Range to �� ��

Columns of numbers for data�set �

COLUMN NUMBER FOR X�COORDINATES �Range to �� ���

COLUMN NUMBER FOR Y�COORDINATES �Range � to �� ��

INFO �� X�Y coordinates per data�set have been found

The intensity values may be corrected for detector deadtime assuming the deadtime is nonparalysable i�e� an event arriving during a deadtime period does not increase the length of thedeadtime period ����� To correct for deadtime the user must enter the count time �integrationtime� per data value in the �� scan� �This is used to calculate the count rate per second fromthe values input in the scan �le which should be raw total counts�� The user must also enter thedetector dead time for a single event� Note� Some �intelligent� detectors may alreadytake account of deadtime� if this is the case the deadtime correction should be�turnedo�� by entering a value of �� seconds

For details on methods on calibrating the detector deadtime see �����

COUNT TIME PER DATA POINT �SECONDS�

�Range � to ��E��� ����

EVENT DEAD TIME �SECONDS� �Range � to ��� ���E��� �e��

The original data values are corrected for the deadtime and will be replaced by higher values�unless ��� deadtime was entered��

Note� The input deadtime and the input count time per data point places a maximum limiton the possible counts in a data point� If a value in the scan exceeds this value an error messagewill be output and that value will not be corrected� However this almost certainly means thatall the other values are incorrect� Presumably either the estimate of the deadtime is incorrector the counting time has been entered incorrectly�

The scan data is �tted with a number of di�erent polynomials of di�erent orders and displaysthe order and residual value for each polynomial �t order�

Page 192: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Order � residual � �����E�

Order � � residual � �����E�

Order � � residual � ������E�

Order � � residual � ������E��

The user must choose the order required� The order with the lowest residual �adjusted fornumber of parameters� is given as a default� However this is often too high a value� To helpdecide the �t or the chosen order is displayed graphically each time a di�erent order is entered�e�g� Figure �� Page �����

ORDER OF POLYNOMIAL �Range to �� ��� �

ACCEPT FIT ��NO� TO TRY ANOTHER ORDER� �NO�

ORDER OF POLYNOMIAL �Range to �� ��� �

ACCEPT FIT ��NO� TO TRY ANOTHER ORDER� �NO�

ORDER OF POLYNOMIAL �Range to �� ���

ACCEPT FIT ��NO� TO TRY ANOTHER ORDER� �NO� yes

The user should try to �nd a good �t to the data but without unwanted oscillations and becareful not to �t to the noise� When satis�ed enter YES to the ACCEPT FIT prompt�

The centre of the ��at�eld� image is speci�ed together with the sample to detector distance andthe pixel sizes in the X and the Ydirections��� The corresponding angle to the sample positionto be calculated for each pixel in the image� If the ��ood�eld� image has been corrected forspatial distortion the pixel sizes are the corrected pixel sizes�

FLAT�FIELD CENTRE X�COORDINATE ������ ���

FLAT�FIELD CENTRE Y�COORDINATE ������� ���

SAMPLE DETECTOR DISTANCE �METRES�

�Range ��E�� to ��E��� ���� ��

PIXEL X�SIZE �MICRONS� �Range ��E�� to ���

��� ����

PIXEL Y�SIZE �MICRONS� �Range ��E�� to ���

��� �����

If signi�cant onaxis absorption occurs there will be an addition correction necessary to accountfor the increased path length for o�axis positions� Thus the user is prompted for the onaxisabsorption fraction�

ON�AXIS ABSORPTION �FOR OFF�AXIS CORRECTION�

�Range � to ��� ��� �

��This is the sample to mask distance for data which has already been corrected for spatial distortion�

Page 193: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Figure ��� FLAT�FIELD CORRECTION Graphics Output

Enter fractional absorption� to be used to calculate off�axis absorption

correction� If no off�axis correction is required enter �� If

off�axis correction is required enter the on�axis axis absorption as a

fraction e�g� If the transmission is �# enter � for the absorption�

ON�AXIS ABSORPTION �FOR OFF�AXIS CORRECTION�

�Range � to ��� ���

The input ��ood�eld� data is corrected pixel by pixel for the source pro�le as a function ofangle �

r�intensity dropo� and increased absorption as a function of increased path length

with angle� The �r�intensity dropo� correction needs to be applied because the �� scan is at

a constant distance from the source but the detector is �assumed to be� �at�

The output overwrites the original image�

It may be normalised �CDIVIDE� usually with a low value thresholded �THRESHOLD� and perhapssmoothed �BLUR� prior to being used for �at�eld correction�

As initially produced the resulting ��at�eld� correction image should be used for pixel by pixeldivision �DIVIDE� to correct input data��� However it may be preferred to store the reciprocal

��The input data should be divided by the ��at��eld� image�

Page 194: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

of the ��at�eld� image using the RAISE TO A POWER command with �� as the power and touse pixel by pixel multiplication �MULTIPLE��

The following is an example of the use of the FLAT�FIELD CORRECTION command�

Calibration sub�menu ENTER COMMAND �FIND PEAKS� flat

Enter name of file containing ��D �theta scan of source

FILE NAME �fe��scan� Fe��scan

Sample of start of the input file

��� �����

��� �

��� ���

��� ���

�� ����

�� ����

TYPE OF DATA FORMAT �VERTICAL COLUMNS�

NUMBER OF LINES TO IGNORE �Range to �� ��

NUMBER OF CHARACTERS TO IGNORE �Range to ��� ��

NUMBER OF COORDINATES �Range to �� ��

Columns of numbers for data�set �

COLUMN NUMBER FOR X�COORDINATES �Range to �� ���

COLUMN NUMBER FOR Y�COORDINATES �Range � to �� ��

INFO �� X�Y coordinates per data�set have been found

COUNT TIME PER DATA POINT �SECONDS�

�Range � to ��E��� ���� �

EVENT DEAD TIME �SECONDS� �Range � to ��� ���E��� ��e��

Order � residual � �����E�

Order � � residual � �����E�

Order � residual � �������E�

Order � � residual � ����E�

Order � � residual � �����E�

Order � � residual � ������E�

Order � � residual � �������E�

Order � � residual � ������E�

Order � � residual � ������E��

ORDER OF POLYNOMIAL �Range to �� ��� �

ACCEPT FIT ��NO� TO TRY ANOTHER ORDER� �NO�

ORDER OF POLYNOMIAL �Range to �� ��� �

ACCEPT FIT ��NO� TO TRY ANOTHER ORDER� �NO�

ORDER OF POLYNOMIAL �Range to �� ���

ACCEPT FIT ��NO� TO TRY ANOTHER ORDER� �NO� yes

FLAT�FIELD CENTRE X�COORDINATE ������ ���

FLAT�FIELD CENTRE Y�COORDINATE ������� ���

SAMPLE DETECTOR DISTANCE �METRES�

�Range ��E�� to ��E��� ���� ��

Page 195: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

RAW PIXEL X�SIZE �MICRONS� �Range ��E�� to ���

��� ����

RAW PIXEL Y�SIZE �MICRONS� �Range ��E�� to ���

��� �����

ON�AXIS ABSORPTION �FOR OFF�AXIS CORRECTION�

�Range � to ��� ��� �

Enter fractional absorption� to be used to calculate off�axis absorption

correction� If no off�axis correction is required enter �� If

off�axis correction is required enter the on�axis axis absorption as a

fraction e�g� If the transmission is �# enter � for the absorption�

ON�AXIS ABSORPTION �FOR OFF�AXIS CORRECTION�

�Range � to ��� ���

����� HELP

Online paged help text on available CALIBRATION submenu commands controlled by the�pager� �see Section ���� Page �����

����� INPUT SPATIAL FUNCTION

Input previously stored �tted spatial distortion function� A �tted spatial distortion functionmay be recovered for correction of data�

����� INVERSE DISTORTED�IDEAL

INVERSE DISTORTED�IDEAL command inverses the de�nition of the spatial distortion function�By default the spatial distortion is de�ned from the distorted grid to an ideal grid with positionreferring to the distorted grid position� This command toggles the de�nition so that after onecommand the de�nition is from an ideal grid to a distorted grid with position referring toideal grid position� Using the command twice �or any even number of times� returns to thedefault de�nition of the distortion function� When a �tted spline is output an extra line isoutput for splines which are de�ned from an ideal grid�

This option is necessary to be able to de�ne a distortion mapping for a program such asMADNES � which predicts positions on an ideal grid and then apply a distortion value togive the corresponding position on the distorted grid �see Section ���� Page �����

����� LEARN HOLE PROFILE

After FIND PEAKS has been used to �nd the centres of grid peaks LEARN HOLE PROFILE maybe used to calculate an average hole pro�le from the found peaks at subpixel resolution� Theuser prompts for the level of the subpixel resolution required� The output is in the memory�

�MADNES actually needs both distortion mappings�

Page 196: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

����� LINEARISE INTENSITIES

LINEARISE INTENSITIES allows the ADR intensities to be corrected for intensity nonlinearityprovided that an ASCII �le is available which contains measurements of raw intensities togetherwith the estimated true linear intensities� �It is beyond the scope of this manual to describe theproblems and pitfalls of trying to obtain adequate intensity linearity calibration measurements������� At present the data is readin using a �free format� routine which allows di�erentcolumns to be selected for the raw and the linearised intensities� Thus the data must be in acolumn format but the order or number of columns is not important�

The intensity information is converted to a Log���� raw intensity scale and the ratio betweenthe linearised intensity and the raw intensity is calculated� This modi�ed data is �tted by avariety of orders of Chebyshev polynomials� The residual �t statistic for each order is outputand the user is invited to choose a polynomial �t order� The modi�ed data points are displayedtogether with the �tted polynomial� The user can choose to accept the polynomial order andcorrect the data or try a di�erent order of polynomial� Thus an order which adequately �tsthe data but does not exhibit unwanted oscillations between data points can be selected�

The selected polynomial is used to interpolate between the measured data points when correcting the data� All data values within the range of the de�ned polynomial �between theminimum and maximum raw intensities in the raw�linearised intensity �le� are replaced bythe interpolated linearised values� Values outside the range are treated as if the nonlinearityfunction continues outside the range but is then linear but o�set from the end points� Rawimage intensities are replaced inplace by the linearised intensities�

As an example of a nonlinearity correction Figure � �Page ���� shows a polynomial �t todata which was produced from a series of linearity calibration tests on an image plate scanner�The program dialogue which produced this graphic and the correction follows�

Main menu ENTER COMMAND �INPUT DATA� calibration

Calibration sub�menu enter command �FIND PEAKS� linearise

INFO To linearise the data it is necessary to give the name of a file

which contains values of the raw intensity values together with

corresponding values on the required �linearised� scale� The raw

intensity values correspond the X�coordinates and the corresponding

linearised intensities the Y�coordinates�

Enter name of file containing non�linear and linear intensities values

FILE NAME �source�scan� linear�dat

Sample of start of the input file

������� �����

���� ������

������� �����

������ ������

����� �����

������� �������

TYPE OF DATA FORMAT �VERTICAL COLUMNS�

NUMBER OF LINES TO IGNORE �Range to �� ��

NUMBER OF CHARACTERS TO IGNORE �Range to ��� ��

��In future versions of the manual references will be given to further papers�

Page 197: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Figure � � LINEARISE INTENSITIES Graphics Output

Page 198: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

NUMBER OF COORDINATES �Range to �� ��

Columns of numbers for data�set �

COLUMN NUMBER FOR X�COORDINATES �Range to �� ���

COLUMN NUMBER FOR Y�COORDINATES �Range � to �� ��

INFO �� X�Y coordinates per data�set have been found

Order � residual � �����E�

Order � � residual � �����E�

Order � residual � �����E�

Order � � residual � ����E�

�Here some program output has been omitted��

Order � � residual � �������E��

Order � � residual � �������E��

Order � � residual � �������E��

ORDER OF POLYNOMIAL �Range to �� ���� �

ACCEPT FIT ��NO� TO TRY ANOTHER ORDER� �NO�

ORDER OF POLYNOMIAL �Range to �� ��� ��

ACCEPT FIT ��NO� TO TRY ANOTHER ORDER� �NO� y

Calibration sub�menu ENTER COMMAND �EXIT�

����� LOAD LOOK�UP TABLE

Input a distortion correction lookup table from a disk �le� The �le must previously have beencreated using the STORE LOOK�UP TABLE command�

����� LOOK�UP TABLE �SPATIAL DISTORTION�

Create a distortion correction lookup table internally from an interpolated spline� Once createdthis is a much faster way of correcting for spatial distortion but the internal lookup table isvery large so a large amount of computer RAM must be available to FIT�D�

����� OUTPUT SPATIAL FUNCTION

Output �tted spatial distortion function to an ASCII �le� A �tted spatial distortion functionmay be input later for correction of data�

����� PLATYPUS CORRECTION FILE

This option allows a calibration �le to be created in the correct format for the programPLATYPUS ������� PLATYPUS needs a �D grid of true positions in millimetres corresponding to reg

��A powder diraction data analysis program written by R Piltz which inputs ��D data and allows spatialdistortion and detector tilt to be taken into account when producing a �D circularly averaged powder scan�

Page 199: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

ularly spaced pixel positions from a Molecular Dynamics imaging plate scan� The calibration�le corresponds to a full A� image plate even if only an A� scan was performed�

Because FIT�D works with the data looking from the opposite side of the detector �from thesample� as does PLATYPUS and because FIT�D works with the data going from bottom totop which is the opposite way round to PLATYPUS�� it is necessary to FLIP the full data inboth directions prior to the FIND PEAKS FIT GRID PEAKS and PLATYPUS CORRECTION FILE

commands�

Having �tted a calibration grid image to de�ne the spatial distortion or after using INPUT

SPATIAL FUNCTION to recover a previously calculated spatial distortion function you may usethe PLATYPUS CORRECTION FILE command to produce a calibration �le� You will be promptedwith a warning explaining the present need to have reversed the image using the FLIP commandtwice� You must reply �YES� that you understand the requirements to continue producingthe �le�

FIT�D needs to know where the scan was started using the Molecular Dynamics coordinatesystem� This system which is used on the controlling PC starts at A� and each letter ornumber increment represents �cm squares� The letters refer to the laser scanning direction andthe numbers to the mechanical scan direction� e�g� At the ESRF presently an A� scan startsat coordinate E � This may not be the same for other scanners� e�g� The High Pressure groupat Daresbury uses A� plates in a di�erent orientation�

The next input is the name if the output �le for the calibration correction�

Below is an example of a log showing the creation of a �le called calib�pos for an ESRF A�image plate scan�

Calibration sub�menu ENTER COMMAND �SPATIAL CORRECTION� platy

IMPORTANT NOTE The image MUST have been flipped in both

directions using the �FLIP� command�

LIMITATIONS O�K� �NO� y

MD STARTING COORDINATE �E�� E�

PLATYPUS CALIBRATION FILE NAME �calib�pos�

Calibration sub�menu ENTER COMMAND �EXIT�

����� QUIT

Same as EXIT

����� RE�CALCULATE DISTORTION

FIND PEAKS calculates initial values of the distortion� The distortion values may be recalculatedusing RE�CALCULATE DISTORTION without needing to perform the peak search again� �See FIND

��Although visually the data is only left to right reversed�

Page 200: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

PEAKS for explanation of user prompts��

����� RESIDUALS OF FIT

Calculates in the �memory� the residuals between the �tted spline function and the measuredpeak positions for each peak position for either the X or the Ydistortion values� Missing peaksare given a zero residual�

����� SAVE PEAKS

The user may save the measured peak positions and calculated distortion values to an ASCII�le� This can then be used for display by graph plotting programs e�g� CHIPLOT or as entryto a spreadsheet program for further calculation of average pixel sizes grid rotation etc�

����� SIZE �IMAGE DISPLAY�

By default the FIND PEAKS option displays a ������� central region of pixels for the userto select peaks for the start of the peak search� �This number is compromise between havingsu�cient detail to be able easily to click on the peaks and having enough peaks displayed��If owing to a large beamstop or another reason the default is not suitable it may be changedwith the SIZE �IMAGE DISPLAY� command�

The user is prompted for the number of pixels �maximum� in each dimension to be displayedgraphically for entry of the initial grid peaks�

����� SPATIAL CORRECTION

Once a spatial distortion interpolation function has been calculated or a previously calculatedfunction has been input data may be corrected for spatial distortion� The correction is appliedthroughout the ADR so REGION or IMAGE should be used to select the required ADR prior toentering the calibration submenu�

The user is prompted for an OVER�LOADED PIXEL VALUE� This value allows overloaded pixelsintensity not to be distributed below the overload value� Any pixel intensities above the inputlimit will be added to all the overlapped output pixels rather than the intensity being distributed proportional amongst the covered pixels� This means that the output pixels will haveat least the overload value so may be easily found and ignored in later processing� A very largevalue may be entered to turno� this facility�

OVER�LOADED PIXEL VALUE �Range � to ���E���� ��������

Next the user must enter the number of rows of the distortion function which will be calculatedin a block� The value will not a�ect the results but too large a value will require a lot of memory

Page 201: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

which may cause problems� To small a number will cause the correction to take longer� Thedefault value should be about right but every di�erent machine will have a di�erent optimumvalue depending on the usage and availability of memory�

NUMBER OF ROWS OF DISTORTION FUNCTIONS TO CALCULATED IN A BLOCK

�Range to ��� ���

The input pixels are rebinned to output pixels in the memory data image taking into accountthe spatial distortion as de�ned from the interpolating function at the edges of each pixel�The spatially corrected input pixels are assumed to be rectangular on the output grid� Theintensity in each input pixel is distributed between one or more output pixels in proportion tothe covered area �����

Owing to the spatial distortion in general the size of each input pixel is di�erent� Thus auniform input image will not be uniform on output� �By recording the fraction of input pixelsadded to each output pixel this nonuniformity could be corrected in the software but this isnot presently the case� It is felt that it is better to correct spatially a �at�eld image and usethe spatially corrected �at�eld image to correct for nonuniformity��

The corrected image is in the memory at the end of the operation�

Users are kindly asked to cite A P Hammersley S O Svensson and A Thompson �Calibration and correction of spatial distortions in �D detector systems� Nucl� Instr� Meth� A��������� ���� and generally to acknowledge the use of FIT�D for data corrected bythis method

Here is an example of the program output produced by the SPATIAL CORRECTION command�

Calibration sub�menu ENTER COMMAND �SPATIAL CORRECTION�

INFO The corrected pixel dimension in X is ������� microns

INFO The corrected pixel dimension in Y is ������� microns

OVER�LOADED PIXEL VALUE �Range � to ���E���� �������� �

In order to avoid over�loaded pixels being re�binned and their intensity

spread out to an undetermined value� you can enter a �over�loaded� pixel

value� All input pixels which have this value or more� will cause one or

more output pixels to be incremented by the value regardless of the normal

proportional are re�binning algorithm� Thus over�loaded pixels in the

output image can be easily identified and ignored�

�This can be turned�off by entering a very large value��

OVER�LOADED PIXEL VALUE �Range � to ���E���� ��������

NUMBER OF ROWS OF DISTORTION FUNCTIONS TO CALCULATED IN A BLOCK

�Range to ��� ���

INFO Starting to correct data for spatial distortion

WARNING One input pixel is trying to be binned into more than three

output pixels in the X�direction �Pixel �� ��

INFO Number of rows re�binned � � � �#�

INFO Time for re�binning � ��� seconds

Page 202: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

WARNING � input pixels have been ignored� because they require

re�binning into more than three output pixels �X�direction��

����� STORE LOOK�UP TABLE

Save a distortion correction lookup table in a named disk �le� The internal lookup table mustpreviously have been created using the LOOK�UP TABLE �SPATIAL DISTORTION� command�

The LOAD LOOK�UP TABLE command can be used to recover a previously stored lookup table�

����� TRANSFER DISTORTION

The distortion values for either the X or Ydirections may be transferred to the memory throughthe TRANSFER DISTORTION command� The user is prompted for X�DISTORTION� Enter �YES�to save the Xdistortion values in the memory or �NO� in order to save the Ydistortion values��Missing peaks are given a zero value for distortion�� By exiting the CALIBRATION submenuand using the EXCHANGE command the distortion values may be processed �e�g� STATISTICS�stored in an output �le etc�

����� VIEW PEAKS

This command allows the measured positions and calculated distortion values of individualpeaks and rows and columns of peaks to be output to the screen�

�Hint� Use the OPEN LOG command in the main menu to save all screen text to an ASCIIoutput �le� The output values from rows and columns of peaks may subsequently be displayedusing CHIPLOT or a spreadsheet program��

����� XRII FLAT�FIELD

WARNING� This option is under development and should be presently assumednot to work The aim is calculate the theoretical �at�eld response of the ESRF Xray Image Intensi�er for an arbitrary source position according to a simple modelThis model will only be an approximation for the true detector so the theoreticalcorrection will only ever be approximately correct

���� Spatial Distortion Correction in MADNES

The programMADNES written by A Messerschmidt and J W P�ugrath ���� performs onlineprotein crystallography data collection and integration with autoindexing and autoorientation�It includes the possibility to account for detector spatial distortion� Often a spatial distortioncalibration and correction system produced by David Thomas ���� or by Marty Stanton ���� is

Page 203: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

used to correct for the spatial distortion� It is now possible to use FIT�D to produce calibration�les for MADNES� This may have certain advantages�

� Can cope with any detector system �that can be input�

� Can cope with missing grid peaks owing to the beam stop or to other e�ects

The version of MADNES must have had the following subroutines changed for ones whichuse the FIT�D method of correction�

lodspd Load spatial distortion interpolation

pxtomm Convert distorted pixel grid to ideal millimetre grid

mmtopx Convert ideal millimetre grid to distorted pixel grid

These subroutines can be made available by the author although some care must be taken toensure that the code corresponds to the detector readout system and di�ractometer geometrybeing used �some modi�cation of the code to account for the di�erent coordinate system islikely��

MADNES needs both a function to convert from the distorted detector pixel grid to an idealdetector coordinate and a function to convert from an ideal detector coordinate system to thedistorted detector pixel grid� FIT�D allows these two functions to be created as interpolationspline functions� Normally �by default� FIT�D creates a spline function to convert from thedistorted �measured� pixel grid to an ideal grid as a function of �D distorted pixel position�To be able to create an interpolation spline to convert from an ideal detector to a distortedgrid detector the command INVERSE DISTORTED�IDEAL exists� This command toggles betweenthe two de�nitions of the distortion� By using the INVERSE DISTORTED�IDEAL command oncefollowed by the FIT GRID PEAKS command a spline function is produced for the ideal to distorted grid function� When the OUTPUT SPATIAL FUNCTION command is used the �le createdhas an extra �rst line if it is from an ideal to distorted grid� Thus FIT�D and MADNEScan recognise the correct �les�

MADNES creates automatically the �le names to be input containing the two spatial distortion functions based on a base name plus �xed �le extension� The required extension for the�le containing the function from the distorted grid to the ideal grid is �di and from the idealgrid to the distorted grid is �id� In addition to the two spatial distortion �les MADNESneeds to know the beam centre in pixel coordinates on the detector� This number is inputaccording to the MADNES detector coordinate system���

���� Image Format Conventions

The following isMADNES documentation describing the di�erent image storage formats thatit can handle�

��At present this is experimental and experience may show that other parameters need to be input� or thatparameters may be obtained from other sources�

Page 204: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

The image DATA can be stored in many orders� MADNES needs to know the

order that your images are stored� When one looks at the image from a

camera�man�s viewpoint� that is from behind the detector towards the

crystal� there are � possible orders� depending on the origin and the

slow and fast directions of pixel order

�������������� O�slow�������� ��������tsaf�O ��������������

$ $ $ $ $ $ $ $

% $ f $ $ s $ %

$ $ a $ $ l $ $

w $ s $ $ o $ t

o � $ t $ $ � w $ � s

l $ $ $ $ $ $ a

s $ V $ $ V $ f

$ $ $ $ $ $ $ $

O�fast�������� �������������� �������������� ��������wols�O

�������������� O�fast�������� ��������wols�O ��������������

$ $ $ $ $ $ $ $

% $ s $ $ f $ %

$ $ l $ $ a $ $

t $ o $ $ s $ w

s � $ w � $ $ � t $ � o

a $ $ $ $ $ $ l

f $ V $ $ V $ s

$ $ $ $ $ $ $ $

O�slow�������� �������������� �������������� ��������tsaf�O

Simply for historical reasons� in these routines�

in specifying the detector pixel coordinates

The FAST direction is called Yms �i�e� is first dimension of a

Fortran array�

The SLOW direction is called Zms �i�e� is second dimension of a

Fortran array�

Page 205: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Now for the mm coordinate system� For the same viewpoint as above�

the X mm points down along the omega axis �vertical for most goniostats�

often horizontal for synchrotrons�� Z goes into the beam and Y makes a

right�handed system� The origin of the mm coordinate system is the

position of the primary beam on the detector� when the tilt �aka swing�

aka theta� angle is zero�

���������������

$ $

$ $

$ $

$ $

$ Y��� o $ Z into beam�

$ $ $

$ V $

$ X $

���������������

���� Example of Producing Calibration Files

The following is part of the log produced by FIT�D showing the sequence of commands usedto produce the two calibration �les suitable for use byMADNES� Here is it assumed that thebase �le name for the calibration �les will be gridi�

Main menu ENTER COMMAND �INPUT DATA�

FILE FORMAT �FITD STANDARD FORMAT� princeton

DATA FILE NAME �grid��spe� gridi�spe

INFO Size of image � �� ! ���

Main menu ENTER COMMAND �IMAGE� calibration

Calibration sub�menu ENTER COMMAND �FIND PEAKS� size

NUMBER OF PIXELS �Range � to �� �� �

Calibration sub�menu ENTER COMMAND �FIND PEAKS�

MAXIMUM PEAK SEARCH DISTANCE �PIXELS� �Range � to �� ���

PEAK DETECTION RATIO �Range � to ���� ����

PEAK STANDARD DEVIATION WIDTH �Range � to ��E���

�����

NUMBER OF SUB�PIXELS �Range � to �� ��� �

INFO Starting peaks found O�K�

INFO Starting peak is at position ������� ���������

INFO Next first grid axis peak is at position ������ �������

INFO Next second grid axis peak is at position ���� ��������

PROGRESS REPORT FREQUENCY �PEAKS� �Range � to �� ��� �

INFO Starting peak search� this takes some time for big grids

Page 206: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

INFO Found � peaks

INFO Number of peaks found � ��

INFO Number of grid peaks �X�Y� � �� �� � �����

INFO Time taken � ��E�� seconds

GRID SPACING �CENTRE TO CENTRE IN microns�

�Range �� to ��E��� ��� �

INFO Average pixel size in X�direction � ������� �� ���� microns

INFO Average pixel size in Y�direction � ������� �� ����� microns

INFO Overall average pixel size � ������� �� ���� microns

INFO RMS pixel size in X�direction � �������

INFO RMS pixel size in Y�direction � �������

INFO Average rotation based on rows � ������� �� ���� degrees

INFO Average rotation based on columns � ������� �� ���� degrees

INFO Average rotation �both rows and columns� �

INFO ������ �� ����� degrees

IDEAL X�PIXEL SIZE �MICRONS� �Range ��E�� to ��E���

��������

IDEAL Y�PIXEL SIZE �MICRONS� �Range ��E�� to ��E���

��������

GRID ROTATION ANGLE �DEGREES�

�Range ���� to ���� ����������

X�NUMBER OF IDEAL HOLE �Range � to ��� ����

Y�NUMBER OF IDEAL HOLE �Range � to ��� ����

Calibration sub�menu ENTER COMMAND �DISPLAY DISTORTION� fit

AVERAGE FIT DISCREPANCY �PIXELS�

�Range ��E�� to ��� ���� �

INFO Fitting X�Distortion

INFO X�Distortion Spline

INFO Number of horizontal� vertical true knot points � � �

INFO Average position discrepancy � �������E��

INFO Fitting Y�Distortion

INFO Y�Distortion Spline

INFO Number of horizontal� vertical true knot points � � �

INFO Average position discrepancy � �������E��

INFO Worst case fit discrepancies in pixels �spline value � measured�

INFO Lowest X�distortion � �����E� at grid position �X�Y� � �

INFO Highest X�distortion � �����E� at grid position �X�Y� �

INFO Lowest Y�distortion � �������E�� at grid position �X�Y� �� ��

INFO Highest Y�distortion � �����E�� at grid position �X�Y� �� ��

Calibration sub�menu ENTER COMMAND

�OUTPUT SPATIAL FUNCTION�

Name of file for spatial distortion interpolation function

FILE NAME �spatial�dat� gridi�di

The spatial distortion function from the distorted grid to an ideal grid has now been de�nedand saved so it remains to change the de�nition of the peak positions and distortion valueswith the INVERSE DISTORTED�IDEAL command and to �t a new spline function�

Page 207: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Calibration sub�menu ENTER COMMAND �EXIT� inverse

INFO Distortion now defined from ideal grid to distorted grid

Calibration sub�menu ENTER COMMAND �FIT GRID PEAKS�

AVERAGE FIT DISCREPANCY �PIXELS�

�Range ��E�� to ��� ���

INFO Fitting X�Distortion

INFO X�Distortion Spline

INFO Number of horizontal� vertical true knot points � � �

INFO Average position discrepancy � ���E��

INFO Fitting Y�Distortion

INFO Y�Distortion Spline

INFO Number of horizontal� vertical true knot points � � �

INFO Average position discrepancy � ���E��

INFO Worst case fit discrepancies in pixels �spline value � measured�

INFO Lowest X�distortion � ������E� at grid position �X�Y� ��

INFO Highest X�distortion � ����E�� at grid position �X�Y� �� �

INFO Lowest Y�distortion � ������E� at grid position �X�Y� �� ��

INFO Highest Y�distortion � ������E� at grid position �X�Y� �� ��

Calibration sub�menu ENTER COMMAND

�OUTPUT SPATIAL FUNCTION�

Name of file for spatial distortion interpolation function

FILE NAME �gridi�di� gridi�id

Calibration sub�menu ENTER COMMAND �EXIT�

Page 208: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Fit SubMenu

The FIT submenu contains commands for model �tting to �D data and also a number of othercommands not particularly related to �tting� The common feature of the other commands isthe possibility to �masko�� areas of the data� Thus commands related to powder di�ractionare included in the FIT submenu�

Model �tting can range from a relatively simple to a very complicated process owing to theproblems of local minima poor initialisation saddle points on the �t surface etc� This submenu contains commands which allow initialisation of a �t model minimisation inspection ofresults and the setting of constraints of model parameters� Novice users should seek advicefrom users more experienced with �tting if attempting more than the simplest operations � ��

The basic commands for �tting are�

INPUT PARAMETERS� Initialisation of a �t model by graphical and keyboard input�

MINIMISATION� Optimisation of �t model by the maximum descent method

RESULTS� View �tted parameters

The memory is used to calculate the �t model so at the end of MINIMISATION it is possible toexit the FIT submenu and use EXCHANGE so that �t model can be examined� �EXCHANGE is thedefault command after exiting�� Similarly SUBTRACT can be used to create the residuals�

Additionally there are many other commands which support the �tting process and allow otherforms of �tting� The commands are�

CHANGE SCALE� Change the typical parameter variation sizes

CLEAR MASK� Eliminate all maskedo� �bad� data points

CONSTRAIN� Set constraints change parameters values

COVARIANCE� Output covariance matrix

DEFINE MASK� Masko� �bad� data prior to �tting

DISPLAY MASK� Display maskedo� data as a two level image

EXIT� Exit �t submenu

INPUT PARAMETERS� Initialisation of �t model

MASK STATISTICS� Statistics of mask

MINIMISE� Search for better �t by maximum descent method

MODEL� Create �t model �in memory� from current parameter values

NORMALISATION� Unidirectional �at�eld normalisation

Page 209: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

OUTPUT PARAMETERS� Output �t parameters to a �le

POWDER DIFFRACTION� Convert �D data into a �D �scan���

QUIT� Exit �t submenu

R�THETA RE�BINNING� Radial�Angular �polar� rebinning of ADR

RADIAL PROFILE� Calculate �D radial pro�le in memory

RESULTS� View results of �tting

SET MASK COLOUR User choice of colour to draw masked pixels

SET UP� Alter �t control parameters

SURFACE POLYNOMIAL� Fit data using �D Chebyshev polynomial

THRESHOLD MASKING Mask elements depending on ADR data values

TILT�BEAM CENTRE Determine tilt and beam centre from powder rings

TRANSFER MASK TO MEMORY Set masked elements to ��� in memory

All the available commands are described in detail in the following subsections but �rst somevery important general concepts are introduced�

���� Powder Di�raction Ring Integration

Included in the FIT submenu are a number of commands concerned with integrating �D imagesof powder di�raction rings to �D �scans�� These commands have been placed within the FITsubmenu since they all allow arbitrary regions of the data to be �maskedo�� and thereforenot be included in the integration� Thus all the commands relating to de�ning or unde�ningthe �mask� are relevant to powder di�raction as are the commands TILT�BEAM CENTRE andPOWDER DIFFRACTION�

TILT�BEAM CENTRE allows any nonorthogonality of the detector with respect to the beam tobe �tted from the shape of one or more powder rings� Similarly the beam centre on the detectorcan be re�ned�

From the tilt and beam centre found by TILT�BEAM CENTRE or input by the user the ADRmay be rebinned to a �D equal angle or equal radial distance bin scan using the POWDER

DIFFRACTION command� This allows the option or simultaneously correcting spatial distortion�

Users of these commands are kindly asked to acknowledge and cite�

A P Hammersley S O Svensson M Han�and A N Fitch and D H&ausermann�TwoDimensional Detector Software� From Real Detector to Idealised Image orTwoTheta Scan� High Pressure Research �� pp�� ��� ������

��This option is under development�

Page 210: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�Note� Other options to allow more �exible integration as a function of azimuth are underdevelopment� At present R�THETA RE�BINNING performs a polar transformation to the ADRwith user control of the number and size of radial and azimuthal pixels��

���� Correction for Polarisation E�ects

The commands POWDER DIFFRACTION and R�THETA RE�BINNING rebin �D powder rings toone or more �D spectra� In order that the relative intensities are correct it is important toconsider both the e�ect of polarisation and the Lorentz correction factor�

In general the e�ect of polarisation is dependent on both the �� angle and the azimuthal angleof di�racted radiation� Thus it is important to correct for polarisation when the data is beingconverted from a �D image to one or more �D spectra� If the polarisation correction is tobe applied the user will be prompted for the polarisation degree of the Xray beam and thegeometry of the experiment� The beam polarisation is de�ned as�

P #�Ih � Iv�

�Ih � Iv�� �

where� Ih is the horizontal component of the intensity and Iv is the vertical component�

At a synchrotron the Xrays are usually highly horizontally polarised so P � �� but thebeamline scientists should be able to supply an appropriate number for their beamlines�

The correction applied is based on the formula of Kahn �����

Having corrected for polarisation it is important that subsequent software does not also applya polarisation correction �

���� Advice on Model Fitting

Finding a optimum �t between a parameterised model and measured data can be a di�culttask owing to the problem of local minima or simply owing to the size of the computationalproblem being undertaken� To avoid local minima and to reach quickly the global minimumgood initialisation is vital� Great care should be taken with the the initialisation process�Many of the commands in the main menu may be useful to obtain good estimates of modelparameters� The CONSTRAIN command may be used to set parameter values individually�

The fewer variable parameters the faster will be the �tting� Thus if certain parameters canbe given a good initialisation it will be useful to constrain these parameters whilst optimumvalues are found for the remaining parameters�

If the model makes the �t much more sensitive to variation in one parameter than the othersit may completely dominate the minimisation process such that the other parameters are notoptimised� The CHANGE SCALE command allows this problem to be reduced �See Section ����Page �����

Page 211: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

���� The Data Mask

Allowing elements to be arbitrarily included or excluded from �tting and other operations isa very powerful facility which allows much �exibility in the data analysis process� �Bad� datapoints can be excluded from operations� Optimum nonrectangular data regions can be selectedreducing calculations for �tting and other calculation intensive operations�

The �mask� is a �D area of the same size as the current data and memory arrays� Each dataelement may be �masked� or not� By default no elements are masked� The command DEFINE

MASK �See Section ���� Page ���� allows maskedo� regions to be de�ned and the commandINPUT PARAMETERS �See Section ����� Page ���� also calls the DEFINE MASK routine� Thecommand CLEAR MASK �See Section ��� Page ���� resets all elements to �unmasked��

Alternatively the �maskedo�� areas can be de�ned from the data values themselves by usingthe THRESHOLD MASKING command� This allows a threshold value to be de�ned and all dataelements with values above or below �as required� this value are de�ned as �maskedo�� �seeSection ���� Page ����� The mask can be �transferred� to the memory for further use andpossible storage using the TRANSFER MASK TO MEMORY command �see Section ����� Page �����

��� CHANGE SCALE

The minimisation method needs to calculate numerical derivatives� To estimate the descentdirection small variations are tried in each of the variable parameters� If the �t is far moresensitive to a small change in one parameter than the others then it will only really searchfor the best �t for that parameter whilst the others e�ectively remain constrained� To avoidthis problem each parameter has a scale size of variation� Thus sensitive parameters have asmall scale size and so are only varied by a small amount� When the parameters are inputdefault scale sizes are set� These should be suitable for most purposes but sometimes betterminimisation will be obtained by altering the default values� This can be seen at the start ofthe MINIMISATION process� The �rst n�� �t �reduced chisquared� values correspond to the nvariable parameters of the �t model� If one shows much greater variation than the others itsscale size is too large�

The CHANGE SCALE command allows the �t parameter scale sizes to be examined and values tobe changed� This command itself is a submenu with the following commands�

EXIT� Return to FIT submenu

MODIFY� Make a change to one or more parameters� The number of the parameter to alterfollowed by its new value�

VIEW� Display one or more parameter values together with their name and scale size�

���� CLEAR MASK

Resets all mask elements so that the data points are �good��

Page 212: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

���� CONSTRAIN PARAMETERS

The CONSTRAIN command allows the �t parameters to be examined values changed and constraint of parameters� This command itself is a submenu with the following commands�

EXIT� Return to FIT submenu

MODIFY� Make a change to one or more parameters� The number of the �rst parameter to alterand the number of the last parameter to alter are to be speci�ed �� means no parameter�followed by one of the following� CONSTRAIN� SET� UNCONSTRAIN� SET asks for the newvalue of the parameter�

VIEW� Display one or more parameter values together with their name and constrained orunconstrained state�

���� COVARIANCE

�This option has not been reinstalled since the move to Unix� but may be installedquickly if a need arises�

Displays covariance matrix as calculated by MINIMISATION �tting option�

���� DEFINE MASK

�For a general description of the �data mask� concept see Section ���� Page �����

This command is the same as the GUI interface MASK command� See Section �� Page �for further details�

���� DISPLAY MASK

Displays the data as a pixel image but with all the masked elements being displayed in auniform colour� The colour used to displayed the maskedo� pixels may be changed using theSET MASK COLOUR command �see Section ����� Page �����

�As the mask is displayed as an image all the normal attributes for image display will apply��

����� EXIT

Leave �t submenu and return to main menu� �No information is lost so it it possible to returnto the �t menu at a later stage��

Page 213: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

����� INPUT PARAMETERS

INPUT PARAMETERS allows an initial �t model to be de�ned� The �t model can be de�nedGRAPHICALLY or from a FILE which has previously been saved using OUTPUT PARAMETERS�Selecting INPUT PARAMETERS reinitialises the �t model so any previously de�ned �t modelparameters are lost �prior to this operation values may be saved with OUTPUT PARAMETERS��

����� GRAPHICAL INPUT

This is the method to de�ne an initial �t model� First any maskedo� elements are de�ned�See Section ���� Page �����

The �t model can be made up of a general polynomial background plus one or more �Dpeaks� The order of the polynomial in the X and Ydirections is entered by the keyboardfollowed by the a number of points used to de�ne initial values for the polynomial� The initialpolynomial may be de�ned from a lower order which is more stable� The higher coe�cients ofthe polynomial are then initialised to zero� To de�ne the initial coe�cients it is necessary toclick on a given number of data points e�g� �n � �� � �m � �� where n and m are the ordersof the initialisation polynomial� It is recommended to use only lower order polynomials sincehigher order polynomials are not very stable� The user should click on the given number ofdata points spread throughout the data region in an approximate grid� �If the points are allcolinear it will not be possible to set initial coe�cient values��

A choice of three peak types is available� A menu appears presenting the three types� the usershould click on the required peak type or on exit to �nish this stage of the model de�nition�The three peak types are�

GAUSSIAN� �D Gaussian pro�le peak

POLAR GAUSSIAN �D Gaussian pro�le peak de�ned in a polar geometry i�e� Gaussian pro�lein a radial sense and in an angular arc

TWIN POLAR GAUSSIAN � polar Gaussians de�ned symmetrically about a centre of symmetry

For each peak a number of peak parameters need to be de�ned� These are all entered graphicallyby clicking on the centre of the peak �position and maximum intensity� and two half heightpositions� Care should be taken with the initialisation or greater danger of falling into localminima will be present�

Finally the user may specify a �rowline� as part of the model� A �rowline� is a line of polarGaussians which all share the same radial and angular standard deviations� The peaks areplaced at equal angles along a line at an angle from the vector from the symmetry centre to the�rowline� centre� The �rowline� is re�ected in the vector from the symmetry centre to therowline centre but with a change in intensity� All the parameters which de�ne a �rowline�are entered with the keyboard� �It is planned to de�ne a triclinic unit cell di�ractionpattern peak model to replace the �rowline� model which is an approximation�

Page 214: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

����� MASK STATISTICS

Outputs to the screen the statistics of masked and unmasked elements within the currentADR�

����� MINIMISE

Once a �t model has been de�ned it may be optimised �minimised� using MINIMISE� Thiscalculates numerical derivatives of the least squares surface de�ned by the �t model and triesto �nd a minimum using the maximum descent vector� The NAG routine E��FCF is used toperform the minimisation so NAG documentation may be used for further explanation�

The user may enter an estimate of the total �distance� from the initialisation model to the best�t model� �The default values seem to be �ne��

The �tting is weighted by the inverse of the estimated variances of the data points if variancesexist and weighted �tting has not been turned o�� If variances have not been de�ned the �ttingis unweighted�

The program outputs the �t value for each iteration� This is a reduced chisquared value forweighted �tting and an average squared residual for unweighted �tting�

The NAG routine is likely to end will one of several �error� messages unless it thinks themaximum has been obtained� Depending on the �error� message more iterations may benecessary to �nd the minimum point�

The program uses the memory to create the �t model at each stage so any previous memorydata is lost� At the end of MINIMISATION it is possible to return to the main menu use EXCHANGE�the default option� and examine the �tted model�

���� MODEL

Creates �t model based on currently set parameter values in the memory� This may be usefulwhen parameters values have been changed using the CONSTRAIN command�

����� NORMALISATION

NORMALISATION allows nonuniform sensitivity response to be corrected for detector systemswhich su�er from nonuniform response in a manner which is equal �or at least similar� for allrows or all columns�

The method is to masko� all data except for the background data which are �ideally� assumedto be approximately �at� The program adds up all the values in each column or row andproduces a �D normalisation array� This array is then used to correct all the data in eachcolumn or row� The output is in the memory� The user can select the direction of the correction�

Page 215: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

�Clearly this is only an approximate correction� and if available a calibration imageshould be used to apply the �at�eld correction�

����� OUTPUT PARAMETERS

Once de�ned and at any stage of the �tting process �t model parameters may be saved to �le�

����� QUIT

Same as EXIT�

����� POWDER DIFFRACTION

POWDER DIFFRACTION converts �D powder rings from a �at detector to �D pro�les whilsttaking account of spatial distortion and detector tilt ����� The command TILT�CENTRE BEAM

�see Section ����� Page ���� can be used to determine the tilt and optionally the beam centre�If a semitransparent beamstop is used the beam centre can be found be �tting a suitablefunction e�g� �D Gaussian �see Section �� Page ����� Other commands may also be usefule�g� the PIXEL X�Y option within the DISPLAY submenu of the graphics menu of the IMAGEcommand �see Section �� Page � ��

A choice of equal orthogonal detector pixel distance or equal di�raction angle bins is available�

The rebinned �D pro�le can be output into a �Powder Di�raction Standard� �PDS� format�le�� within this command or will be saved in the memory for further manipulation or outputin a alternative form���

Below is the log �le from FIT�D of the present user interaction� The documentation will befully written when the algorithm and user inputs are stable�

Main menu ENTER COMMAND �INPUT DATA� fit

Fit sub�menu ENTER COMMAND �INPUT PARAMETERS� powd

INFO The current pixel coordinates for the beam centre � ���� ����

INFO The current pixel sizes �microns� � �� ��

INFO The current sample to detector distance �millimetres� � ����

INFO The rotation angle of the tilt plane � �

INFO The tilt angle of the detector � �

CHANGE BEAM CENTRE AND�OR TILT VALUES �NO�

CORRECT FOR X�RAY BEAM POLARISATION �YES�

BEAM POLARISATION �AT SAMPLE� �Range ��� to ���

����� �

��The PDS format is a simple ASCII format devised by Andy Fitch and Andrew Murry for the storage ofangular scan data for input to Rietveld re�nement programs�

��It is necessary to output the PDS format data here� as the number of pixels averaged to create one angularbin is not available after this option is �nished

Page 216: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Enter the �polarisation� of the main beam on the sample� This is defined as

�I�h � I�v� � �I�h � I�v�� where I�h is the horizontal component of the

intensity and I�v is the vertical� �The horizontal should correspond with

the X�direction on an image� Normally for a synchrotron the polarisation

is positive and approaches ��� e�g� Station ��� at the SRS Daresbury has

been measured to have a polarisation of ���� This is a value which is

dependent on the X�ray source� beam�line mirrors� and on the monochromator�

The beam�line scientist should be able to give a good estimate of this

number�

BEAM POLARISATION �AT SAMPLE� �Range ��� to ���

����� ���

TYPE OF LORENTZIAN CORRECTION TO APPLY �NONE� �

Enter the type of �Lorentz� correction which you want to apply to the

output intensities� At present the following choices are available

NONE No correction factors applied

PARTIAL POWDER ��THETA SCAN� Correct intensities to be equivalent to

a �theta scan with a single counter� This allows standard powder

diffraction software to apply their own Lorentz corrections�

TYPE OF LORENTZIAN CORRECTION TO APPLY �NONE� part

PRODUCE EQUAL ANGLE PIXEL SCAN �YES� �

Enter �YES� if you want to produce a ��D scan as a function of equal

angle pixels�

�NO� if you want to produce a ��D scan as a function of equal

radial distance pixels �on an orthogonal detector��

�The two are not the same��

The best choice will depend on the capabilities on any further

processing software� e�g� If a Rietveld program requires equal angle

pixels then this is clearly the choice� If either type of scan may be

treated then the equal radial re�binning is probably preferable�

PRODUCE EQUAL ANGLE PIXEL SCAN �YES�

THETA SCAN ANGULAR PIXEL STEP �DEGREES�

�Range ��E�� to ��� ����E�� �

Enter required angle step between bins for the calculation of the ��D

theta scan� �The default value corresponds to the angular size of

the average pixel size at the beam centre��

THETA SCAN ANGULAR PIXEL STEP �DEGREES�

�Range ��E�� to ��� ����E��

TAKE ACCOUNT OF SPATIAL DISTORTION �NO� �

YES if a the detector spatial distortion has been characterised and is

to be taken into account� If you answer �YES� you will be required to

input the name of a valid spatial distortion interpolation file�

TAKE ACCOUNT OF SPATIAL DISTORTION �NO�

INFO Starting to re�bin �D data to a ��D profile� this can take some

time for large arrays�

INFO Number of rows treated � � � ��#�

INFO Minimum fractional intensity decrease owing to polarisation � ���

INFO �The reciprocal value is applied to the data��

Page 217: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

SAVE DATA IN �POWDER DIFFRACTION STANDARD� FORMAT �YES�

Enter name of output file

FILE NAME �scan�pds�

Note�

� The default pixel size for equal angular pixel size scans is an exact multiple of one thousandth of a degree �V������ This is because the PDS format saves the angular step tothis precision� Since thousands of scan bins may be output a small error can build up tobe relatively large angle� It is recommended to only use pixel bin sizes which are exactmultiples of a thousandth of a degree when outputting data to PDS �les�

� For the Polarisation correction to be correct the image must have been input in thecorrect orientation� i�e� The horizontal on the displayed image should correspond withthe horizontal on an upright detector in line with the direct beam�

� The �Lorentz� correction allows data from a �at �D detector which has been rebinnedinto a �D ��� scan� to be corrected for geometrical di�erences between this scan and atrue �� scan �V������ Following this correction the normal Lorentz corrections presentin Rietveld re�nement and other re�nement programs should be appropriate�

����� R�THETA RE�BINNING

R�THETA RE�BINNING transforms a �D Cartesian coordinate system pixel image into a polarcoordinate system pixel image� There is arbitrary choice of the number of radial and angularpixels�

Spatial distortion beam centre and detector tilt are taken into account� The commandTILT�CENTRE BEAM �see Section ����� Page ���� can be used to determine the tilt and optionally the beam centre� If a semitransparent beamstop is used the beam centre can befound be �tting a suitable function e�g� �D Gaussian �see Section �� Page ����� Other commands may also be useful e�g� the PIXEL X�Y option within the DISPLAY submenu of thegraphics menu of the IMAGE command �see Section �� Page � ��

By varying the number of radial and angular bins this command allows anything from a �Dradial pro�le to a �D azimuthal pro�le of a di�raction ring to a number of radial pro�les asa function of angle to be produced�

����� RADIAL PROFILE

Creates a �D radial pro�le from unmasked data in the current ADR� output is in the memory�The centre of symmetry is speci�ed as is the required size of pro�le pixels� The average valuesof pixels at each distance range from the centre are calculated�

If variance arrays exist estimates of the variance for each radial pixel position will be calculated�This is based on the variation of values which contribute to each value� When more than ��pixels contribute to the radial average the variance ���� is estimated from the normal equation

Page 218: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

� #�

n� �

�nXi��

x�i � nm�

����

where m is the mean value n is the number of measured values and xi are the measured values�

�The best estimate for smaller numbers of pixels is under review��

����� RESULTS

Once a �t has been MINIMISE�d the results may be displayed� This converts certain parametersto more convenient units e�g� degrees for angles� For each parameter a short character stringshows the type of the parameter�

�At present the error estimates for the �tted parameters are not being calculatedIf this if required it can be reinstalled relatively quickly�

Note� By using the OPEN LOG command in the main menu prior to entering the FIT submenuthe output of RESULTS may be saved in an ASCII �le �See Section � ��� Page �� ��

����� SET MASK COLOUR

This commands allows the user to change the colour used to represent the �maskedo�� elementsin the DEFINE MASK and DISPLAY MASK options� The user is prompted for the colour to be used�e�g�

COLOUR FOR MASKED OFF ELEMENTS �RED� �

Enter one of the following available colours

BLACK BLUE BROWN CYAN GREEN GREY MAGENTA ORANGE RED VIOLET WHITE YELLOW

� INDEX� �� INDEX�

COLOUR FOR MASKED OFF ELEMENTS �RED� green

When the data and mask are next displayed the chosen colour will be used to display the�maskedo�� elements� �In fact the colour will be as close as is possible given the colourspresently stored in the colour table��

����� SET UP

Various aspects of the minimisation may be controlled from this submenu� Most importantlyare the number of iterations MINIMISE will perform before stopping and the aimed accuracy ofthe �t� �Many of the options are not presently relevant since they refer to multiple �D �ttingwhich is not presently implemented��

The available options are�

Page 219: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

ACCURACY� Set aimed accuracy of the minimisation process� This is the aimed for reducedchisquared for a weighted �t or the average square residual for an unweighted �t�

CHANGE FIT ORDER� Not relevant

DISPLAY FREQUENCY� Not relevant

EXIT� Exit from SET UP submenu to return to FIT submenu

FAST DISPLAY� Not relevant

HALT CRITERION� Not relevant

MAXIMUM LIKELIHOOD� Not relevant

MODEL EVOLUTION� Not relevant

NUMBER ITERATIONS� Set number of iterations per variable parameter

POISSONIAN STATISTICS� Not relevant

REQUEST CONTINUATION� Not relevant

VIEW� Display current state of all setup variables

WEIGHTED FIT� Toggle between weighted or unweighted �t �only relevant if variance arraysare present otherwise all �ts are unweighted�

���� SURFACE POLYNOMIAL

The ADR except for maskedo� data is �tted by a �D polynomial of user input order in Xand Y� The chosen surface is the least squares solution to the data� Generally the order of thepolynomial should be much lower than the number of data points in each direction to avoidthat the surface �ts noise in the data�

The RMS residual of the �t is output� This �gure may be compared to the error estimates ofthe data to see if the �t is to loose or �ts the errors too much� If variance estimates are presentthe �t will be weighted and the RMS residual output will be a reduced chisquared �gure�

The �tted surface is created in the memory so may be recovered after leaving the FIT submenu�

����� THRESHOLD MASKING

The THRESHOLD MASKING command allows masked and unmasked elements within the ADRto be de�ned automatically based on a user set logical criterion� The user selects one of twological tests� i� greater than ii� less than and a threshold value� All data elements in the ADRwhich obey the test are set to be masked and all those which fail are set to unmasked�

e�g� If we want all elements with a data value below �� to be set to be masked then thefollowing program dialogue would be produced�

Page 220: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Fit sub�menu ENTER COMMAND �INPUT PARAMETERS� threshold

INFO This option allows masked�off elements with the ADR to be defined

automatically depending on the data values� The user can set a

threshold operation ��GREATER THAN� or �LESS THAN�� and a

threshold level� All data values which CONFORM WITH the defined

test will be set to be masked�off� All others will be set to be

un�masked�

LESS THAN COMPARISON �YES�

DECISION THRESHOLD DATA VALUE ���� ��

����� TILT�BEAM CENTRE

TILT�BEAM CENTRE allows any nonorthogonality of the detector to the direct beam �tilt� andthe direct beam centre on the detector to be determined ����� This is achieved by least squares�tting of powder rings �or rings from other randomly orientated samples e�g� wax��

Below is the log �le from FIT�D of the present user interaction� The documentation will befully written when the algorithm and user inputs are stable�

Fit sub�menu ENTER COMMAND �INPUT PARAMETERS� tilt

WARNING This is a development routine� user prompts are likely to change

SAMPLE TO DETECTOR DISTANCE �MILLIMETRES�

�Range �� to ��E��� ���

NUMBER OF ANGULAR SECTIONS �Range � to ��� ��� �

The powder ring is divided into a number of equal angle sections for

calculating the radial centre of each section� From the radial centre

and the average angle two Cartesian coordinates are calculated� These

coordinates are used to fit optimum beam centre and detector plane tilt

angles� Enter required number of sections for calculations�

NUMBER OF ANGULAR SECTIONS �Range � to ��� ���

WEIGHTED FITTING �NO� �

The fitting of tilt angle and beam centre to the estimated ring centres

may be performed using weighted fitting or unweighted fitting� If

weighted fitting is chosen then the average intensity �� pixels� around

the calculated centre of each radial profile is used to weight the fit�

This means that strong rings and strong angular regions of rings will

have more influence than weaker ones� This should make the fitting more

robust when the data has weak rings and noisy background�

WEIGHTED FITTING �NO�

REJECT OUTLYING COORDINATES �YES� �

Outlying coordinate positions which are more than an input number of

standard deviations radially from the fitted ring positions may be

rejected from the coordinate lists� The beam centre�tilt can then be

re�fitted without these coordinates� If erroneous coordinate positions

are influencing the fit� this option may allow them to be removed�

Page 221: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

have more influence than weaker ones� This should make the fitting more

robust when the data has weak rings and noisy background�

REJECT OUTLYING COORDINATES �YES�

REJECT LIMIT �NUMBER OF STANDARD DEVIATIONS�

�Range �� to ��� ���� �

Enter the limit of number of standard deviations after which coordinate

positions are to be rejected from the coordinate lists� A three sigma

limit should be reasonable for less than about coordinates �assuming

they are normally distributed��

REJECT LIMIT �NUMBER OF STANDARD DEVIATIONS�

�Range �� to ��� ����

FULL ALGORITHM INFORMATION �YES� �

YES if you want step by step diagnostics information

FULL ALGORITHM INFORMATION �YES�

INPUT METHOD FOR BEAM CENTRE �KEYBOARD� �

AVERAGED GRAPHICAL Average of average symmetry centres

CIRCLE COORDINATES Least squares fit on ��� coordinates

ELLIPSE COORDINATES Least squares fit on ��� coordinates

GRAPHICAL COORDINATE Single graphical input coordinate

KEYBOARD Single keyboard entered X�Y coordinate

INPUT METHOD FOR BEAM CENTRE �KEYBOARD�

X�PIXEL COORDINATE OF BEAM CENTRE ������ ��

Y�PIXEL COORDINATE OF BEAM CENTRE ������ ��

INFO The search distance either side of the powder rings �mm� � �����

INFO The search distance either side of the powder rings �X�pixels� � �����

GRAPHICAL INPUT �������E� ������E�

INFO Radius of powder ring � �mm� � �����

INFO Radius of powder ring �mm� � �����

INFO Radius of powder ring � �X�pixels� � �����

INFO Radius of powder ring �X�pixels� � �����

REFINE BEAM CENTRE �YES� �

The entered beam centre position may be kept fixed or may be refined

along with the tilt and powder ring opening angles� If the beam centre

is well known e�g� by using a semi�transparent beam�stop then it is

probably better not to refine the position�

Enter �YES� for the beam centre position to be refined� and �NO� if

the present values are to be kept fixed�

REFINE BEAM CENTRE �YES�

REFINE SAMPLE DISTANCE �NO� �

Enter �YES� to refine the sample to detector distance� Normally it is

probably best initially to keep this fixed� so answer �NO�� Having

refined all other parameters� on a second iteration the distance can

also be simultaneously refined�

REFINE SAMPLE DISTANCE �NO�

INFO Calculating centre of gravity coordinates on � powder ring

INFO Number of acceptable coordinates on first ring � �

Page 222: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

INFO Fitting ellipse to centre of gravity coordinates

INFO Number of coordinates � �

INFO Best fit ellipse centre �X�Y mm� � ������� ������

INFO Best fit ellipse centre �X�Y pixels� � ������� ������

INFO Best fit radius �� radius �mm� � ������ ��������

INFO Best fit radius � �X pixels� � ������

INFO Best fit radius �Y pixels� � ��������

INFO Best fit angle of axis � �degrees� � ��������

INFO Estimated coordinate radial position error �mm� � �������E��

INFO Estimated coordinate radial position error �X pixels� � �������

INFO Calculating centre of gravity coordinates on powder rings

INFO Fitting powder rings to centre of gravity coordinates

INFO Number of iterations � �

INFO Number of function calls � ��

INFO Sum of squares � �������������E��

INFO Number of rejected coordinates �

INFO Number of iterations � �

INFO Number of function calls � ��

INFO Sum of squares � �����������E��

INFO Fit of powder ring to inclined detector

INFO Best fit beam centre �X�Y mm� � ������� ������

INFO Best fit beam centre �X�Y pixels� � ������� ����

INFO Cone � best fit theta angle �degrees� � ��������

INFO Cone best fit theta angle �degrees� � �������

INFO Best fit angle of tilt plane rotation �degrees� � ������

INFO Best fit angle of tilt �degrees� � �������

INFO Estimated coordinate radial position error �mm� � �������E��

INFO Estimated coordinate radial position error �X pixels� � �������

INFO Alternative fit of powder rings to centre of gravity coordinates

INFO Number of iterations � �

INFO Number of function calls � ��

INFO Sum of squares � ��������������E��

INFO Number of rejected coordinates �

INFO Number of iterations � �

INFO Number of function calls � ��

INFO Sum of squares � ����������������E��

INFO Fit of powder ring to inclined detector

INFO Best fit beam centre �X�Y mm� � ������� �����

INFO Best fit beam centre �X�Y pixels� � ������� �����

INFO Cone � best fit theta angle �degrees� � ��

INFO Cone best fit theta angle �degrees� � ��������

INFO Best fit angle of tilt plane rotation �degrees� � �������

INFO Best fit angle of tilt �degrees� � ������

INFO Estimated coordinate radial position error �mm� � �������E��

INFO Estimated coordinate radial position error �X pixels� � �������

Page 223: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

INFO In the absence of any other information� there are two equally

valid solutions to the tilt angle and beam centre which could

have formed a powder ring on an inclined detector� Theoretically

these should both give the same goodness of fit� so both solutions

are output� If the position of the beam�stop is known� then the

�correct� solution may be selected�

INFO SOLUTION �

INFO Best fit beam centre �X�Y mm� � ������� ������

INFO Best fit beam centre �X�Y pixels� � ������� ����

INFO Cone � best fit theta angle �degrees� � ��������

INFO Cone best fit theta angle �degrees� � �������

INFO Best fit angle of tilt plane rotation �degrees� � ������

INFO Best fit angle of tilt �degrees� � �������

INFO Estimated coordinate radial position error �mm� � �������E��

INFO Estimated coordinate radial position error �X pixels� � �������

INFO SOLUTION

INFO Best fit beam centre �X�Y mm� � ������� �����

INFO Best fit beam centre �X�Y pixels� � ������� �����

INFO Cone � best fit theta angle �degrees� � ��

INFO Cone best fit theta angle �degrees� � ��������

INFO Best fit angle of tilt plane rotation �degrees� � �������

INFO Best fit angle of tilt �degrees� � ������

INFO Estimated coordinate radial position error �mm� � �������E��

INFO Estimated coordinate radial position error �X pixels� � �������

WHICH SOLUTION �Range � to � ���

����� TRANSFER MASK TO MEMORY

This �transfers� the data mask to the memory� All elements which are maskedo� in the datamask will be set to ��� in the memory� unmasked elements will be set to ����

This option can be used together with the THRESHOLD MASKING command to save and reusemasks� Operations such as adding two masks may also be used�

Page 224: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Publication Quality Graphs

The keyboard interface command PUBLICATION QUALITY changes all line widths �except thoseof the grid� to double thickness and sets all text fonts to the best available font� previous linewidths or font settings are replaced���

Thicker lines are usually desirable when graphics are photoreduced for publication�

��At present only one font family is used by the graphics system so the fonts do not change� but the fontfamily used� �Times�Roman� should be suitable for most purposes�

Page 225: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

�� Creation and Usage of Simple Macros

Often the same sequence of data analysis operations will need to be repeated for many di�erentdatasets� The instructions here show how a simple �macro� may be created for this purposeand automatically run on the sequence of �les� More versatile and sophisticated macros mayalso be developed their creation is described in Appendix B �Section �� Page � ���

The simplest way in which you create a macro �le is to perform the normal data analysis of one�le but to enter the MACROS � LOG FILE interface before and click on the CREATEMACRO button and afterwards to return and click on the STOP MACRO button� Whenyou click on the CREATE MACRO button you will be asked for the name of the macro �leto create�

FIT�D will save this macro to an ASCII �le� This contains the instructions for the data analysissequence but will only run on the �le which has just been treated� Using your favourite editorthe �le name�s� can be found and replaced by �variable names� which will be automaticallygenerated by FIT�D�

e�g� A standard basic macro has one input �le and one output �le so the input �le name wouldbe replaced by the �variable� �IN and the output �le name by the �variable� �OUT�

Having edited the macro it is ready to use with RUN SEQUENCE button� See Section �Page �� for further information� This prompts for the names of the �rst and last input �les�corresponding to �IN�� From these �les the changing numerical part is deduced� The user isprompted for the increment between �les� By default this is � �or �� i�e� every �le in the seriesis treated but by entering larger integers every secong third etc� �le can be used and theothers ignored� The output �les �corresponding to �OUT� are given the same name as the input�les except for the �le extension� The user is prompted for the �le extension which replacesthat of the input �les� This will then automatically generate the sequence of �le names andrun the macro on each set of input and output �les�

It is also possible to de�ne and run macros from the �KEYBOARD� interface using the STARTMACRO STOP MACRO and SEQUENCE commands� This is much more �exible �and complicated��more than one input and output �les are possible and other variables can be generated to makemacros more versatile� See Section �� Page � � for further details�

Page 226: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Command Line Options

To make FIT�D more versatile and for �batch� mode applications a number of command lineoptions are available� This allows a Unix script to be written to provide batch mode processingof a sequence of �les �see Section ��� Page � ��� �Note� Now the SEQUENCE command canalso be used to process a sequence of �les with interactive control of the �les to be treatedbut for special tasks a Unix script may still be useful�� Program �variables� may be de�ned�See Section ���� Page � �� a macro �le may be speci�ed to run FIT�D in macro mode�See Section �� Page �� � the program array dimensions may be speci�ed and FIT�D maybe started with �landscape� graphics instead of the default �portrait� graphics� The graphicssystem may also be �turnedo��� The manner in which the command line options work is bestillustrated by an example� The following is an example command line which may be used�

� fitd �dim���x��� �land �key �svar�IN�im�gel �svar�OUT�im�ps �macplot�mac

The command line would start FIT�D in the following manner�

�dim���x��� Starts FIT�D with programs arrays of �� � pixels in the Xdirection and���� pixels in the Ydirection

�land Starts the graphics in �landscape� mode i�e� the graphics window appears wider thanits height and PostScript output is printed in this orientation�

�key Starts FIT�D in �keyboard� mode�

�svar�IN�im�gel De�nes a program variable of data type �character string� whose name is�IN and whose value is im�gel

�svar�OUT�im�ps De�nes another �character string� program variable whose name is �OUTand whose value is im�ps

�macplot�mac Starts FIT�D in macro input mode taking input from the macro �le plot�mac�

Here the order of the options has been given in a �logically sensible order� but the order isnot important except if options are repeated� This example only makes sense if the macro �leplot�mac exists which would normally input a �le de�ned by the variable �IN plot the data orsome region of the data using �landscape� mode and output the graphics into a PostScript �lede�ned by �OUT� �Complicated command line calls may be made simpler and shorter throughthe use of �aliases���

The di�erent options are described in greater detail below�

���� Macro File

FIT�D may be started automatically from the operating system command line to run a macro�le� �The macro �le may or may not close FIT�D�� The option to startup in macro mode is

Page 227: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�mac and must be followed by the name �or a path and name� of a valid macro �le� ��MAC��mac� and �MAC may also be used�� For creation of macro �les see Section �� Page �� �

When FIT�D is started in macro mode it will not prompt for the size of the program arraysor if variance arrays are to be created� By default the program arrays will be set to ���������pixels and no variance arrays will be created� If this is not suitable for the macro the programarrays may be created a di�erent size by using the �dim option and variance arrays may becreated by using the �var option �see below�� Alternatively the DIMENSIONS command may beused within a macro to override the defaults values�

To make complicated macros versatile �variables� may be used within the macros and their�values� may be changed to change the behaviour of the macro i�e� to parameterise the macro�This is most useful to allow the macro to work on di�erent input and output �les but may alsobe used for other purposes� Thus to make the macros versatile the �ivar� �lvar� �rvar�

�svar options exist �see below��

Only one macro �le may be opened so it only makes sense to specify one macro �le on thecommand line� If more than one is speci�ed then only the �rst one will be used�

���� Variable De�nition

The options �ivar� lvar� �rvar� �svar exist to enable program variables to be de�nedfrom the operating system command line� ��bvar� �cvar� �fvar are alternative names of theoptions��

The di�erent options de�ne variables of di�erent data types� i�e��

�bvar Logical �boolean� variable

�cvar Character string variable

�fvar Floating point real variable

�ivar Integer variable

�lvar Logical �boolean� variable

�rvar Floating point real variable

�svar Character string variable

��bvar� �BVAR� �BVAR are equivalent to �bvar as are the corresponding variations for theother options�� Immediately following the option is the name and the value of the variableseparated by an equals sign� The �rst blank ends the variable de�nition �It is recommendedto always use names that cannot be mistaken for other entry e�g� start every variable namewith a hash ����� At present lines of text cannot be de�ned as values for variables from thecommandline�

Variable de�nition makes most sense when used within a macro �See Section ��� Page � ��

Page 228: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Multiple variable de�nitions may be used to de�ne a number of di�erent variables� If the samevariable name is used more than once the later versions will overwrite the previous versions�

��sym� �SYM� �sym� �SYMBOL� and �SYM was the manner in which to de�ne program �symbols� before V����� These may still be used and de�ned a variable of data type �unknown�however it is recommended to replace these with the new options which allow the data type tobe de�ned� Internally these are stored as strings and can usually be converted to the requiredinteger logical real or character string value but this may cause problems��

���� Program Dimensions

In macro mode FIT�D will not prompt the user for the size of program arrays� By default theywill be ��������� pixels� If this is not suitable then their size may be speci�ed on the commandline by using the �dim or �dimensions option� ��DIM� �DIMENSIONS� �dim� �dimensions�

�DIM� and �DIMENSIONS are equivalent�� The �dim option should be immediately followed bythe size of the program arrays to create in the Xdirection and the size of the arrays to createin the Ydirection separated by an x or an X��� The �dim option may also be used to avoidbeing prompted at startup for the program dimensions�

e�g� The following operating system command line would start FIT�D with program arrays of �� elements in the Xdirection and ��� elements in the Ydirection�

� fitd �dim�x�

�The DIMENSIONS command may be used within a macro as an alternative method of changingthe size of program arrays from the default values��

��� Variance Arrays

In macro mode FIT�D will not prompt the user as to where or not variance arrays should becreated� By default they will not be created� If this is not suitable then their creation may bespeci�ed on the command line by using the �var or �variances option� ��VAR� �VARIANCES�

�var� �variances� �VAR� and �VARIANCES are equivalent��

�The DIMENSIONS command may be used within a macro as an alternative method of creatingvariance arrays��

���� No Graphics

Sometimes it is required to run FIT�D without a graphics output window� This may berequired because the output window cannot work properly across the network� It may also befor batch processing which doesn�t require any display� The �nographics command line optionallows FIT�D to startup and stop without the graphics display window being opened� Clearly

��The multiplication sign cannot be used as this has a special purpose for the Unix operating system�

Page 229: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

this makes many commands invalid�� �The �nographics option can be shortened to �nogrand alternative forms are equally permissible� �NOGRAPHICS� �nographics� �NOGRAPHICS��

���� �Landscape� Output

By default FIT�D always produces vertical A� ��portrait�� output on the screen and onpaper� The page format can be changed to horizontal ��landscape�� output by using the option�landscape or �land on the command line when running the program ��LANDSCAPE� �LAND�

�landscape� �land� �LANDSCAPE� and �LAND are equivalent�� i�e� To start up FIT�D in�landscape� mode enter�

fitd �landscape

Since the page layout has been designed for �portrait� mode some rearrangement of the pagelayout may be necessary�

���� Colour Table Control

The number of colour indices used by FIT�D may be control by the �col option followed bythe number of colour levels to be used� ��colours� �COLOURS� �COL� �COL� �COLOURS� etcare alternative accepted options�� FIT�D uses eight colours for the primary and secondarycolour and for black and white and a variable number of colours for continuous false colourscale display of image data� The minimum number of colours is �� whilst the maximum ispresently ���� Values outside this range are ignored� Clearly colour tables with only eightcolours �the minimum allowed� are not smooth�

This option can be useful to allow other programs which are not written to create their owncolour tables to run after FIT�D has been started�

e�g� to startup FIT�D using only �� colour levels ��� used for the false colour image display�enter�

� fitd �col�

���� Graphical Form and Menu PostScript Output

For documentation purposes e�g� producing this manual the �dform and �dmenu optionsenables optional saving of form and menu graphics to PostScript �les� This will not normallybe used�

When �dform or �dmenu has been speci�ed it is possible to click within a form or a menu butoutside button and other active areas� FIT�D then prompts for the name of a �le to save the

�At present use of some graphics command� whilst FIT�D is in this mode will result in a core dump�Gradually� these commands will be protected� and warning messages will be issued instead�

Page 230: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

PostScript graphics within� This �le will be written with the instructions to draw the form orthe menu�

Since forms also continue menus it is necessary to use the �dform option without the �dmenuoption to be able to save the graphics of the whole form�

Page 231: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Coordinate Systems

For full use of FIT�D�s display possibilities it is necessary to understand the coordinate systemsused for di�erent user controllable items� Interactive control of the position and size of falsecolour images and contour plots is available as are the position of extra graphical items�

The positions of all graphical items are speci�ed in X�Y coordinates where the Xaxis ishorizontal and a larger Xvalue is further to the right and the Yaxis is vertical and a largerYvalue is higher on the page�

There are two di�erent types of coordinate system�

� Data Coordinates

� Page Coordinates

�Data coordinates� are the coordinate system of the data and the range of displayed datacoordinates is either automatically determined or is set by the user �REGION PIXEL REGION��This region is the ADR but is also referred to as the �Data Display Region� �DDR� by thegraphics system�

�Page Coordinates� are the coordinates of the �page� and the position of all the graphical itemsmay be altered by altering their page coordinate� The position of the graph on the page isreferred to as the �Graph Page Position� �GPP�� This is the position of DDR on the page�There is a mapping or transformation between data coordinates and page coordinates�

The page coordinate system goes from ��� to ��� in the longest edge and from ��� to the pageaspect ratio in the the other direction� e�g� For A� portrait X may be between ��� and ������and Y may be between ��� and ����

Almost all items whose layout position may be changed are in page coordinates� The exceptionis annotation labels and annotation arrows� These may be de�ned in either page coordinatesor in data coordinates� This allows the possibility to link the position of annotation labels thearrows to parts of the graph�

Page 232: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Including Graphics in LATEX ��Documents

The PostScript �les produced by FIT�D are suitable for including in LATEX ��documents usingthe graphicx package� To use the graphicx package include the following line near the startof your LATEX �le �before the nbeginf documentg line��

"usepackage&graphicx'

The nincludegraphics command is used within the LATEX document to specify the inclusion ofa PostScript �le� e�g� If a �le called fitd�ps has been created and we want include it in adocument taking up � �mm vertically we can used the command�

"centerline&"includegraphics�height���mm�&fitd�ps''

The FIT�D graphics are designed to occupy a page of A� so the height option is necessaryto tell LATEX �� to reduce the size of the graphics�

In the GUI mode FIT�D always outputs one graphics page per PostScript �le� In the �keyboard� mode FIT�D will output several graphics pages into a single PostScript �le unless theEND GRAPHICS FILE command is used in between PRINT GRAPHICS commands�

To use only part of a diagram it is necessary to specify the region as part of the nincludegraphicscommand�

See the �LATEX User�s Guide and Reference Manual� ���� or �Using EPS Graphics in LATEX ��Documents� ���� for further details�

Page 233: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� The Graphics System

A simple e�cient graphics system �LG� the �Light Graphics� system� has been written to allowgraphical output to X�� displays and PostScript �les� This replaces the previous commercialsystem�

LG is similar in concept to but not the same as GKS ��The Graphics Kernel System�� aninternational standard for �D computer graphics� LG allows a device independent interfacebut has extra functionality for more e�cient use of the underlying hardware�

The system tries to be close to WYSIWYG ��What You See Is What You Get�� but thelimitations of X�� or the PostScript printer will lead to some di�erences�

The new system allows many advantages and allows similar appearance of the graphical outputbut is quite di�erent in some important aspects�

���� Fonts for Text Output

Hardware �bitmap� fonts are now used which means faster solid text but the choice of sizesare limited and slight di�erences may occur between the screen font and the hardcopy font���

If available the �TimesRoman� font family is used� Depending on the size of the window andthe required size of characters the nearest font size will be used� However very big and verysmall fonts are not available in X�� so the range of sizes is limited� If the required font is notfound a standard X�� font will be used instead ��x�� or �X� � but this font will be far fromthe ideal size� It has been seen that some Xservers have fonts with di�erent aspect ratios tothose for which FIT�D was designed� This may lead to text extending outside the normalregion� For PostScript output the exact font size �as originally requested� is produced so slightdi�erences in the size of characters on the screen and on paper will occur�

X�� �generally� does not provide for rotated characters �although PostScript does� so rotatedtext is simulated� In the future other fonts e�g� Greek characters may be provided�

���� Colour Map Usage

FIT�D is presently optimised for use on colour displays ��Xdisplays�� with a maximum of � �available displayable colours at any one time ���bit plane pseudocolor��� These are still thevast majority of available displays although ���bit plane� �true colour� displays are startingto become more common�

An individual window e�g� the FIT�D graphics window is allowed to de�ne up to � � individual colours which may be di�erent to those which are de�ned by another window� When theuser clicks in a new window�� then the colours de�ned by the new window replace the colours

��In fact X R allows arbitrary sized fonts to be generated� but this is only available on a smaller percentageof current X�servers� so this possibility has deliberately not been exploited�

��Or in some cases by simply moving the cursor into a new window� depending on how the �window manager�

Page 234: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

previously used� This is termed �colour �ash� and previously readable text may become unreadable�

�Colour �ash� may be avoided if all windows share the same colours but this not suitable fore�cient false colour image display e�g� grey scale of large images� FIT�D de�nes its owncolours� If there are enough remaining unde�ned colours in the default colour table then thiswill be used and �colour �ash� will not occur� Unfortunately window managers and otherprograms are using more and more colours simply for button display and shading so often veryfew colours levels are unde�ned� In this case a new individual colour table is created and usedby FIT�D� To minimise the problem cased by �colour �ash� the �rst �� colours in the existingcolour table are copied and are left unchanged� On some Xdisplays this keeps text readablebut unfortunately other Xdisplays use other colour levels for displaying text so still su�er from�colour �ash��

FIT�D needs a large number of colour levels to be able display false colour �or greyscale�images e�ciently with a smooth colour scale� To minimise the problem of colour ��ash�FIT�D will use the default colour map if a minimum number of contiguous colour levels arefree �presently ����� It will then use the remaining colours to produce the smooth false colourscale and � basic colours� Otherwise a new colour map unique to FIT�D will be created�The �rst �� levels will be copied from the window managers colour map and the remaininglevels will be used for the smooth false colour scale and � basic colours� If this happens colour��ash� will probably be noticed but depending on which levels are used for which windowsthe e�ect may be minimised��� It is worth noting that some programs have not been writtento create their own colour tables so will not work after FIT�D has been started� However ifsuch programs are started �rst and FIT�D afterwards the two can be used simultaneously�

Within the colours de�ned by FIT�D eight colours are always �xed and are used for menudisplay and user prompts �white black red green blue yellow cyan and magenta�� Theremaining colour levels are �lled with the required false colour table e�g� geographical orinverse greyscale� Di�erent colour tables contain di�erent colours so graphical objects whichare not coloured in one of the eight constant colours will change colour when the colour tableis changed� �This is why the �FIT�D� logo background sometimes changes colour just afterFIT�D is started� The background is orange which is de�ned in the default colour table butnot for example in a greyscale��

The number of colour indices used may be varied by a commandline argument �col �seeSection �� Page �����

Note� some programs e�g� the DENZO display program Xdisplayf do not work properly ifthey cannot obtain enough colour levels from the window managers colour map� With such aprogram it may be better to start the program �rst and FIT�D afterwards if both are requiredsimultaneously�

has been de�ned���On HP booted X�servers xterm uses colour levels within the �rst ��� so the terminal window remains

readable� but on Sun booted X�servers this is not the case�

Page 235: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

���� Graphical Input

Graphical coordinate input activates a �crosshair� cursor so that horizontal and vertical alignment is easier� During input of a series of connected coordinates a �rubberband� may be drawnfrom a previous coordinate and a line may be used to join the input coordinates� Similarlyif a rectangular region is to be de�ned by two coordinates a �rubberband� box will be drawnfrom the �rst input coordinate whilst inputing the second� Certain coordinate inputs e�g� the�ZOOM IN� button command produce a special �spyglass� or �looking glass� window showingin greater detail the region around the graphics cursor �V������ As the cursor moves so thisdisplay region will change�

Text input is now available within the graphics system �V������ This supports �commandrecall� and command editing using the arrow keys� Text may edited by using the left andright arrow key to move to the required character� Newly typed text is automatically insertedat the cursor position and the �DELETE� key �or the �BACKSPACE�� may be used to deletecharacters before the cursor� Often a default value will be presented� This may be edited orthe down arrow key may be used to remove it�

At present all graphical input and menus appear within the same window as the image display�Eventually a separate graphical menu window is desirable�

��� X��� Restrictions

At present the LG system has only been written for Xdisplays where the default colour mapping method or �visual� �in X�� terms� is an �bit plane �PseudoColor visual��� or ��bitplane �TrueColor� �V������� Unfortunately ��bit �TrueColor� graphics is handled in a verycomplicated manner in X�� and there are many possible combinations of bit and byte ordering�The output has been tested on eXceed and LAN Workplace Pro Xservers in ��bit mode anda number of Unix workstations but it may not work properly on some other systems� Othertypes of colour mapping can now be added with reasonable ease since they are related to one ofthe above choices e�g� a ��bit plane �TrueColor� system could be added but still this involvesa variety of changes to the source code and needs testing on such a system� For this to beviable I need access to such systems at the ESRF�

If the default is not suitable a detailed error message will be output explaining the characteristicsof the default window�

���Visual� and �PseudoColor�� with the American spelling� are X� terminology�

Page 236: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Limitations� Bugs� and Unclear Documentation

��� Known Bugs and Limitations

At present there are no known bugs but there are most likely to be severe limitations of thepresent graphics system� It is unlikely to work on monochrome systems�

The graphics system tries to use the �TimesRoman� font family which is also available forPostScript output� If it does not �nd the required font an alternative X�� font will be tried�This will generally work but will not be the intended size so text may be much smaller orlarger�

FIT�D now works on Windows system but this is new and there are many di�erences so bugsmay well be present on these systems�

��� Limitations

���� �Legal� Paper Hardcopy Output

The graphics system supports the �A� series of paper formats where the two dimensions arerelated by the square root of two� Other paper formats such as the �Legal� size often used inNorth America are not supported explicitly�

Since by default the graphics are designed for A� �portrait or landscape orientations� they willbe too wide for the legal paper format� By using the keyboard �PAGE POSITION� commandor the GUI OPTIONS menu �POSITION� command you can change the area of the size andhence the paper which is used to print the graphics� Thus the whole of the graphics can bemade to appear on the paper�

��� Reporting Bugs Bad Features and Bad Documentation

Users are invited and encouraged to provide feedback on FIT�D including comments on theonline and paper documentation� User feedback has already led to new features being addedand modi�cation to old ones to make them more understandable and easier to use�

If you think that you have found a bug then please follow the following reporting procedure�

�� Check the FIT�D Reference Manual section describing the command to make sure thatthe observed behaviour is not as described�

�� Check the FIT�D Reference Manual �Known Bugs� section �Section ���� Page ���� tosee if the bug has already been identi�ed and whether a work around has been suggested�

�� If the bug is �new� note the version number of FIT�D being used�

Page 237: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Use the OPEN LOG and CLOSE LOG commands to create a log�le record of the operations�minimum� which produce the bug�

� Send by Email or other means a description of the bug �if this is not obvious fromthe log�le� the version number any terminal or �le traceback information� If the bugappears to be data speci�c a means of obtaining �e�g� aftp� the data �le which causesthe bug�

As an encouragement to follow this procedure a free beer is o�ered to anyone who reports aserious unknown bug���

Users are also encouraged to provide feedback on the documentation� Please report mistakesand unclear documentation� Also report prompts which give insu�cient information for theuser to know how to respond� �Note� Giving documentation to users and getting them to tryto use it is the only way to test it properly ��

The index is a very important part of the FIT�D Reference Manual� Users are not expectedto read more than small sections of the manual� The index should be able to guide usersto relevant sections of the manual and show how the commands may be used to performparticular operations� It you �nd that a useful index item is missing for an operation whichcan be performed please inform me�

��The de�nition of whether or not a bug is serious or not rests with the author� Clearly� mis�use of theprogram� and annoying features do not count� and mistakes in documentation are unlikely to count� The oerdoes not cover bugs that occur within source code not written by the author e�g� �readline� code �but this seemsunlikely�� New �experimental� features are similarly not covered� The beer will be a standard �demi pression�and not a Palais de la bi�ere tourist sized top price beer� Anyone who �wins� a free beer is responsible for payingtheir own transport to and from the centre of Grenoble� Users who �nd features which work unusually well areinvited to oer a free beer in return � � �

Page 238: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

� TroubleShooting

���� Command not found

If when you enter FIT�D the system responds�

fitd Command not found�

this means either that FIT�D has not been installed �properly� or that your PATH variableis not properly de�ned� Normally FIT�D and other EXPG programs should be found in the�usr�local�bin directory�

Thus your environment variable PATH should include this directory�

e�g� To add the �usr�local�bin directory to the search �path� for executable programs youcan add the following instruction to your �cshrc �le���

setenv PATH �usr�local�bin PATH

See your system administrator if you cannot rectify the problem�

���� Failure in FIT�D Start�up

If FIT�D fails to startup properly this can be due to one of a number of reasons which areoutside the control of FIT�D�

If the following message appears or one similar it means that the present available systemvirtual memory size is too small�

Not enough memory

This problem may appear and go away simply owing to other users starting and �nishingprocesses� If this is a persistent problem see your system administrator�

If the welcome text appears but afterwards a message similar to the following appears it isnecessary to authorise another workstation �client� to communicate with your workstation �youhave a remote login��

Xlib connection to ��expgf ��� refused by server

Xlib Client is not authorized to connect to Server

Failed to open X��� display

��Great care must be taken when re�de�ning PATH as if a mistake is made it is possible to loss all systemcommands�

Page 239: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

ERROR X��� workstation not opened successfully �EXPG�LG�OPEN�WK�

STATUS The error was identified in module

EXPG�LG ��Light Graphics��

STATUS Position where error condition was identified

Subroutine EXPG�LG�X���OPEN V��

STATUS The error condition has been classified as

Failed to open X��� window �use ��xhost��� on X�server ��

WARNING The graphics window could not be opened� therefore the graphics

has been turned�off� You will need to change something to be

able to output the graphics e�g� xhost� on an X�server� Or

maybe the ��DISPLAY�� environment variable is not set correctly�

You can type

printenv DISPLAY

at the command line �C�shell and T�shell� to check�

Following this you need to re�start FITD�

To add the remote workstation to the list of allowed communicating workstations use xhoste�g� if the remote workstation is called expga it is necessary to type the following commandon your workstation�

xhost �expga

���� No Image Output

If the image display appears to be wrong or nothing appears to be displayed it is likely thatyou have previously used the Z�SCALE command to set the scaling mode to semiautomatic or�xed scale� If the present image is outside the range then the image will appear totally uniform�black or white for most of the colour tables��

To overcome this problem simply use the Z�SCALE command to set the scaling mode back tofully automatic or set a reasonable range �See Section � ���� Page �� ��

��� LATEX � Instructions Do Not Work

If the instructions given in Section �� Page ��� do not work it is probably because you areusing an old installation of LATEX which does not include the graphics or graphicx packages�

The instructions are for the �� version of LATEX and not for the older ���� version� You are

Page 240: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

recommended to update to the newer version which has much better and consistent supportfor including PostScript graphics within LATEX documents�

�With older versions of LATEX and the psfig macros you may overcome problems by removingthe showpage instruction from the PostScript �le produced by FIT�D��

���� Graphics Output File Does Not Print

A number of users have occasionally encountered problems printing the graphics output �le�The symptom is that the �le goes to the printer takes some time being processed but �nallyno output is produced�

This is almost certainly due to �CONTROL�C� being used to exit FIT�D� The Unix�� �le systemdoes not necessarily �ush �le bu�ers to disk unless forced to do so� When FIT�D is exitednormally there is a call to properly close any open �les including the graphics output �le� Thisensures that all output is properly written to the �le� With PostScript an image is only drawnon �paper� when the showpage command is encountered� This is normally the last line of the�le so if the �le is not properly closed this line can easily be lost�

The simple manner to avoid this problem is not to use �CONTROL�C�� Using �CONTROL�C�

may well cause other problems� It is possible that FIT�D also exits abnormally owing tocircumstances beyond the users control e�g� bugs or system crashes� Thus it may be useful tobe sure that a graphics output �le is properly closed without exiting the program� This canbe done using the END GRAPHICS FILE command �see Section � ��� Page ����� After the ENDGRAPHICS FILE has been issued and the prompt returns the user can be sure that the graphicsoutput �le is properly closed and written to disk� In this manner it is possible to send the �leto a printer without �rst having to exit FIT�D�

���� Missing Font Message at Start�up

At startup a message explaining that the a font is missing may occur� i�e�

WARNING Cannot open required font

This message can in principle appear later on but this is at least rare�

The missing font message is relatively normal and means that a standard X�� font will beused instead of a times roman font� �The times roman font family is available in PostScript sois used to give a close match between the screen and hard copy output��

Ideally the graphics system uses one of the following fonts to provide text in a wide variety ofscaled sizes�

clR�x�� timR�� timR�� timR�� timR��� timR��� timR�

��This may well be a problem limited to Unix systems�

Page 241: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

If the nearest smaller times roman font is not available then the above warning message isoutput and one of the following list of X�� fonts will be used if available�

�x�� �x�� �x�� �x�� �x�� �x��� �x��� �x��� �x��� �x� �x�

If the requested font is not found then FIT�D will try to use either the �x� or the �x�� font�If neither of these is found then the font selection has really failed no text will be output forthe required size and the following message will be output�

ERROR Cannot open �x� nor �x�� fonts� text cannot be

output to the X��� screen� You may be able to �load�

the necessary fonts� or change the font path� See

your system administrator or local X��� guru� Ideally

the TIMES�ROMAN series of fonts should be available�

It may be possible to alter the font path or to add extra fonts to the server to overcome theseproblems� This is however a job for the system administrator�

���� The Graphics is not Re�drawn when the Window is Uncovered

Normally the graphics window is redrawn whenever the window is uncovered after being covered by another window� This generally works but does not work by default with SiliconGraphics Xservers� �This may also be a problem with other Xservers but at present this hasnot occurred��

The problem is that Silicon Graphics Xservers do not provide �backing store� by default�FIT�D requests �backing store� when the graphics window is created and this works �ne onall other known Xservers� When �backing store� is enabled it is the window manager whichautomatically redraws the window when it is uncovered�

To make this work for Silicon Graphics Xservers�

The �le �usr�lib�X���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 �backingstore��

�Dominique Bourgeois can be thanked for investigating and �nding the solution to this annoyingproblem��

Page 242: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Acknowledgement and Citation of Use of FIT�D

For general usage of FIT�D beyond basic graphical display and very simple mathematicaloperations �see Appendix E Page ��� for further precision� users are kindly requested to addacknowledgements to published work and to cite �

A P Hammersley ESRF Internal Report ESRF��HA��T �FIT�D� An Introduction and Overview� ������

and�or

A P Hammersley ESRF Internal Report ESRF��HA��T FIT�D V����� Reference Manual V��� ������

For detector distortion calibration and correction users are kindly requested to additionallycite one or more of the following papers�

A P Hammersley S O Svensson and A Thompson �Calibration and correctionof spatial distortions in �D detector systems� Nucl� Instr� Meth� A��� ������������

A P Hammersley S O Svensson and A Thompson H Graafsma A Kvick andJ P Moy �Calibration and correction of distortions in �D detector systems� Rev�Sci� Instr� �SRI��� �� �������� ���� �

For nonuniformity of intensity response calibration using �uorescence from doped lithiumborate glasses users should acknowledge J P Moy and cite�

JP Moy A P Hammersley S O Svensson A Thompson K Brown L Claustre AGonzalez and S McSweeney �A Novel Technique for Accurate Intensity Calibrationof Area Xray Detectors at Almost Arbitrary Energy� J Syn Rad January ������

For data obtained using an Xray image intensi�er and corrected for spatial distortion and�ornonuniformity of response by FIT�D users are kindly requested to consider additionallyciting�

A P Hammersley K Brown W Burmeister L Claustre A Gonzalez S McSweeney E Mitchell JP Moy S O Svensson A Thompson �Monochromatic Protein Crystallography Data Collection Using an Xray Image Intensi�er� CCD Detector� J� Syn� Rad� � ���� ������

For integration of �D data to �D ��� scans� users are kindly requested to additionally cite�

Page 243: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

A P Hammersley S O Svensson M Han�and A N Fitch and D H&ausermann�TwoDimensional Detector Software� From Real Detector to Idealised Image orTwoTheta Scan� High Pressure Research �� pp�� ��� ������

For �D �tting with the MFIT �MULTIPLE FITTING� interface users should cite�

A P Hammersley and C Riekel �MFIT� Multiple Spectra Fitting Program�Syn� Rad� News � pp���� ������

Page 244: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Acknowledgements

FIT�D uses the FITPACK library of Paul Dierckx Dept� of Computing Science KatholiekeUniversiteit Leuven Belgium for surface �tting with spline functions�

FIT�D uses the �readline� library from the �Free Software Foundation� and has bene�ttedgreatly from the use of gmake and emacs�

FIT�D has bene�tted much �and hopefully vice versa� from the involvement of ESRF sta�and Ph�D� students and external users� In particular the following have provided much inputand constructive criticism� Peter B&osecke Andy Fitch Michael Han�and Daniel H&ausermannMartin Kunz Christian Riekel Olof Svensson Karl Syassen Andy Thompson Thomas UrsbyChristine Wassilew Reul Tim and Linda Wess and Fredrico Zontone� Similarly Ron Ghosh�ILL Grenoble� has provided much helpful advice�

The author would like to thank Tim and Linda Wess for permission to show the collagendata which was collected at the SRS Daresbury England� Andy Fitch and Phil Pattison forpermission to show the olivine data which was collected on the SwissNorwegian Beamline atthe ESRF France�

Page 245: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

References

��� Adobe Systems Incorporated �PostScript Language Reference Manual Second Edition�Addison�Wesley ISBN� ���������� ������

��� Y Amemiya T Matsushita A Nakagawa Y Satow J Miyahara and J Chikawa Nucl�Inst� Methods A��� �� � � ������

��� P R Bevington and D K Robinson �Data Reduction and Error Analysis for the PhysicalSciences� �Second Edition� McGraw�Hill� Inc ISBN ���������� ������

��� I Fujii Y Morimoto Y Higuchi N Yasoka C Katayama and K Miki �Evaluation of Xray Di�raction Data for Protein Crystals by Use of an Imaging Plate� Acta Cryst� B�������� ������

� � P E Gill W Murray and M H Wright �Practical Optimization� Academic Press ISBN�������� �� ������

��� C J Hall R A Lewis B Parker and T Worgan ��D detectors for synchrotron Xraysources some comparative tests� Nucl� Instr� Meth� A��� �� ��� ������

��� A P Hammersley and C Riekel �MFIT� Multiple Spectra Fitting Program� Syn� Rad�News � ���� ������

��� A P Hammersley S O Svensson and A Thompson �Calibration and correction of spatialdistortions in �D detector systems� Nucl� Instr� Meth� A��� ������ ������

��� A P Hammersley S O Svensson and A Thompson H Graafsma A Kvick and J P Moy�Calibration and correction of distortions in �D detector systems� Rev� Sci� Instr� �SRI��� �� �������� ���� �

���� A P Hammersley S O Svensson M Han�and A N Fitch and D H&ausermann �TwoDimensional Detector Software� From Real Detector to Idealised Image or TwoThetaScan� High Pressure Research �� �� ��� ����

���� A P Hammersley A Thompson S O Svensson K Brown L Claustre A Freund A Gonzalez S McSweeney and JP Moy ESRF Internal Report ESRF��HA��T �Resultsand Conclusions from Beamline �� Calibration and Test Experiments of the ESRF XRayImage Intensi�er� CCD Detector �OctoberDecember ������ ���� �

���� A P Hammersley K Brown W Burmeister L Claustre A Gonzalez S McSweeneyE Mitchell JP Moy S O Svensson A Thompson �Monochromatic Protein Crystallography Data Collection Using an Xray Image Intensi�er� CCD Detector� J� Syn� Rad� ����� ������

���� Hammersley A� P� and Antoniadis A� ������� �Reducing Bias in the Analysis of countingstatistics data� Nucl� Instr� Meth� A��� ������

���� A P Hammersley ESRF Internal Report ESRF��HA��T �FIT�D� An Introductionand Overview� ������

�� � A C Larson and R B Von Dreele �General Structure Analysis System �GSAS� Manual�LANSCE� MSH��� Los Alamos National Laboratory Los Alamos NM �� � ������

Page 246: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

���� R Kahn and R Fourme �Macromolecular Crystallography with Synchrotron Radiation�Photographic Data Collection and Polarization Correction� J� Apl� Cryst� �� ������������

���� P E Kinahan and J S Karp Nucl� Inst� Met� A��� ������ ������

���� G F Knoll �Radiation Detection and Measurement� John Wiley and Sons ISBN� ������ � X � ��� ������

���� Leslie Lamport �A Document Preparation System LATEX User�s Guide and ReferenceManual� Second Edition AddisonWesley Publishing Company ISBN ���� ����� ����

���� A Messerschmidt and J W P�ugrath �Crystal Orientation and Xray Pattern PredictionRoutines for AreaDetector Di�ractometer Systems in Macromolecular Crystallography�J� Appl� Cryst� �� ����� ������

���� J P Moy �A ��� mm input �eld �� keV detector based on an Xray image intensi�erand CCD camera� Nucl� Instr� Meth� A��� ������ ������

���� J P Moy and S Gibney SPIE ���� �Photoelectric Detection and Imaging ����� ����������

���� JP Moy A P Hammersley S O Svensson A Thompson K Brown L Claustre A Gonzalezand S McSweeney �A Novel Technique for Accurate Intensity Calibration of Area XrayDetectors at Almost Arbitrary Energy� J Syn Rad � � ������

���� A D Murry and A Fitch Powder Di�raction Program Library �PDPL� University CollegeLondon UK

�� � F N$e D Gazeau J Lambard P Lesieur T Zemb and A Gabriel �Characterization ofan ImagePlate Detector used for Quantitative SmallAngleScattering Studies� J� Appl�Cryst� �� ������ ������

���� Z Otwinowski �Oscillation Data Reduction Program� in Proceeding of the CCP StudyWeekend �Data Collection and Processing�� � ��� January � �� Compiled by L Sawyer�N Isaacs� and S Bailey� SERC Daresbury Laboratory� England ��� ������

���� R O Piltz M I McMahon J Crain P D Hatton R J Nelmes R J Cernik and G BushwellWye �An imaging plate system for highpressure powder di�raction� The data processingside� Rev� Sci� Instr� �� ������ ������

���� Keith Reckdahl �Using EPS Graphics in LATEX �� Documents� Version ��� Availableas epslatex�ps from ftp���ftp�tex�ac�uk�texarchive�info� directory and other CTAN sites����

���� C C Shaw J M Herron and D Gur �Signal fading erasure and rescan in storage phosphorimaging� SPIE ���� � ���� ������

���� M Stanton W C Philips Y� Li and K� Kalata �Correcting Spatial Distortions and Nonuniform Response in Area Detectors� J� Appl� Cryst� �� �� � ������

���� S O Svensson A P Hammersley A Thompson Gonzalez A and T Ursby �Measurementsand corrections of spatial distortions in imaging plate systems� CCP�EPS�EACBMNewsletter �� ������

Page 247: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

���� M W Tate E F Eikenberry S L Barna M E Wall J L Lowrance and S M Gruner �ALarge Format High Resolution Area Xray Detector Based on a Directly Coupled CCD�J� Appl� Cryst� �In press �����

���� R H Templer �Measurements on some characteristics of BaFBr�Eu� relevant to its useas a storage phosphor for Xray di�raction imaging� Nucl� Instr� Meth� A��� � ����������

���� D J Thomas �Calibrating an areadetector di�ractometer� imaging geometry�Proc� R� Soc� Lond� A ��� ������ ������

�� � D J Thomas �Calibrating an areadetector di�ractometer� integral response�Proc� R� Soc� Lond� A ��� ������ ������

���� T J Wess A P Hammersley L Wess and A Miller �Molecular Packing of Type � Collagenin Tendon� J� Mol� Biol� ��� � ��� ������

Page 248: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Appendix A� FIT�D Availability

�Appendix A may be photocopied and freely distributed separately from the rest of the manual��

���� Program Description

FIT�D is a �D data analysis program specialising in model �tting� FIT�D is a programwhich allows di�cult data analysis problems to be tackled using �D dimensional �tting of userspeci�ed models� To enable model �tting to be performed on a wide variety of input datamany other more basic data analysis operations are also available� Calibration and correctionof detector distortion has become an important part of FIT�D�

FIT�D is still under development but already a wide range of basic data analysis operationsand a number of more sophisticated methods are available� Normal graphics display methodsare available�

���� Availability

FIT�D is freely available to the academic community and to all ESRF users in return for thenormal considerations e�g�

�� Work using these programs should acknowledge accordingly and in the case of publications suitable citations should be made� �Having ones name occasionally added to theend of a list of authors is clearly not to be discouraged��

�� There is no warranty that the code and�or methods are correct� �Users should alwaysbe very suspicious of any program including FIT�D� You should always try testing codewith examples which you �think you� know what results should be given��

�� Generally source code will not be willingly circulated be in some circumstances it willneed to be� Users are not allowed to modify code �remove names and add their own�� Inthe case of bug �xes these MUST �for the good of everyone� be send back to me� �Paralleldiverging versions need to be avoided��

�� Comments and other feedback are most welcome but no guarantee can be given of thepossibility to add particular features to the programs� I�ll just have to see what I can andcan�t do� Clearly small changes are much more likely to be incorporated than featureswhich do not fall within the design of the programs�

Nonacademic companies will need to make special arrangements�

Page 249: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

���� Operating Systems and Computer Languages

FIT�D was originally developed on a VAX running VMS but was later been ported Sun andHP versions of Unix�� and now runs equally on all common versions of Unix �DecOSF��DecUnix DecUltrix HPUX� HPUX�� IBM AIX� Linux Silicon Graphics IRIX �� SiliconGraphics IRIX��� SunOS� SunOS ���Solaris��

The vast majority of the code is written in Fortran�� �plus the MILSTD�� � extensions�and is highly portable from one system to another� �As its written in Fortran the frequency ofbugs is smaller than a correspondingly sized �C� program as pointers are much less necessaryand runtime array bound checking allows most of the worst bugs to be trapped before theydo any harm�� A small amount of code is written in ANSIC for interfacing to certain POSIXsystem calls and the X�� library�

FIT�D is not in any sense Unix dependent �as a good program should not be operatingsystem dependent� however they are to a limited extent POSIX ������ dependent �POSIX������ being an international standard�� As such running the programs on any system whichis POSIX compliant should not be a problem� An OpenVMS version would be possible but sofar there has not been su�cient interest� A port to Windows NT will start soon but this is amore involved task since whilst POSIX ������ is supported the X�� graphics library is notso a graphics driver will need to be written for OpenGL�

��� Documentation

An introductory guide� �FIT�D� An Intorduction and Overview� is available as a ReferenceManual which covers in detail use of FIT�D� The reference manual is presently � ��� pageslong and contains an extensive index� Users are not expected to read the manual completelybut to use it as a reference using the index to �nd information on the necessary commandsneeds to perform a particular task� �The programs are hopefully selfevident and contain muchonline help information but for more detailed explanation the reference manual will need tobe consulted occasionally��

A number of articles are available which cover in more detail the algorithms and methodsemployed within the program�

� A P Hammersley and C Riekel �MFIT� Multiple Spectra Fitting Program� Syn� Rad�News � ���� ������

� S O Svensson A P Hammersley A Thompson A Gonzalez and T Ursby �Measurementsand corrections of spatial distortions in imaging plate systems� CCP�EPS�EACBMNewsletter �� ������

� A P Hammersley S O Svensson and A Thompson �Calibration and correction of spatialdistortions in �D detector systems� Nucl� Instr� Meth� Section A ��� pp������ ������

��Thanks are due to the �Free Software Foundation� �FSF�GNU�� without whom a sensible working envi�ronment would not have been possible�

Page 250: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

� A P Hammersley S O Svensson A Thompson H Graafsma A Kvick and J P Moy�Calibration and correction of distortions in �D detector systems� Rev� Sci� Instr��SRI��� �� �������� ���� �

� A P Hammersley S O Svensson M Han�and A N Fitch and D H&ausermann �TwoDimensional Detector Software� From Real Detector to Idealised Image or TwoThetaScan� High Pressure Research �� �� ��� ������

� JP Moy A P Hammersley S O Svensson A Thompson K Brown L Claustre A Gonzalez and S McSweeney �A Novel Technique for Accurate Intensity Calibration of AreaXray Detectors at Almost Arbitrary Energy� J Syn Rad � � ������

� A P Hammersley K Brown W Burmeister L Claustre A Gonzalez S McSweeneyE Mitchell JP Moy S O Svensson A Thompson �Monochromatic Protein Crystallography Data Collection Using an Xray Image Intensi�er� CCD Detector� J� Syn� Rad�� ���� ������

���� Further Questions

This text has been written in order to provide a �rst general response to the majority of questions concerning FIT�D� If having read this document you have further �or still unanswered�questions please feel free to contact me again�

Page 251: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

�� Appendix B� FIT�D Macro Language

Macros can be de�ned within the GUI MACROS � LOG FILE interface of within the�KEYBOARD� interface using the START MACRO and STOP MACRO commands� However amacro de�ned in one cannot be used from the the other� A previously de�ned �KEYBOARD�macro can be run using the RUN MACRO or MACRO commands� A previously de�ned GUI macrocan be run using the GUI RUN MACRO command�

Once de�ned appropriately a �KEYBOARD� macro can be run on a whole sequence of �lesusing the SEQUENCE command �See Section � ��� Page ����� A GUI macro can similarly berun on a �le series by using the RUN SEQUENCE command�

Whilst de�ning a macro it is possible to call another macro� The contents of the old macroare included within the new macro� By previously de�ning variables and using them withinmacros macros can be �parameterised� in a primitive manner� Great care must be taken withinmacros with commands which can change their input demands e�g� PRINT GRAPHICS may ormay not prompt for the name of an output �le depending on whether or not an output �le isalready open���

The macro �les are ASCII �les so it is possible to modify the macros but great care is necessary�

�At present FIT�D is under development and modi�cations to the user interface are likelyowing to user suggestions� If new user inputs are demanded old macro �les may need to bemodi�ed� Contact a member of the Experiments Division Programming Group if you encounterproblems��

���� Variables

Macros may be made much more �exible through the use of �variables�� Internal programvariables may be de�ned using the DEFINE VARIABLE �see Section � ��� Page ����� andthe VARIABLE commands� Variables are also automatically de�ned by certain commands e�g�STATISTICS� Variables can be removed by using the UN�DEFINE VARIABLE command �see Section � ���� Page �����

This is similar to the Unix alias command or the VMS DEFINE or ASSIGN commands� A�token� can be de�ned as a variable and given a value� Once de�ned whenever the variable�

is encountered it will be substituted by its value���

This is very powerful but also very dangerous and potentially very confusing� Users arerecommended to only use unlikely character strings for variables e�g� Start every variable witha hash sign �"� but do not create variables starting with double hash marks �""� as these arereserved for program generated variables� These may be used inside suitably de�ned macrosbut should not be de�ned by the user�

��END GRAPHICS FILE may be used to make sure that the �le is closed

�The variable must be separated from other characters by one or more spaces� a comma� or a �Tab����Before Version ��� variables only work for character input e�g� �le names and commands� at Version ���

treatment of variables for all input� including integer and real constants was added�

Page 252: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

Certain commands which produce scalar results also de�ne program variables so that the valuesmay be used interactively and in macros� All such variables start with a double hash sign�""� e�g� the command statistics produces the following variables ��MINIMUM� ��MAXIMUM�

��MEAN� ��TOTAL� ��RMS� ��SIGMA� ��SKEWNESS corresponding to the information outputon the screen� By entering the variable as a response to a prompt the program will automaticallytake the �value� of the variable� e�g� The following example will divide each pixel in the ADRby the mean value �assuming ��MEAN has already been de�ned��

Main menu ENTER COMMAND �INPUT DATA� cdivid

DIVISION CONSTANT ���� ��MEAN

This allows much more �exible macros to be written�

Rede�ning an existing variable will overwrite its previous value�

A list of the currently de�ned program variables and their corresponding values �translations�can be obtained with the LIST VARIABLES command�

The creation and usage of simple �KEYBOARD� macros is covered in Section �� Page �� �Creation and usage of simple GUI macros is covered in Section � Page ���

���� More Complicated Macros

More complicated and powerful macros can be produced� Probably the best manner in whichto produce such macros is to produce a normal macro by carrying out the series of dataanalysis operations once and then editting the macro �le to add for example a loop to repeatthe operation for a whole series of �les�

�Do� loops may be added to the macro to allow counted looping controlled by integer variables�This is best illustrated with an example� The following macro will input and display a seriesof �les FILE ���DAT� FILE ��DAT� to FILE ���DAT in binary format�

#�!" BEGINNING OF EXPG�IO MACRO FILE

#�!"

#�!" This is a comment line

#�!"

DO �COUNT � �� �� �

IC

�COUNT

no

�CVALUE

CONCATENATION

FILE��

�CVALUE

�CVALUE

CONCATENATION

Page 253: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

�CVALUE

�DAT

�CVALUE

INPUT DATA

BINARY �UNFORMATTED�

�CVALUE

���

��

INTEGER ��BYTE�

yes

no

PLOT DATA

END DO

#�!" END OF EXPG�IO MACRO FILE

The looping is controlled by the DO loop which works like the Fortran�� Do loop� The loopvariable in this case �COUNT starting with the �rst value and will be incremented up until thesecond value in steps de�ned by the third value� The loop ends when the END DO statement isfound� Here the commands within the loop have been indented with the exception of an inputstring where we don�t want any preceeding blanks�

To form the �le name the commands IC and CONCATENATE have been used� IC convertsthe loop integer counter to a character string with a �xed number of characters so zeros willpreceed low numbers� CONCATENATE is used to build up the �le names from a �xed pre�x thechanging numerical part and the �xed �le exetension� The variable �CVALUE is set with the�le name and used within the INPUT command�

Macros can be made interactive and given a �Graphical User Interface� using the QUESTIONcommand� Thus the simple example above can be made much more sophisticated and versatileby getting the user to click on the �rst and last �le in a �le series and by using the DEDUCEFILE SEQUENCE command to de�ne values of variables which de�ne the loop and the parts ofthe �le name� The following example shows such a macro�

#�!" BEGINNING OF EXPG�IO MACRO FILE

#�!"

#�!" fitd�display�mac Inputs a series of images and displays together

#�!"

QUESTION

#�!"

#�!" Definition of interactive input of a value

#�!" Data value type

INPUT FILE

#�!" User prompt

CLICK ON FIRST FILE OF SEQUENCE

#�!" Give default

y

n

#�!" Help text �up to � lines�

This is the first file in a sequence

Page 254: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

of files to be displayed�

""

#�!" Program variable

�START�FILE

#�!"

#�!" End of Definition

#�!"

QUESTION

#�!"

#�!" Definition of interactive input of a value

#�!" Data value type

INPUT FILE

#�!" User prompt

CLICK ON LAST FILE OF SEQUENCE

#�!" Give default

y

y

#�!" Default value

G����bsl

#�!" Help text �up to � lines�

Click on last file in sequence to be

treated�

""

#�!" Program variable

�END�FILE

MESSAGE

FILE SEQUENCE DEFINED

""

#�!"

#�!" End of Definition

#�!"

DEDUCE FILE SEQUENCE

�START�FILE

�END�FILE

#�!"

#�!" Loop through files� input and display them

#�!"

DO �COUNT � ��START� ��END� �

#�!"

#�!" Form current file name

#�!"

#�!"

IC

�COUNT

��VARIABLE

��NUM�CHARS

�SCOUNT

CONCAT

��PREFIX

Page 255: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

�SCOUNT

�FILE�IN

CONCAT

�FILE�IN

��POSTFIX

�FILE�IN

CONCAT

�FILE�IN

��EXTENSION

�FILE�IN

#�!"

#�!" Input image

#�!"

INPUT DATA

BINARY

�FILE�IN

���

��

INTEGER ��BYTE�

YES

NO

#�!" Display image

PLOT

END DO

#�!" END OF EXPG�IO MACRO FILE

Here ��START� ��END� ��VARIABLE� ��NUM CHARS are variables which have been de�ned automatically by the command DEDUCE FILE SEQUENCE� see Section � �� Page ���� It maybe noticed that the MESSAGE command has been used to provide some user feedback on theprogress of the macro� Note� The step of �� has been left in the macro as the �les exist onlyin step of ���

The above example can be made even more �exible with further user input with the QUESTIONcommand �see Section � ��� Page � �� e�g� to de�ne the size of the image to input�

���� �KEYBOARD� Interface Commands for Macros

There are a number of �KEYBOARD� commands which are especially useful within macros tohelp make them versatile and easy to use� Here is list of the commands and their purpose�

CALCULATOR� The CALCULATOR menu can be used to preform mathematical operations or variable values and set new variable values with the VARIABLE command�

CONCATENATION� Concatenate two input strings e�g� stored in two variables and save in anamed variable�

DEDUCE FILE SEQUENCE� Deduce components of �le sequence and de�ne standard internalvariables with the components�

Page 256: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

IC� Convert integer to character representation with control on the number of charactersused

LIST VARIABLES� Outputs a table of currently de�ned variables and values� This is very usefulfor debugging a macro�

MESSAGE� De�ne text message for output to the user during a macro�

PAUSE� Wait for user return� This is a method of getting FIT�D to pause during a macro��Useful for debugging and demostrations��

QUESTION� Ask an interactive question during a macro� This is a very powerful command andallows many di�erent types of input to be de�ned with default values help text andrange checking�

SLEEP� Pause for a de�ned number of seconds� �Useful for slowing down FIT�D for demonstrations��

VARIABLE� De�ne a variable and its corresponding value�

UN�DEFINE VARIABLE� Remove variable from the variable translation table�

WAIT� Wait for a user return �same as PAUSE��

Of course many other commands are also very useful but these are the ones especially concernedwith macros�

In addition to the main menu commands a few very special instructions may be added to themacro at any point�

DO� Start of a counted loop� See above for further information�

END DO� End of a counted loop�

#SLEEP� Special pause which may be placed anywhere within the macro unlike the SLEEP

command which only works in the main menu of the �KEYBOARD� interface� The#SLEEP instruction is followed by the number of seconds to pause� e�g� #SLEEP � willpause for � seconds� A fraction of a second may be speci�ed but this will only work oncertain versions of Unix�

��� A Macro Example

The example shows how variables and macros may be de�ned to allow a sequence of operationsto be de�ned for one �le and easily adapted to apply to other �les� The example shows howregions of input �les may be de�ned and corrected for spatial distortion provided of course thatthe spatial distortion has been previously de�ned �See Section �� Page ����� This exampleshould be easy to modify for other sequences of operations which need to be repeated�

Two variables are de�ned �IN for the input �le and �OUT for the output �le to contain thecorrected image� The START MACRO command is used to open a macro and within the macro

Page 257: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

the variables �IN and �OUT are used instead of the real �les names� The STOP MACRO commandcloses the macro� Prior to using the macro the variables are rede�ned to di�erent �le names��The text has been created by FIT�D using the OPEN LOG command to create a listing ofterminal I�O see Section � ��� Page �� ��First the variables for the input and output �les are de�ned�

Main menu ENTER COMMAND �VARIABLE� variable

ENTER VARIABLE NAME ��IN� �IN

ENTER VARIABLE VALUE �test�dat� lyso��gel

Main menu ENTER COMMAND �INPUT DATA� variable

ENTER VARIABLE NAME ��IN� �OUT

ENTER VARIABLE VALUE �lyso��gel� lyso��cor

Now the macro is created using the variables rather than the direct �le names�

Main menu ENTER COMMAND �INPUT DATA� start macro

FILE NAME �fitd�mac� lyso�mac

Main menu ENTER COMMAND �SET CURVE STYLES� input

FILE FORMAT �IMAGEQUANT� imagequant

DATA FILE NAME �test�dat� �IN

LEFT�HAND PIXEL OF IMAGE REGION ���

LOWER PIXEL OF IMAGE REGION ���

RIGHT�HAND PIXEL OF IMAGE REGION �Range � to ���� �����

UPPER PIXEL OF IMAGE REGION �Range � to ���� �����

INFO Full image size � ��� ! ��� pixels

Main menu ENTER COMMAND �IMAGE� reg

X�MINIMUM VALUE �Range � to ����� ���� �

Y�MINIMUM VALUE �Range � to ����� ���� �

X�MAXIMUM VALUE �Range �� to ����� �������� ��

Y�MAXIMUM VALUE �Range �� to ����� �������� ���

Main menu ENTER COMMAND �IMAGE� calibrat

Calibration sub�menu ENTER COMMAND �SPATIAL CORRECTION� input

Name of file for spatial distortion interpolation function

FILE NAME �����spline� ����spline

Calibration sub�menu ENTER COMMAND �SPATIAL CORRECTION�

INFO The corrected pixel dimension in X is ������� microns

INFO The corrected pixel dimension in Y is �������� microns

INFO Number of rows re�binned � � � �#�

�Here some program information output has been missed out��

INFO Number of rows re�binned � �� � ��#�

INFO Time for re�binning � ����� seconds

Calibration sub�menu ENTER COMMAND �EXIT�

DESTROY DYNAMIC ARRAYS �NO�

Main menu ENTER COMMAND �EXCHANGE�

Main menu ENTER COMMAND �IMAGE� out

Page 258: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

FILE FORMAT �FITD STANDARD FORMAT� dump

DUMP FILE NAME �fitd�dump� �OUT

INFO Data region is ��� ! ��� pixels

RECORD LENGTH �BYTES� �Range � to �� ����

FIRST RECORD FOR OUTPUT �Range � to �� ���

BIG ENDIAN FORMAT INTEGERS �NO� y

INFO Data minimum value � �E�

INFO Data maximum value � �������E��

LOWER LIMIT OF RANGE �Range ����E��� to �����E��� ���

UPPER LIMIT OF RANGE �Range � to ���E���� ������E���

Main menu ENTER COMMAND �INPUT DATA� stop

The �rst image has been input corrected and output� In doing this we have saved the enteredoperations as a macro� Now the variables can be rede�ned to refer to new input and output�les�

Main menu ENTER COMMAND �EXIT� variable

ENTER VARIABLE NAME ��OUT�

ENTER DATA TYPE OF VARIABLE string

ENTER VARIABLE VALUE �lyso��cor� lyso�cor

Main menu ENTER COMMAND �INPUT DATA� varia

ENTER VARIABLE NAME ��OUT� �IN

ENTER DATA TYPE OF VARIABLE s

ENTER VARIABLE VALUE �lyso�cor� lyso�gel

Now the command macro is used to run the previously created macro �le� The same variablesare used but now they refer to di�erent �les�

Main menu ENTER COMMAND �INPUT DATA� macro

FILE NAME �lyso�mac� lyso�mac

Main menu ENTER COMMAND �IMAGE� INPUT DATA

FILE FORMAT �IMAGEQUANT� IMAGEQUANT

DATA FILE NAME �grid��gel� �IN

LEFT�HAND PIXEL OF IMAGE REGION ���

LOWER PIXEL OF IMAGE REGION ���

RIGHT�HAND PIXEL OF IMAGE REGION �Range � to ���� �����

UPPER PIXEL OF IMAGE REGION �Range � to ���� �����

INFO Full image size � ��� ! ��� pixels

Main menu ENTER COMMAND �IMAGE� REGION

X�MINIMUM VALUE �Range � to ����� ���� ��E��

Y�MINIMUM VALUE �Range � to ����� ���� ��E��

X�MAXIMUM VALUE �Range �� to ����� �������� ���E��

Y�MAXIMUM VALUE �Range �� to ����� �������� ����E��

Main menu ENTER COMMAND �IMAGE� CALIBRATION

Calibration sub�menu ENTER COMMAND �SPATIAL CORRECTION� INPUT SPATIAL

Name of file for spatial distortion interpolation function

FILE NAME �����spline� ����spline

Page 259: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

� �

Calibration sub�menu ENTER COMMAND �SPATIAL CORRECTION� SPATIAL CORR

INFO The corrected pixel dimension in X is ������� microns

INFO The corrected pixel dimension in Y is �������� microns

INFO Number of rows re�binned � � � �#�

�Here some program information output has been missed out��

INFO Number of rows re�binned � �� � ��#�

INFO Time for re�binning � ���� seconds

Calibration sub�menu ENTER COMMAND �EXIT� EXIT

DESTROY DYNAMIC ARRAYS �NO� NO

Main menu ENTER COMMAND �EXCHANGE� EXCHANGE

Main menu ENTER COMMAND �IMAGE� OUTPUT DATA

FILE FORMAT �FITD STANDARD FORMAT� DUMP

DUMP FILE NAME �fitd�dump� �OUT

INFO Data region is ��� ! ��� pixels

RECORD LENGTH �BYTES� �Range � to �� ����

FIRST RECORD FOR OUTPUT �Range � to �� ���

BIG ENDIAN FORMAT INTEGERS �NO� YES

INFO Data minimum value � �E�

INFO Data maximum value � �����E��

LOWER LIMIT OF RANGE �Range ����E��� to ����E��� ���

UPPER LIMIT OF RANGE �Range � to ���E���� �����E���

���� Command Files �Scripts� for Batch Mode Processing

Note� The SEQUENCE command now allows a macro �le to be run automatically on a sequenceof input and output �les with much control over the names of the input and output �les� Formost purposes this will be much easier to use than operating system command �les or scripts�See Section � ��� Page ����� However under special circumstances the use of a command �leor script may allow �exibility which is di�cult to achieve with the SEQUENCE command�

The ability to de�ne variable names and values on the operating system command line allows�exible control over processing sequences of �les through the use of a Unix �script� i�e� anoperating system command �le which automatically de�nes calls to FIT�D with di�erentvariable values

The Unix �C�shell is designed for operating system programming using a language similarto the �C� programming language� Thus loops and conditional branches are available� Thefollowing is an example of a �C�shell script written by Thomas Ursby �ESRF Di�ractionGroup� which automatically processes all �les in a directory ending with the same extension�

The following is a genuine example produced by Thomas Ursby including FIT�D macro �lesand Unix script �les allowing �exible and easy correction of spatial distortion� These �lesshow how FIT�D macros together with Unix scripts may be used in a very �exible manner�However clearly this example is only valid for a particular directory structure and users mustunderstand how to edit the �le names and programming structures for their own needs� Users

Page 260: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

who are unsure of �C�shell programming should consult a specialist or a programming guideor reference book�

�Very minor changes have been made to these �les simply for display purposes��

���� Explanation of Files

fitd�batch corrects all images with a certain extension in a directory�

What I finally used were

scorr�batch which reads a file in which the first row contains the name

of the spline�file� the second row the name of the directory where to

put the corrected images and then one file name per row�

gen�files would generate this file if one would prefer not to do it

manually�

scorr�imagequant�mac� etc are the FitD macros� I guess it would work

with one macro giving in�file�type as a variable on the command line�

Thomas

����������

���� fitd�batch

���usr�local�bin�tcsh �f

set datapath � �users�a�ursby�test�

set splinefile � &datapath'sbgrid��spline

set macroname � �users�a�ursby�etc�scorr�mac

foreach i � &datapath'!�spe�

fitd �dim��x��� �svar"�file�in� i �svar"�file�out� &i r'�scorr "

�svar"�file�spline� splinefile �mac &macroname'

end

���� scorr�batch

���usr�local�bin�tcsh �f

� NAME scorr�batch

� DESCRIPTION

� Script for running FitD in batch mode correcting images

Page 261: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

� for spatial distortion �or whatever the macro named below

� does��� The corrected images end up in a specified directory

� with the extension changed to ��scorr��

� CALLING SEQUENCE

� scorr�batch ��type� � files�txt � scorr�log

� where

� ��type� is one of

� �pr for Princeton CCD camera

� �ph for Photometrics CCD camera

� �md�� for Molecular Dynamics ��um scan �x�cm plates�

� �md��� for Molecular Dynamics ���um scan �x�cm plates�

� If not given then ��md���� is taken as default�

� files�txt is a file containing �one line per parameter�

� �name of file containing the spline function�

� �name of output directory�

� �name of first file to be corrected�

� �name of second file to be corrected�

� etc

� scorr�log is the name of the file where you want the

� output text to be stored�

����

� COMMENTS

� The �files�txt� can be generated by

� ls �� grid�spline � files�txt

� echo output�directory �� files�txt

� ls �� !�spe �� files�txt

� in the case of a spline function file called �grid�spline�

� and if we want to correct all the images that have the file name

� extension ��spe� in the current directory �images from the

� Princeton CCD camera� and put the corrected images in

� �output�directory��

� Or use �gen�files�

� NOTE The file�names can be preceded by their path�

� T�Ursby ������

� To avoid opening of graphics window

unsetenv DISPLAY

switch � ��

Page 262: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

case �pr

set xdim � ��

set ydim � ���

set macroname � �users�a�ursby�etc�scorr�princeton�mac

breaksw

case �ph

set xdim � ��

set ydim � ��

set macroname � �users�a�ursby�etc�scorr�photometrics�mac

breaksw

case �md��

set xdim � ��

set ydim � ���

set macroname � �users�a�ursby�etc�scorr�imagequant�mac

breaksw

case �md���

set xdim � ���

set ydim � ���

set macroname � �users�a�ursby�etc�scorr�imagequant�mac

breaksw

default

set xdim � ���

set ydim � ���

set macroname � �users�a�ursby�etc�scorr�imagequant�mac

breaksw

endsw

� Read from input file

set splinefile � �

set outdir � �

� Temporary file

set tmp�file � �logname��

set i� �

echo i � �tmp� tmp�file

� Loop for each image �given in the input file�

while � i �� ���

set base � �basename i�

echo �!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!�

echo �Image � base

echo

� Run fitd for one image

fitd �dim &xdim'x &ydim' �svar"�file�in� i "

�svar"�file�out� &outdir'� &base r'�scorr "

�svar"�file�spline� splinefile �mac &macroname'

set i� �

echo i �� �tmp� tmp�file

end

Page 263: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

� Make list at end of the log�file of the corrected images

echo �!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!�

echo �Corrected images �

echo ��Spline file � splinefile ���

cat �tmp� tmp�file

echo �The corrected images were put in the directory �

echo outdir

echo �!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!�

� Clean up

�bin�rm �tmp� tmp�file

����������

���� gen files

���bin�csh �f

� NAME gen�files

� DESCRIPTION

� Generate input file to scorr�batch�

� CALLING SEQUENCE

� gen�files �grid�file� �base� �image�extension� �output�directory�

� where

� �grid�file� is the name of the grid file�

� �base� is the path name �if present� and the beginning of the

� names of the image files to be listed in the output file�

� �image�extension� is the file extension of the files to be

� listed in the output file�

� �output�directory� is the directory where the corrected images

� are to be put�

���

� COMMENTS

� See scorr�batch�

� T�Ursby ������

echo �

echo �

ls �� &'!� �

Page 264: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

���� scorr imagequant�mac

#�!" BEGINNING OF EXPG�IO MACRO FILE

#�!"

#�!" This is a comment line

#�!"

INPUT DATA

IMAGEQUANT

�file�in

CALIBRATION

INPUT SPATIAL FUNCTION

�file�spline

SPATIAL CORRECTION

EXIT

NO

EXCHANGE

OUTPUT DATA

DUMP

�file�out

YES

EXIT

YES

#�!" END OF EXPG�IO MACRO FILE

���� scorr princeton�mac

#�!" BEGINNING OF EXPG�IO MACRO FILE

#�!"

#�!" This is a comment line

#�!"

INPUT DATA

PRINCETON CCD FORMAT

�file�in

CALIBRATION

INPUT SPATIAL FUNCTION

�file�spline

SPATIAL CORRECTION

EXIT

NO

EXCHANGE

OUTPUT DATA

DUMP

Page 265: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

�file�out

YES

EXIT

YES

#�!" END OF EXPG�IO MACRO FILE

���� scorr photometrics�mac

#�!" BEGINNING OF EXPG�IO MACRO FILE

#�!"

#�!" This is a comment line

#�!"

INPUT DATA

PHOTOMETRICS CCD FORMAT

�file�in

CALIBRATION

INPUT SPATIAL FUNCTION

�file�spline

SPATIAL CORRECTION

EXIT

NO

EXCHANGE

OUTPUT DATA

BINARY

�file�out

YES

EXIT

YES

#�!" END OF EXPG�IO MACRO FILE

Page 266: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Appendix C� Menu Commands and Short Descrip

tion

���� Main Menu Commands

List of available commands and functions

ADD Add active data region of memory to current data

ANNOTATION LABEL De�ne annotation labels for graphics

BLUR Blur data by a top hat convolution

BRAGGS� EQUATION Variety of uses of Braggs equation

CADD Add constant to active data region

CALCULATOR Reverse Polish Notation calculator

CALIBRATION Calculate or apply calibration functions

CDIVIDE Divide by a constant value the active data region

CLEAR DATA Set data region �and variances� to zero

CLOSE LOG Close log �le

CMULTIPLY Multiply active data region by a constant

COLOUR TABLE Choice of colour table and index range

CONTOUR PLOT Graphic display of active data region

CREATE DATA De�ne blank data region �for simulation�

CURVE STYLES Set attributes for curve representation

DEFINE VARIABLE De�ne variable and its corresponding value

DIFFRACTION PATTERN Predict part of di�raction pattern

DIMENSIONS Change dynamic array dimensions

DISPLAY LIMITS Set maximum number of displayable pixels

DIVIDE Divide ADR of current data by the memory

END GRAPHICS FILE Close previously opened PostScript �le

EXCHANGE Exchange current data with the memory contents

EXIT Exit from program

FAST IMAGE Fast output of an image to PostScript

FILTER Fourier Filtering of data with sharp cuto� �lter

Page 267: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

FIT Least squares �tting with Gaussian functions

FLIP Re�ect data through horizontal or vertical middle

FONT Select text font to be used for all Roman text

FUJI LINEARISATION Convert intensities to linear scale

FULL REGION Set active data region to full data region

GAUSSIAN Add �D Gaussian to data

GEOMETRY �EXPERIMENT� De�ne experimental geometry

GRID De�ne graphics grid requirements

HELP User help and information

IMAGE Interactive control of image display

INFORMATION Information on the internal state of FIT�D

INPUT DATA Input data from data �le

LINEARISE FILM Nonlinearity corrections to �lm data

LIST VARIABLES Table of currently de�ned variables and values

LOGARITHM Take logarithm base �� of all elements in ADR

MACRO Run previously saved macro de�nition �le

MEDIAN FILTER Filter by taking median value within window

MOVE�ROTATE Move and or rotate image output in memory

MULTIPLY Multiply ADR of memory to the current data

NORMALISE Normalise ADR� divide by maximum value within ADR

OFFSET�SCALE Calculate o�set and scale between two images

OPEN LOG Open log �le for record of input and output

OUTPUT DATA Output data to named data �le

PAGE POSITION Set position of data display region on page

PEEP Look at pixel coordinates and value

PIXEL REGION Change active data region using pixel limits

PLOT DATA Plot data as �D image �or XY graph if �D�

POISSONIAN NOISE Add Poissonian noise to data

POWER SPECTRUM Calculate power spectrum of ADR

PRINT GRAPHICS Output graphics to a �le for printing

Page 268: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

PUBLICATION QUALITY Set attributes for high quality output

QUIT Exit from program

RAISE TO A POWER Raise elements in ADR to speci�ed power

REBIN Rebin data output in memory

RECALL Recall data set from internal memory

REFLECT Re�ect data about input line output in memory

REGION Change active data region

ROI De�ned Region Of Interest �Active Data Region� �pixels�

ROTATE LUT Interactive rotation of the colour table

RUN MACRO Run previously saved macro de�nition �le

SELECT PIXEL OPERATION Operation on de�ned pixel value range

SEQUENCE Run macro for a sequence of �les �or not�

SET ANNOTATION STYLE Set style of annotation label text

SET ARROW STYLE Set style of an arrow� style colour etc�

SET AXES STYLE Set style of axes line width colour etc�

SET BACKGROUND STYLE De�ne background colour

SET COLOUR Set colour of graph lines text and markers

SET CURVE STYLES Set attributes for curve representation

SET ENUMERATION STYLE Set style for axis numbering

SET FONT Select text font to be used for all Roman text

SET GRID STYLE line type colour and width for grid

SET TICK POSITIONS Number interval of large tick marks

SMOOTH Tophat convolution smoothing of user input size

SPATIAL FILTERING Filtering in Spatial domain

START MACRO Save commands in macro de�nition �le

STATISTICS Calculate parameters of a region of the data

STOP MACRO Close previously opened macro de�nition �le

STORE Store present data set in internal memory

SUBTRACT Subtract active data region of memory from data

SURFACE INTERPOLATION User de�ned surface in memory

Page 269: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

SYMBOL Same as DEFINE VARIABLE

SYMMETRIC FUNCTION Add circularly symmetric function to data

TITLE Input new text for title

THRESHOLD Set minimum and�or maximum values in ADR

TRANSPOSE Transpose data arrays and variance arrays

UNDEFINE VARIABLE Remove variable from translation table

UNIT CELL PARAMETERS Convert between real and reciprocal

V�C Variances to current and vice versa �special command�

VARIABLE De�ne variable and its corresponding value

VARIANCES DEFINITION De�ne variances from current data

WEIGHTED AVERAGE data and memory weighted by variances

XAXIS LABEL Input new text for Xaxis label

YAXIS LABEL Input new text for Yaxis label

ZAXIS LABEL Input new text for Zaxis �intensity� label

�D INTERPOLATION Correct �D values by interpolation

�D SURFACE PLOT Graphics view of active data region

ZSCALE Image scaling mode automatic minimum�maximum

Page 270: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

���� CALIBRATION Sub�Menu Commands

List of available commands

CALCULATE FITTED DISTORTION output in memory �for X or Y�

DECAY CORRECTION Correct intensity decay �Molecular Dynamics�

DESTROY GRID PEAKS Set �found� peaks to missing peaks

DISPLAY DISTORTION Create �D image in memory and display

EXIT Exit �t submenu

FIND PEAKS Measure centres of grid mask peaks

FIT GRID PEAKS Fit interpolation function to distortion

FLATFIELD CORRECTION Correct for source distribution etc

HELP User help text

INPUT SPATIAL FUNCTION Recover from �le distortion

INVERSE DISTORTED�IDEAL de�nition of distortion mapping

LEARN HOLE PROFILE Average subpixel hole pro�le

LINEARISE INTENSITIES Correct intensities for nonlinearity

OUTPUT SPATIAL FUNCTION Save current distortion function

PLATYPUS CORRECTION FILE Create PLATYPUS calibration �le

QUIT Exit �t submenu

RECALCULATE DISTORTION More user choice on distortion

RESIDUALS OF FIT Fit minus measured distortion �in memory�

SAVE PEAKS Output peak position to ASCII �le

SIZE �IMAGE DISPLAY� Change region size for �FIND PEAKS�

SPATIAL CORRECTION Apply spatial correction function

TRANSFER DISTORTION Save distortion values in memory

VIEW PEAKS Examine peak positions and distortions

XRII FLATFIELD Theoretical �at�eld correction

Page 271: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

���� FIT Sub�Menu Commands

CHANGE SCALE Change the typical parameter variation sizes

CLEAR MASK Eliminate all maskedo� �bad� data points

CONSTRAIN Set constraints change parameters values

COVARIANCE Output covariance matrix

DEFINE MASK Masko� �bad� data prior to �tting

DISPLAY MASK Display maskedo� data as a two level image

EXIT Exit �t submenu

INPUT PARAMETERS Initialisation of �t model

MASK STATISTICS Statistics of mask

MINIMISE Search for better �t by maximum descent method

MODEL Create �t model �in memory� from current parameter values

NORMALISATION Unidirectional �at�eld normalisation

OUTPUT PARAMETERS Output �t parameters to a �le

POWDER DIFFRACTION Fit beam centre and tilt to powder ring

QUIT Exit �t submenu

R�THETA REBINNING Radial�Angular �polar� rebinning of ADR

RADIAL PROFILE Calculate �D radial pro�le in memory

RESULTS View results of �tting

SET MASK COLOUR User choice of colour to draw masked pixels

SET UP Alter �t control parameters

SURFACE POLYNOMIAL Fit data using �D Chebyshev polynomial

THRESHOLD MASKING Mask elements depending on ADR data values

TILT�BEAM CENTRE Determine from a powder ring

TRANSFER MASK TO MEMORY Set masked elements to ��� in memory

Page 272: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Appendix D� Command Output and E�ects

It is sometimes di�cult to know where the output of a particular command is placed� in thecurrent data arrays or in the �memory� arrays� Internally FIT�D follows a simple logicbut externally it may be di�cult to know the e�ect of this logic� Where possible the outputis in the current data arrays� All operations which involve only single pixel by pixel operations are �inplace� e�g CADD� CMULTIPLY� LOGARITHM� FUJI LINEARISATION� RAISE TO A

POWER� Similarly all binary pixel by pixel operations produce output in the current data arrayse�g� ADD� SUBTRACT� DIVIDE� MULTIPLY� Operations which can swap pairs of pixels in a simple well de�ned manner e�g� TRANSPOSE� FLIP are also �inplace�� Operations which in generalcan involve several input pixels contributing to one or more output pixels use the �memory�for output e�g� SPATIAL FILTER� REBIN� REFLECT� MOVE�ROTATE�

Whilst hopefully the logic is clear it may still be di�cult to know where the output appearsas the programs internal needs may be unclear� Thus the following tables explain where theoutput appears� Additionally the �Memory� Required column explains which commandsneed the �memory� data to be de�ned before they can be used� The Current Data A�ectedand the �Memory� A�ected columns explain whether an operation overwrites the contentsof either of the sets of program arrays�

The following variables are used in the tables�

BOTH Output in a general sense is in both the current data array and the �memory� array

CURRENT Output in current data array the previous contents of the current data arrays areoverwritten the �memory� may be changed �see �Memory� A�ected entry�

FILE Output is in a named �le neither the current data nor the �memory� are a�ected

MEMORY Output in memory

NONE No output a�ecting either the current data arrays or the �memory� arrays howeverminor changes such as the data title and axis labels may take place

NONE��� NO��� Commands which presently have no output nor e�ect on neither set ofarrays as they are not presently implemented

�EXIT� Commands which may lead to the destruction of all program arrays through theexiting of the program� User con�rmation is demanded

�MACRO� Commands which run previously saved macros� The e�ect of such a macro dependson the contains of the macro

�MENU� Commands which enter a submenu which contains commands which produce avariety of di�erent e�ects� See submenu table for details of which commands a�ectwhich arrays and for position of output

Page 273: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Table �� Main Menu Commands and E�ects

Command �Memory� Output Current Data �Memory�Required Position A�ected A�ected

� NO NONE NO NOADD YES CURRENT YES NOANNOTATION LABEL NO NONE NO NOBLUR NO MEMORY NO YESBRAGGS� EQUATION NO NONE NO NOCADD NO CURRENT YES NOCALCULATOR NO NONE NO NOCALIBRATION �MENU� �MENU� �MENU� �MENU�CDIVIDE NO CURRENT YES NOCLEAR DATA NO CURRENT YES NOCLOSE LOG NO NONE NO NOCMULTIPLY NO CURRENT YES NOCOLOUR TABLE NO NONE NO NOCONTOUR PLOT NO NONE NO NOCREATE DATA NO CURRENT YES NOCURVE STYLES NO NONE NO NODEFINE VARIABLE NO NONE NO NODIFFRACTION PATTERN NO NONE NO NODIMENSIONS NO NONE YES YESDISPLAY LIMITS NO NONE NO NODIVIDE YES CURRENT YES NOEND GRAPHICS FILE NO NONE NO NOEXCHANGE YES BOTH YES YESEXIT NO �EXIT� �EXIT� �EXIT�FAST IMAGE NO FILE NO NOFILTER NO NONE��� NO NO���FIT NO �MENU� �MENU� �MENU�FLIP NO CURRENT YES NOFONT NO NONE NO NOFUJI LINEARISATION NO CURRENT YES NOFULL REGION NO NONE NO NOGAUSSIAN NO CURRENT YES NOGEOMETRY �EXPERIMENT� NO NONE NO NOGRID NO NONE NO NOHELP NO NONE NO NO

Page 274: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Table �� Main Menu Commands and E�ects �Continued�

Command �Memory� Output Current Data �Memory�Required Position A�ected A�ected

IMAGE NO NONE NO NOINFORMATION NO NONE NO NOINPUT DATA NO CURRENT YES NOLINEARISE FILM NO CURRENT YES NOLIST VARIABLES NO NONE NO NOLOGARITHM NO CURRENT YES NOMACRO �MACRO� �MACRO� �MACRO� �MACRO�MEDIAN FILTER NO MEMORY NO YESMOVE�ROTATE NO MEMORY NO YESMULTIPLY YES CURRENT YES NONORMALISE NO CURRENT YES NOOFFSET�SCALE NO NONE NO NOOPEN LOG NO NONE NO NOOUTPUT DATA NO FILE NO NOPAGE POSITION NO NONE NO NOPEEP NO NONE NO NOPIXEL REGION NO NONE NO NOPLOT DATA NO NONE NO NOPOISSONIAN NOISE NO CURRENT YES NOPOWER SPECTRUM NO NONE��� NO NO���PRINT GRAPHICS NO FILE NO NOPUBLICATION QUALITY NO NONE NO NOQUIT NO �EXIT� �EXIT� �EXIT�RAISE TO A POWER NO CURRENT YES NOREBIN NO MEMORY NO YESRECALL YES CURRENT YES NOREFLECT NO MEMORY NO YESREGION NO NONE NO NOROI NO NONE NO NOROTATE LUT NO NONE NO NORUN MACRO �MACRO �MACRO� �MACRO� �MACRO�SELECT PIXEL OPERATION NO CURRENT YES NOSEQUENCE �MACRO �MACRO� �MACRO� �MACRO�

Page 275: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Table �� Main Menu Commands and E�ects �Continued�

Command �Memory� Output Current Data �Memory�Required Position A�ected A�ected

SET ANNOTATION STYLE NO NONE NO NOSET ARROW STYLE NO NONE NO NOSET AXES STYLE NO NONE NO NOSET BACKGROUND STYLE NO NONE NO NOSET COLOUR NO NONE NO NOSET CURVE STYLES NO NONE NO NOSET ENUMERATION STYLE NO NONE NO NOSET FONT NO NONE NO NOSET GRID STYLE NO NONE NO NOSET TICK POSITIONS NO NONE NO NOSMOOTH NO MEMORY NO YESSPATIAL FILTERING NO MEMORY NO YESSTART MACRO NO FILE NO NOSTATISTICS NO NONE NO NOSTOP MACRO NO NONE NO NOSTORE NO MEMORY NO YESSUBTRACT YES CURRENT YES NOSURFACE INTERPOLATION NO MEMORY NO YESSYMBOL NO NONE NO NOSYMMETRIC FUNCTION YES CURRENT YES NOTITLE NO NONE NO NOTHRESHOLD NO CURRENT YES NOTRANSPOSE NO MEMORY NO YESUN�DEFINE VARIABLE NO NONE NO NOUNIT CELL PARAMETERS NO NONE NO NOVC NO CURRENT YES NOVARIABLE NO NONE NO NOVARIANCES DEFINITION NO CURRENT YES NOWEIGHTED AVERAGE YES CURRENT YES NOX�AXIS LABEL NO NONE NO NOY�AXIS LABEL NO NONE NO NOZ�AXIS LABEL NO NONE NO NOZ�SCALE NO NONE NO NO��D INTERPOLATION NO CURRENT YES NO��D SURFACE PLOT NO NONE NO NO

Page 276: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Table �� Calibration SubMenu Commands and E�ects

Command �Memory� Output Current Data �Memory�Required Position A�ected A�ected

� NO NONE NO NOCALCULATE FITTED DISTORTION NO MEMORY NO YESDECAY CORRECTION NO CURRENT YES NODESTROY GRID PEAKS NO NONE NO NODISPLAY DISTORTION NO NONE NO NOEXIT NO NONE NO NOFIND PEAKS NO NONE NO NOFIT GRID PEAKS NO NONE NO NOFLAT�FIELD CORRECTION NO CURRENT YES NOHELP NO NONE NO NOINPUT SPATIAL FUNCTION NO NONE NO NOINVERSE DISTORTED�IDEAL NO NONE NO NOLEARN HOLE PROFILE NO MEMORY NO YESLINEARISE INTENSITIES NO CURRENT YES NOOUTPUT SPATIAL FUNCTION NO FILE NO NOPLATYPUS CORRECTION FILE NO FILE NO NOQUIT NO NONE NO NORE�CALCULATE DISTORTION NO NONE NO NORESIDUALS OF FIT NO MEMORY NO YESSAVE PEAKS NO FILE NO NOSIZE �IMAGE DISPLAY� NO NONE NO NOSPATIAL CORRECTION NO MEMORY NO YESTRANSFER DISTORTION NO MEMORY NO YESVIEW PEAKS NO NONE NO NOXRII FLAT�FIELD NO MEMORY NO YES

Page 277: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Table � Fit SubMenu Commands and E�ects

Command �Memory� Output Current Data �Memory�Required Position A�ected A�ected

CHANGE SCALE NO NONE NO NOCLEAR MASK NO NONE NO NOCONSTRAIN NO NONE NO NOCOVARIANCE NO NONE NO NODEFINE MASK NO NONE NO NOEXIT NO NONE NO NOINPUT PARAMETERS NO NONE NO NOMASK STATISTICS NO NONE NO NOMINIMISE NO MEMORY NO YESMODEL NO MEMORY NO YESNORMALISATION NO MEMORY NO YESOUTPUT PARAMETERS NO FILE NO NOPOWDER DIFFRACTION NO MEMORY NO YESQUIT NO NONE NO NOR�THETA RE�BINNING NO MEMORY NO YESRADIAL PROFILE NO MEMORY NO YESRESULTS NO NONE NO NOSET MASK COLOUR NO NONE NO NOSET UP NO NONE NO NOSURFACE POLYNOMIAL NO MEMORY NO YESTHRESHOLD MASKING NO NONE NO NOTILT�BEAM CENTRE NO NONE NO NOTRANSFER MASK TO MEMORY NO MEMORY NO YES

Page 278: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Appendix E� Conditions of Use

Users of FIT�D exterior to the ESRF are required to sign the following conditions of use��Internally users are not presently required to sign the form but they expected to abide bythe conditions�� This form is intended to allow freedom of use for personal academic researchprovided suitable acknowledgement of the program and methods is given� �For a copy of anyof the source code this form and the following source code disclosure form must be signed andreturned��

I ���������������������������������������������������������������������������������������������������������������������� �print name�

working at ��������������������������������������������������������������������������������������������� �name of institute�agree to abide by all of the following conditions�

�� I will only use FIT�D for nonpro�t making nonmilitary academic research�

�� I accept that no guarantee of correctness of methods is given by the author�

�� I undertake to acknowledge both the author and the home institute of FIT�D for any�major� use of the program� This means acknowledging A P Hammersley and the ESRFfor use of FIT�D� The following use should be considered �major� i�e� requires acknowledgement�

� Detector distortion calibration and correction

� Use of any data analysis operation not in the list below

The following use does not require any acknowledgement�

� Graphical display and output �without �major� data analysis�

� Trivial data analysis i�e� addition subtraction multiplication division pixel by pixelor by scalars� Basic mathematical functions applied pixel by pixel �Log exponentionsquare root�

� File format conversion including the following image transformations� re�ectionrotation transposition

�� I agree to cite appropriate references �as described within the FIT�D Reference Guide�for publications which result from �major� data analysis using FIT�D�

������������������������������������������������������������������������������������������������������������������������� �sign here�

Date� ���������������������������������������������������������

Page 279: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Completed forms may be posted to�

A P HammersleyESRFBP ���GRENOBLE �����CEDEXFRANCE

The form may be initially faxed in order to obtain the software �key� more quickly�

Fax� ��������������

Further enquires may be made by email�

Email� hammersley�esrffr

Page 280: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Appendix F� Conditions of Disclosure of Source Code

See next page

Page 281: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Source code will be disclosed only when absolutely necessary� and in return for signed copies of boththe �Conditions of Use� form and this �Disclosure of Source Code� form� The conditions are required�to protect the copyright of the authors� to prevent overly high expectations by programmers workingwith the code� to ensure that bene�cial modi�cations are generally available� and to prevent divergentversions�

I ������������������������������������������������������������������������������������������������������������������������������� print name

working at ������������������������������������������������������������������������������������������������������ name of institute

using the following computer systems� �����������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������� give make� type� and where availableInternet address of computer systems

agree to abide by all of the following conditions�

�� I accept that all source code is the copyright of the authors and I will not remove the authorsname from any of the source code nor from the program banner� nor use the code for any otherreason without additional approval�

�� I will not allow access to the source code to any third party� nor copy it to any computer systemother than the ones listed above�

� I will not allow use of the program by any user who has not signed the �Conditions of Use�form�

�� I will ensure that users of the program are given adequate access to the available documentation�The documentation may be reproduced and distributed to users who sign the �Conditions ofUse� form�

�� I undertake to answer users questions and will try to solve their problems of usage to themaximum of my ability� without recourse to the authors� except when absolutely necessary�

�� I accept that both the form subroutine�procedure names and arguments and the functionalityof the source code may change in future versions�

�� I accept that even after any �minor� modi�cations the source code or documentation remainsthe complete intellectual copyright of the original authors� and I undertake to send to theauthors preferably by e�mail an example of all �minor� modi�cations� �Minor� modi�cationswhich may be made are�

� Changes required to overcome compilation errors or warnings

� Changes required to overcome errors in the data processing

� Changes to the default choices o�ered by FIT�D�

� Correction of inaccurate documentation�

�� I will not make any �major� modi�cations� Except under the circumstances of an additionalagreement� �Major� modi�cation means any modi�cation not de�ned as �minor��

�� I will allow executable versions to be copied to the ESRF for general availability to the aca�demic community under the �Conditions of Use� conditions�

������������������������������������������������������������������������������������������������������������������������������������� sign here

Date� ��������������������������������������������������������������

Page 282: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�� Appendix G� Collaborative Development

Any programmers interested in adding new or improved features and functionality into FIT�Dare welcome to contact me� Extra manpower is always useful� FIT�D may well provide a goodframework for your data analysis developments e�g� An environment of �le input�output anddata display already exists together with facilities to allow de�nition and execution of macros�Such added code would remain the copyright of the author�s� but the author�s� would have toaccept the distribution of the code under the same conditions as given in Appendices E and F�

Such code would need to follow a number of general guidelines which are necessary in order tomaintain the integrity of FIT�D i�e� prevent one part of the program corrupting another part�

� In order to make memory corruption as di�cult as possible all code �or almost all code�should be in FORTRAN�� with only a few generally available extensions �or hopefullysoon Fortran��� and be able to be compiled with array bound checking i�e� with the�C option for Unix Fortran compilers or the CHECKS�ALL option for the VMS Fortrancompiler� All code should be tested and run with array bound checking enabled�

� Use of unconstrained pointers should be nonexistent or almost nonexistent� At presentunconstrained pointers are necessary to allow dynamic memory allocation but withFortran�� this need will disappear� �When this exception there is only one point inthe whole of FIT�D where unconstrained pointers are useful��

� All code should include �defensive programming� code to protect as much as possibleagainst misuse of the code� The last argument of every routine must be the status

return variable� On input this variable must be checked to correspond to the �good status�value� If not routines must call the subroutine EXPG ST SAVE to report the apparent badstatus and then immediately return� All possible input arguments should be checkedfor allowed values� If values are not appropriate the error condition should be reportedthrough the status value and a call to EXPG ST SAVE� After an error condition has beenfound in one of the input arguments all routines must return without any further action�Very low level repeatedly calls routines may be allowed not to include this �defensiveprogramming� code when appropriate provided higher level calls can �lter all possiblemisuse� �Examples and templates of use of the system can be supplied��

� When Fortran�� becomes generally available for the main target machines it will beadditionally required to provide an �interface� for each subroutine and function�

� All code should be well documented preferably in the standard style of FIT�D� Templates can be supplied� �An automatic documentation extraction program exists for codefollowing a well de�ned structure��

� Programmers are strongly encouraged to follow the following conventions for typing thenames of variables constants arrays functions and subroutine calls�

� Scalar constants� First letter upper case followed by lower case only

� Scalar variables� Lower case only

� Arrays� Upper case only

Page 283: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

� Function calls� First letter upper case followed by lower case

� Subroutine calls� Upper case only

� Fortran function keywords� First letter upper case followed by lower case

� Pointers� Lower case p followed immediately by all upper case

Use of these conventions makes understanding the program and program structure mucheasier and may allow automatic identi�cation and processing of particular elements e�g�pointers�

� Interfacing to POSIX ������ operating system functions may use �C� but this should bemade immediately callable by Fortran taking into account both Fortran compilers whichadd underscores to the end of external symbols and those which do not� Similarly thedi�erent handling of characters strings between Fortran and �C� must be foreseen�

Page 284: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

Index�� Angle

Calculate ���� ��� ���ADR � � �

Full Data �� LATEX ��

Documents ���LATEX

ProblemsOld Version ���

PAUSE� ���

��C���shell� ��

��ESRF Data Format��

Problem� ���

��Memory��

Array� �

FITD KEY� ��

ADRChange� ���� ���

CHIPLOTOutput

File Format� ��

EXCHANGE� ��

FIT�D� �

Availability� ��

Banner Page

Print� ��

Changes� ���

Citation� �

Executables

Availability� ��

Home Page

URL� ��

New Versions�

Old Version�

Screen Output� ��

Start�up� ��

Terminal Output� ��

Versions� ���

Version Number� ��

MADNES� ���

Spatial Distortion

Correction�

MFIT� ��

PLATYPUS� ���

Xdisplayf� ��

spec� ��

��D INTERPOLATION� ��

��D SURFACE PLOT� ��

�CONTROL�C�� �

�TAB�

File Name

Completion� ��

�� ��

ADD� ��

ANNOTATION LABEL� ���

ASPECT RATIO� ���

AUTOCORRELATION� ��

AXES SCALES� ��

BANNER� ��

BINARY �UNFORMATTED�� ��� ���

BLUR� ��

BRAGGS� EQUATION� ���

BSL FORMAT� ���� ���

CADD� ���

CALCULATE DISTORTION FUNCTION� ��

CALCULATOR� ���

CALIBRATION� ���� ���

CBF� ��

CDIVIDE� ���

CHANGES� ���

CHANGE SCALE� ��

CHIPLOT FORMAT� ���

CLEAR DATA� ���

CLOSE LOG� ���

CMULTIPLY� ���

COLOUR TABLE� ���

CONCATENATION� ���

CONTOUR PLOT� ���

COVARIANCE� �

CREATE DATA� ���

CURVE STYLES� ���

D�SPACING� ���

DECAY CORRECTION� ���

DEDUCE FILE SEQUENCE� �

DEFINE MASK� �

DEFINE VARIABLE� ��

DENZO MAR FORMAT� ���

DENZO� ���

DESTROY GRID PEAKS� ���

DIMENSIONS� �

DISPLAY DISTORTION� ���

���

Page 285: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

DISPLAY LIMITS� ��

DISPLAY MASK� �

DISPLAY� ��

DIVIDE� ��

END GRAPHICS FILE� ��

ENTROPY� ��

ERROR � ��

ERROR

Messages� �

EXCHANGE� ��

EXIT� ��

FAST CORRECTION� ���

FAST IMAGE� ��

FILTER� ��

FIND PEAKS� ���

Image Region�

FIT� ��� �

FLAT�FIELD CORRECTION� ��

FLIP� ��

FONT� ��

FUJI BAS�� ���

FUJI LINEARISATION� ��

FULL REGION� ��

GAS �D DETECTOR �ESRF�� ���

GAUSSIAN� ��

GEOMETRY �EXPERIMENT�� ��

GRID� ��

GUI� ��

HAMAMATSU PHOTONICS� ���

HEADER FILES� ���

HELP� ��� ��

HISTOGRAM� ��

IC� ��

IDL� ���

IMAGEQUANT� ���

IMAGE� ��

Command� ��

INFO � ��

INFORMATION� ��

INFO

Messages� �

INPUT DATA� ��

INPUT SPATIAL FUNCTION� ���

INTERNAL MEMORY� ���

INTLAUE� ���

INVERSE DISTORTED�IDEAL� ���

LEARN HOLE PROFILE� ���

LINEARISE FILM� ��

LINEARISE INTENSITIES� ���

LIST VARIABLES� ��

LOAD LOOK�UP TABLE� ���

LOGARITHM� ���

LOOK�UP TABLE �SPATIAL DISTORTION�� ���

MACRO� ���� ��

MAR RESEARCH FORMAT� ���

MEDIAN FILTER� ���

MESSAGE� ���

MINIMISE� ��

MOSFLM� ���

MOVE�ROTATE� ���

MULTIPLY� ���

NEW MAR CODE� ���

NO HEADER FILES� ���

NORMALISATION� ��

NORMALISE� ���

NOTE

Messages� �

OFFSET�SCALE� ���

OPEN LOG� ���

OUTPUT DATA� ���

OUTPUT PARAMETERS� ��

OUTPUT SPATIAL FUNCTION� ���

PAGE POSITION� ��

PEEP� ���

PIXEL REGION� ���

PLATYPUS CALIBRATION FILE� ���

PLOT DATA� ���

PMC FORMAT� ���

POISSONIAN NOISE� ���

POLARISATION EFFECT� ���

POSTSCRIPT OPTIONS� ���

POWDER DIFFRACTION� ��

POWER SPECTRUM� ���

PREDICTOR� ���

PRINCETON CCD FORMAT� ���

PRINT GRAPHICS� ���

PUBLICATION QUALITY� ���� �

QUESTION� ���

QUIT� ���

R�THETA RE�BINNING� ��

RADIAL PROFILE� ��

RAISE TO A POWER� ���

RE�BIN� ���

RE�CALCULATE DISTORTION� ���

REBIN� ���

RECALL� ���

REFLECT� ���

REGION� ���

Page 286: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

RING �ADD POWDER RING�� ���

ROI� ���

ROTATE LUT� ���

RUN MACRO� ��� ��

SAVE PEAKS�

SELECT PIXEL OPERATION� ��

SEQUENCE� ��� ��

SET ANNOTATION STYLE� ���

SET ARROW STYLE� ���

SET AXES STYLE� ���

SET BACKGROUND STYLE� ���

SET COLOUR� ���

SET CURVE STYLES� ���

SET ENUMERATION STYLE� ���

SET FONT� ���

SET GRID STYLE� ���

SET LAYOUT STYLE� ���

SET TICK POSITIONS� ���

SET TITLE STYLE� ���

SET X�LABEL STYLE� ���

SET Y�LABEL STYLE� ���

SIZE �IMAGE DISPLAY��

SLEEP� ���

SMOOTH� ���

SPATIAL CORRECTION�

SPATIAL FILTERING� ���

START MACRO� ���� ��

STATISTICS� ��

STOP MACRO� ��� ��

STORE LOOK�UP TABLE�

STORE� ���

SUBTRACT� ���

SURFACE INTERPOLATION� ���

SYMBOL� ���

SYMMETRIC FUNCTION� ���

THRESHOLD� ��

TIFF� ���

TITLE� ��� ��

TRANSFER DISTORTION�

TRANSPOSE� ��

TWO THETA ANGLE� ���

UN�DEFINE VARIABLE� ��� ��

UNIT CELL PARAMETERS� ���

UNKNOWN

Data Format� ��

USER INTENSITIES� ��

VC� ���

VARIABLE� ���� ���

VARIANCES DEFINITION� ���

VIEW PEAKS�

WAIT� ���

WARNING � ��

WARNING

Messages� �

WAVELENGTH�ENERGY� ���

WEIGHTED AVERAGE� ���

X�AXIS LABEL� ��� ���

Y�AXIS LABEL� ��� ���

Z�AXIS LABEL� ��� ���

Z�SCALE� ���

��BLANK� ��

emacs� ��

fitd new� �

fitd old�

gmake� ��

lodspd� �

mmtopx� �

pmipmc� ���

pxtomm� �

��D

Fitting

Peak� ��

��D Interpolation� ��

�D Data

Integrate� �

�D Polynomial

Fit� ��

��D

Surface Plot� ��

�CAM

Data Format� ���

FIT GRID PEAKS� ���

A�

Landscape� �

Acknowledgement

FIT�DUsage� �

Active Data Region� �� ���

Add

Data� ��

Images� ��

Addition

Constant� ���

Images� �

Scalar

Image� �

ADR

Page 287: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Store� ���

Alignment

Images� ���

Allocation

Virtual Memory� �

Ambiguous

Prompts� ��

Angle

��� ���

Annotation� ���

Attributes� ���

Style� ���

Annulus

Masking� ��

Arc

Masking� ��

Arithmetic

Image� ��

Operations� ��

Array

Current Data� �

Memory� � �

Storage

Internal� ���

Transpose� ��

Arrays

Error Estimate� �

Program� �

Variance� � �

Array Sizes

Specifying� �

Arrow

Attributes� ���

Style� ���

ASCII

Header Files� ���

Output� ��� ���

Aspect Ratio

Images� ���

Set� �

Autocorrelation

Function� ��

Automatic

Completion

File Name� ��

Sequence

Processing� ��

Sequence Processing� ��� ��

Availability

FIT�D� ��

Average� ��

Images� �

Average�File Series� �

Averaging

Images� ���

Axes

Attributes� ���

Enumeration

Style� ���

Scaling

Set� ��

Style� ���� ���

Ticks

Positions� ���

Axis

Colour� ���

Scaling

Set� ��

Azimuth

Integration� ��

Background

Colour� ���

Backing Store

None� ��

Bad

Documentation� ��

Bad Data

Masking� ��

Banner

Text� ��

Banner Page

Output� ��

BAS���

Fuji

Data Format� ���

BAS�

Fuji

Data Format� ���

Base �

Logarithm� ���

Batch

Mode� �

Processing� �� �

Batch Mode

Unix

Script� ��

Beam�stop�

Page 288: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Beam Centre

Calibration� ��

Determined� �

Beam Line

Calibration� ��

Beer

Free� ��

Big Endian

Integer

Output� ���

Binary

Data� ��

File

Output� ���

File Format

Output� ���

Output

Information� ���

Blank

Input� ��

Blur

Top�Hat� ��

Blurring� ��

Images� ��

Bourgeois

Dominique� ��

Bragg

Equation� ���

Bragg Intensities

Polarisation Effect� ���

BSL Format

Output� ���

Bug

Reporting� ��

Bugs� �� ��

Known� ��

Byte

Input

Data� ��

Byte swapping� ��

C�shell� ��

Cake

Integration� ��

Calculate

Statistics

Image� ��

Calculator� ���

Calibrant

Command� ��

Calibrate

Grid� ���

Calibration� ���

Beam Centre� ��

Beam Line� ��

Dead�Time

Detector� ���

Flat�Field� ��

Help� ��

Measurement

Spatial Distortion� ���

Calibration Sub�Menu

Commands

Effects� ��

Campbell

John� ���

CBF

Data Format� ��

CCD Camera

Hamamatsu Photonics� ���

CCD Camera

Photometrics� ���

Princeton� ���

Changes

FIT�D� ���

Changing

Title

Style� ���

X�axis Label

Style� ���

Y�axis Label

Style� ���

Chebyshev Polynomial� ��

Chiplot

Data Format� ���

chiplot

Output

Format� ��

Choice

Font� ���

Choices

Colour Table� ��

Circle

Masking� ��

Circular

Symmetric

Function� ���

Circular Average

Page 289: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

�Radial Profile�� ��

Citation

Distortion Calibration� �

Fluorescent Glasses� �

General� �

MFIT� ��

Clear

Mask� ��

Close

Graphics File� ��

Macro� ��� ��

Coding

Colour

GUI� �

Colour

Background� ���

Coding

GUI� �

Flash� ��

Indices

Usage� ��

Lines� ���

Mask Elements

Set� ��

Text� ���

Usage� ��

Colour Bar

Intensity Scale

Z Scaling� ��

Colour Flash� ��

Colour Mapping

��bit� ��

TrueColor� ��

Colour Table

Choices� ��

Control� �

Indices� �

Rotate� �

Rotation� ���

Combining

Images� ���

Command

Editing� ��

Input� ��

Logic� �

Operating System� ��

Output

Position� �

Commands� ��

Calibration Sub�Menu

Effects� ��

Fit Sub�Menu

Effects� ��

Macros� ��

Main Menu� ��� ��

Menu Menu

Effects� ������

Command File

Batch Processing� ��

Command Line

Options� �

Recall� ��

Variable

Definition� �

Complete

ADR� ��

Completion

File Name� ��

Complex Arithmetic Calculator� ���

Complicated

Macros� �

Composite

Image� �

Compressed Diffraction Data� ��

Compression

Data� ���

Entropy� ��

Concatenation

Strings� ���

Conditions

Usage� ��

Constant

Addition� ���

Division� ���

Multiplication� ���

Constraints

Fit� �

Contaminated Regions

Masking� ��

Control

Colour Table� �

CONTROL�C

Problem� �

Control�C

Problem� �

Conversion

Real Space

Reciprocal Space� ���

Page 290: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Reciprocal Space

Real Space� ���

Convert

Integer Value

Character� ��

Photon Energy

Wavelength� ���� ���

Wavelength

Photon Energy� ���

Convolution

Top�Hat� ��� ��� ���

Coordinate

Input� ��

Coordinates

Data� ��

Page� ��

Coordinate Systems� ��

Correct

Spatial Distortion�

Correction

Flat�Field� ��

Lorentz� ��

Polarisation� �

Spatial Distortion

Fast� ���

Correlation

Function� ��

Cosine

Function

Fitting� ��

Counting Statistics

Scaling� ���

Create

Log File� ��

Look�up Table

Correction� ���

Current Data

��Memory��

Exchange� ��

Array� �

Variances

Swap� ���

Current Variables

List� ��

Curve

Styles

Change� ���

Curve Styles� ��

Customisation

Graphics� ��

D�spacing

Calculate� ���

d�spacings� ���

Data

Binary

Input� ��

Display� �

Input� ��� ��

Masking� ��

Minimum�Maximum� ��

Output� ���

Re�binning� ���

Smoothing� ���

Store� ���

Thresholding� ��

Data Compression

Entropy

Calculation� ��

Data Analysis

Protein Crystallography

DENZO� ���

MOSFLM� ���

Data Compression� ���

Data Coordinates� ��

Data Format

�CAM� ���

CBF� ��

ESRF� ���

Unknown� ��

Data Mask� ��� ��

Definition� ��

Save� �

Data Masking

Menu� ��

Data Region

Extend� �

Data Values

Interactive

Input� ��

Data Window� �� ���

DDR� ��

Dead�Time

Calibration� ���

Correction� ���

Decay

Exponential

Function� ��

Page 291: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Imaging Plate

Intensity� ���

Deduce

File Sequences� �

Default

Input

Values� ��

Define

Data Mask� ��

Masked Elements� �

Variable� ��

Command Line� �

Definition

Distortion Function

Ideal�Distorted� ���

DENZO� ���� ��

Destroy

Variable� ��

Detector

Dead�Time

Calibration� ���

Correction� ���

Detector Tilt

Calibration� ��

Fit� ���

Determine

Beam Centre� ���

Development Versions

FIT�D�

Deviatoric Stress� �

Dierckx

Paul� ��

Diffraction

Powder� ��� ���� �� �� ���

DIP�

�Mac Science�� ���

Disable

Header File

Output� ���

Display

Data� �

Image� �

Results� ��

Distance

Measurement� ��

Distortion

Fit

Residuals�

Processing�

Distortion Calibration

Citation� �

Distortion Function

Definition

Ideal�Distorted� ���

Distortion Spline� ��

Division� ��

Constant� ���

Image

Example� ��

Images� �

Scalar

Image� ��

Document

LATEX ��� �

Diagrams� �

Graphics� �

Documentation

Bad� ��

Drum�Scanner

EMBL� ���

Dump �Binary�

File

Output� ���

Dynamic

Linked

Version� ��

Dynamic Memory� �

Effects

Calibration Sub�Menu Commands� ��

Fit Sub�Menu Commands� ��

Main Menu Commands� ������

EMBL

Drum Scanner� ���

Empty String

Input� ��

Enable

Header File

Output� ���

Endian

Big�Little

Output� ���

Little�Big

Output� ���

Energy

Wavelength

Conversion� ���� ���

Entropy

Page 292: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Calculate� ��

Zeroth Order� ��

Enumeration

Style� ���

Environment

Variables� ��

Equation

Bragg� ���

ERROR

Messages� �

Error

Memory Allocation

Failed�

Messages� ��� �� ��

ERROR � ��

Error Analysis�

Error Bar

Styles� ���

Error Estimate

Arrays� �

Error Propagation�

Escape

Input� ��

ESRF

Data Format� ���

Example

Header File� ���

Image

Division� ��

Macro� ��

Subtraction

Images� ��

Variable

Definition� ��

Examples

SEQUENCE Command� ���

File Sequence

Processing� ���

Exchange

Current Data

��Memory��� ��

Variances�Current Data� ���

Executables

Availability� ��

Exit� ��

Experimental

Geometry� ��

Explanation

Prompts� ��

Exponential

Decay

Function� ��

Exponention

Images� �

Extend

Data Region� �

False Colour

Image� ���

Display� �

Look�up Table� ���

False Colour Image

Intensity

Scaling� ��

Features

Bad� ��

Feed�back� ��

Figures

Document� �

File

Input� ��

Output� ��� ���

Save� ��

Sequence� ��

Unformatted

Output� ���

File Sequences

Deduction� �

Files

Sequences� ��

File Format

Binary

Output� ���

ESRF Gas�filled Detectors� ���

Fuji

BAS�� ���

MarResearch� ���

MCA

Output� ���

Output

Spread Sheet� ���

TIFF� ��

Spread Sheet

Output� ���

TIFF

Output� ��

Unknown� ��

File Name

Page 293: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Completion� ��

File Sequence� ���

Processing� �

Re�number� ���

File Sequences

Processing� ��

File Series� �� ��

Integrate� ��

Integration� �

Film Data

Linearisation� ��

Filter� ��

High�Pass� ���

Low�Pass� ��� ���

Median� �� ���

Noise� ��� �

Non�Linear� �

Spatial� ���

Filtering

Fourier� ��

Non�Linear� �

Operations� ��

Find

Grid Peaks� ���

Fit� �

�D Polynomial� ��

Beam Centre� ���

Constraints� �

Control

Parameters� ��

Minimisation� ��

Parameter

Scale Size� ��

Parameters

Input� ��

Residuals� �

Results

Display� ��

FITD

Citation� �

File Format

Output� ���

Reference

Usage� �

Start�up� ��

fitd

Start�up� ��

Usage

Citation� �

Fitch

Andy� ��

FITPACK� ��

Fitting

��D

Multiple� ��

Initialisation

��D� ��

Model� ��� �

Surfaces� ��

Fit Parameter

Output� ��

Fit Sub�Menu

Commands

Effects� ��

Flat�Field� ���

Correction� ���� ��� ��

Flip� ��

Image� ��

Flood�Field� ���

Fluorescent Cells� ���

Fluorescent Glasses

Citation� �

Font

Choice� ���

Missing� �

Fonts� ��

Forms

Graphical� ��

Fourier

Filtering� ��

Free

Beer� ��

Free Software Foundation� ��

Frequency Histogram

Pixel Values� ��

Fuji

BAS�

Format� ���

Image Plate Data

Linearisation� ��

Imaging Plates

Intensity Decay� ���

Function

Decay

Exponential� ��

Exponential

Decay� ��

Gaussian� ��

Page 294: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Fitting� ��

Lorentzian

Fitting� ��

Polynomial

Fitting� ��

Sinusoid

Fitting� ��

Symmetric� ���

Voigt

Fitting� ��

Gas Detector

Format� ���

Gaussian

Function� ��

Fitting� ��

General

Citation� �

Geometric

Operations� ��

Geometrical

Transformations� �

Geometry

Experiment� ��

GISAXS� �

Glory Hole� ��

GPP� ��

Graphical

Input

Character� ��

Graphical Forms� ��

Graphical User Interface

General Instructions� �

Graphics

Annotation� ���

Customisation� ��

High Quality� �

Layout

Set� ���

None� �

Output� ��� ���

Problem

Missing Font� �

Not Re�drawn� ��

Printing� �

Publication� ���

Publication Quality� �

Graphics File

Close� ��

Graphics Layout� ��

Graphics Output

PostScript� ���

Graphics System� ��

Graphics Window

Size� ��

Grazing Incidence� ��� �

Grid

Attributes� ���

Calibration� ���

Peak Search� ���

Style� ���

Grid Lines

Style� �

GUI

Colour

Coding� �

Form

Input� ��

From ��keyboard��� ��

General Instructions� �

Interfaces� �

Mask

Command� ��

Output

Command� ��

Hamamatsu Photonics� ���

Header

Files� ���

Text� ��

Header File

Disable

Output� ���

Enable

Output� ���

Example� ���

HELP� ��

Help� ��

Calibration� ��� ���

Keywords� ��

On�line� ��

High�Pass

Filter� ���

Histogram

Image

Frequency� ��

Pixel Value

Frequencies� ��

Page 295: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

History

Recall� ��

Hole Profile

Average� ���

Home Page

FIT�DURL� ��

Ideal�Distorted

Distortion Function

Definition� ���

IDL� ���

Image

Addition� ���

Scalar� �

Arithmetic� ��

Aspect Ratio� ���

Command� ��

Display� ��

False Colour� �

Division� �

Example� ��

Scalar� ��

Explanation� ��

Exponention� �

Extend� �

False Colour� ���

Filtering� ��

Graphical Input� ��

Histogram� ��

Intensity

Scaling� ��

Layout

Set� ���

Manipulation� ��� ��

Maths� ��

Maximum Size� ��

Movement� ��

Multiplication� ���

Scalar� �

Normalisation� ���

Operations� ��

Arithmetic� ��

Geometrical� �

Output� ��

Reflection� ���

Rotation� ���

Scaling� ���

Size� ��� �� ��

Smoothing� ��� �

Statistics� ��

Subtraction� �� ���

Thresholding� �

Translation� ���

Transposition� ��

Images

Addition� �

Average� �

Composite Display� �

Display� �

Composite� �

Multiplication� �

Subtraction

Example� ��

Image Display

Problem� ��

Image Processing� ��

Imaging Plate

Decay

Intensity� ���

Imaging Plates

Fuji

Intensity Decay� ���

Kodak

Intensity Decay� ���

Important

Commands� ��

Index� ��

INFO

Messages� �

INFO � ��

Information

Files� ���

Help� ��

Messages� ��� �� ��

On�line� ��

Pixel Values� ���

Program� ��

Information Theory

Entropy

Calculate� ��

Input

Byte

Data� ��

Coordinate� ��

Data

Integer!� ��

Integer!�� ��

Page 296: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Real!�� ��

Empty String� ��

File� ��

Fit

Parameters� ��

Graphical Forms� ��

Interactive� ��

Keyboard� ��

Look�up Table

Correction� ���

Menu Commands� ��

Prompt� ��

Spatial Distortion Function� ���

Text

Graphical� ��

User Values� ��

Installation� ��

Integer

Character

Conversion� ��

Integer!

Input� ��

Integer!�

Input� ��

Integrate

Command� �

File Series� �

Integration

�D Data� �

Azimuth� ��

Cake

Region� ��

File Series� ��

Peaks� ��

Powder Rings� �

Intensities

Polarisation Effect� ���

Intensity

Display Range� ���

Linearisation� ���

Scaling� �� ��

Intensity Decay

Fuji

Imaging Plates� ���

Kodak

Imaging Plates� ���

Intensity Scale

Colour Bar

Z Scaling� ��

Z Scaling

Colour Bar� ��

Interactive

Input

Data Values� ��

Interfaces

GUI� �

Internal

Storage

Arrays� ���

Interpolation

��D� ��

Linear� ��

Surface� ���

INTLAUE� ���

Introduction

Graphical User Interface� �

GUI� �

Keyboard Interface� ��

Keyboard

Input� ��

Keyboard Interface

General Instructions� ��

Main Menu� ��

Keywords

Help� ��

Known Bugs� ��

Kodak

Imaging Plates

Intensity Decay� ���

Label

Style� ���

Labels� ���

Landscape

Format

A�� �

Law

Bragg� ���

Layout

Graphics

Set� ���

Page� ��

Least Squares Fitting� �

Left�Right

Inversion

Image� ��

Legal

Paper

Page 297: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Format� ��

Leslie

Andrew� ���

Light Graphics

System� ��

Limitations� ��

Line

Colour� ���

Colours� ���

Widths� ���

Linear

Interpolation� ��

Linearisation

Film Data� ��

Fuji

Image Plate Data� ��

Linearise

Intensities� ���

Little Endian

Integer

Output� ���

Log

Files

Creation� ��

Log�file

Open� ���

Logarithm

Base �� ���

Log File

Create� ��

Look�Up Table

Set� �

Look�up Table� ���

Correction

Create� ���

Input� ���

Output�

Looking Glass� ��

Lorentz

Correction� ��

Lorentzian

Function

Fitting� ��

Low�Pass

Filter� ��� ���

Macro

Close� ��

Commands

Useful� ��

Example� ��

Files� ��� ��

Mode� �

Open� ���

Run� ��

Start� ���

Stop� ��� ��

Macros� ��

Complicated� �

Interactive

Questions� ���

Pause� ���

Timed� ���

User Messages� ���

Wait� ���

Mac Science

DIP�� ���

MADNES� ���

Spatial Distortion

Correction�

Main Menu

Commands� ��� ��

Effects� ������

Prompt� ��

Mar

File Format

Output� ���

Marker

Colours� ���

Styles� ���

Types� ���

MarResearch

Compressed Data� ���

Data Format

Input� ���

File Format� ���

Overloaded Pixels� ���

Mask� ��� ��

Annulus� ��

Arc� ��

Circle� ��

Clear� ��

Colour

Set� ��

Command

GUI� ��

Data� ��

Definition� �

Page 298: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Display� �

Menu� ��

Polygon� ��

Threshold� ��

Masked Elements

Definition� ��

Mathematical

Operations

Images� ��

Maths

Image� ��

Maximum

Image Pixels� ��

Maximum Value

Masking� ��

MCA

Format

Output� ���

Mean� ��

Measure

Distance� ��

Measurement

Spatial Distortion� ���

Median

Filter� �� ���

Memory

Array� � �

Dynamic Allocation� �

Recall� ���

Recovery� ���

Save� ���

Stock Data� ��

Store� ���

Memory �System�

Requirements� �

Memory Allocation

Error�

Failure�

Menu

Main

Keyboard Interface� ��

Masking� ��

Prompt� ��

Menu Commands� ��

Messages

Error� ��� �� ��

Information� ��� �� ��

Macros� ���

Warning� ��� �� ��

MFIT� ��

Citation� ��

Minimisation

Model� �

Minimise� ��

Minimum Value

Masking� ��

Mirror

Image� ��

Mirror Image� ���

Missing Font

Problem

Graphics� �

Model

Definition

��D� ��

Fitting� ��� �

��D� ��

Modification

Text� ��

Molecular Dynamics� ���

MOSFLM� ���

Movement

Command� ��

Multiple

Integration� ��

Multiple Fitting

��D� ��

Multiplication

Constant� ���

Image� ���

Images� �

Scalar

Image� �

Murry

Andrew� ��

Network

Use� �

New Versions

FIT�D�

No

Backing Store� ��

Graphics� �

Noise

Filtering� ��� �

Photon� ���

Poisson Statistics� ���

Non�Linear

Page 299: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Filtering� �

Intensity Response

Correction� ���

Non�Orthogonality

Detector

Calibration� ��

Non�orthogonality

Detector

Fit� ���

Non�Uniform Response

Intensity� ���

Normalisation

Image� ���

Normalise

Image� ���

NOTE

Messages� �

Not Re�drawn

Graphics Window� ��

Problem

Graphics� ��

Null

Character

Input� ��

Number

Reverse

File Sequence� ���

Old Version

FIT�D�

Old Versions

FIT�D�

Olof

Svensson� ���

On�line

Help� ��

Open

Log�file� ���

Log File� ��

Macro� ���

Operating System

Command� ��

Operation

Sequence� ���

Operations

Arithmetic� ��

Filtering� ��

Geometric� ��

Image

Arithmetic� ��

Images� ��

Style Control� ��

Visualisation� ��

Optimise� ��

Options

Command Line� �

OTOKO

Data Format� ���

Otwinowski

Zbyszek� ���

Output

CHIPLOTFile Format� ��

ASCII� ��� ���

Binary

File Format� ���

Command

GUI� ��

Conventions� ���

Data� ���

Fit

Results� ��

Format

MCA� ���

Graphics� ��� ���

Look�up Table

Correction�

Raster� ���

Spatial Distortion Function� ���

Spread Sheet

File Format� ���

TIFF� ��

File Format� ��

Over�loaded

Pixels� ��

Overloaded Pixels

MarResearch� ���

Page

Layout� ��

Size� �� ��

Pager� ��� ��

Page Coordinates� ��� ��

Page Format

Landscape� �

Paper

Format

Problem� ��

Page 300: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Parameter

Output� ��

Parameters �Fit�

Input� ��

Paul Dierckx� ��

Pause

Macro� ���

Timed

Macros� ���

PDS� ��

Peak

Integration� ��

Peak Fitting

��D� ��

Peak Profile

Learn� ���

Peak Search� ���

Photometrics

File Format

Compressed� ���

Photon Factory� ���

Photonics

Hamamatsu� ���

Photon Energy

Wavelength

Conversion� ���� ���

Photon Noise� ���

Piltz

Ross� ���

Pixel

Selection

Operations� ��

Pixels

Over�loaded� ��

Pixel Information� ���

Pixel Limits

Image Display� ��

Pixel Values

Frequency

Histogram� ��

PLATYPUS� ���

Plot

��D Surface� ��

pmipmc� ���

Poisson

Noise� ���

Polarisation

Correction� �

Polarisation Effect

Intensities� ���

Polar Coordinate

Transformation� ��

Polygon

Masking� ��

Polygon Region

Statistics� ��

Polynomial

Function

Fitting� ��

Position

Page� ��

Positions

Axis

Tick Marks� ���

PostScript

Black�n�White� ���

Options� ���

Output

Problems� �

Powder Diffraction� ��� ���� �� ��

��� ���

Data Format

�CAM� ���

Powder Diffraction Standard� ��

Powder Ring

Fit� ���

Integration� �

Simulate� ���

Power Spectrum� ���

Predictor� ���

Prerequisites� ��

Princeton

File Format� ���

Printing

Problem

Graphics� �

Problem

LATEX ��Graphics� ��

TEX

Graphics� ��

��ESRF Data Format��� ���

FIT�DNot Available� ��

Backing Store� ��

Documentation� ��

Graphics

Missing Font� �

Page 301: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Not Re�drawn� ��

Output� �

Image Display� ��

Memory Allocation

Failure�

Silicon Graphics

X�servers� ��

Start�up

Failure� ��

Problems

LATEX

Old Version� �

Processing

Automatic

Sequences� ��

Batch� �

Images� ��

Profile

Radial� ��� ��

Program

Arrays� �

Array Sizes� �

Information� ��

Log File

Creation� ��

State� ��

Program Termination� ���

Program Arrays

Size� �

Program Log

Create� ��

Open� ���

Program Termination� ��

Program Variable� ���

Program Variables

Example� ��

Prompt

Input Value� ��

Main Menu� ��

Prompts� ��

Ambiguous� ��

Explanation� ��

Protein Crystallography

Data Analysis

DENZO� ���

MOSFLM� ���

Publication

Graphics� ���

Quality� �

Q�Space� �� ��

Questions

Interactive

Macros� ���

Question Mark� ��

Radial

Profile� ��

Profiles� ��

Radial Profile� ��

Radioactive

Sources� ���

Range

Display

Intensity� ���

Valid Input� ��

Raster

Output� ���

Re�binning

Data� ���

Re�number

File Sequence� ���

Re�size

Data Region� �

readline� ��

Real!�

Input� ��

Real Space

Reciprocal Space

Conversion� ���

Recall

Command Line� ��

Memory� ���

Reciprocal� ���

Reciprocal Space

Real Space

Conversion� ���

Reference

FIT�DUsage� �

Refinement� ��

Rietveld� ��

Reflect

Image� ��

Reflection� ��� ��

Image� ���

Region Of Interest� �� ���

Remove

Variable� ��

Page 302: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Reporting

Bugs� ��

Reset

Mask� ��

Residuals

Fit� �

Spline Fit

Distortion�

Restrictions

X���� ��

Results

Fit

Display� ��

Reverse

Numbering

File Sequence� ���

Reverse Polish

Calculator� ���

Rietveld

Refinement� ��� ��

Ring

Simulate� ���

ROI� �� ���

Root

Square� ���

Rotate

Colour Table� �� ���

Rotation

Image� ���

Rubber�band� ��

Run

Macro� ��

Sample Distance

Calibration� ��

Save

Data� ���

File� ��

Fit Parameters� ��

Spatial Distortion Function� ���

SAXS� �� ��� �

Scale Factor

Image� ���

Scaling

Intensity� �

Scaling Factor

Poisson Noise� ���

Scientific

Interfaces� �

Scientific Interfaces�

Screen

Colour Mapping� ��

Screen Output� ��

Script

��C���shell� ��

Unix� �

Batch Mode� ��

Search� ��

Grid Peaks� ���

Select

Pixel

Operation� ��

SEQUENCE� ��� ��

Sequence

File� ���

Processing� ��

Files� ��

Operations

Files� ���

Sequence Processing

Automatic� ��� ��

Series

File

Processing� ��

Files� ��

Set

ADR� ���� ���

Aspect Ratio� �

Look�Up Table� �

Mask

Colour� ��

Maximum

Image� �

Minimum

Image� �

Scaling

Axes� ��

Title� �

Style� ���

X�axis Label

Style� ���

Y�axis Label

Style� ���

Set�Up

Fitting� ��

Setting

Graphics

Layout� ���

Page 303: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Shot Noise� ���

Signed

Integer

Input� ���

Silicon Graphics

X�servers

Problem� ��

Simulate

Powder Ring� ���

Sine

Function

Fitting� ��

Sinusoid

Function

Fitting� ��

Size

Graphics Window� ��

Image� ��� �� ��

Page� �� ��

Programs Arrays� �

Skewness� ��

Sleep

Timed

Macros� ���

Small Angle Scattering� �

Smooth

Data� ���

Smoothing� ��� ��� ���

Median� �

Median Filter� ���

Top�Hat� ��

Space

Input� ��

Spatial Distortion

MADNESCorrection�

Calibration� ���

Correction� ����

Fast� ���

Look�up Table

Create� ���

Input� ���

Output�

Measurement� ���

Spatial Distortion Function

Input� ���

Output� ���

spec� ��

Spectrum Analysis� ���

Spline

Function

Fitting� ��

Spline Fit

Residuals�

Spread Sheet

File Format

Output� ���

Spy�glass� ��

Square

Elements� ���

Pixels� ���

Square Root� ���

Standard Deviation� ��

Start

Macro� ���

Start�up

FITD� ��

Static

Linked

Version� ��

Statistics

Image� ��

Stop

Macro� ��

Store

ADR� ���

Data� ���

Spatial Distortion Function� ���

Stress

Deviatoric� �

String

Concatenation� ���

Style

Annotation Labels� ���

Arrows� ���

Axes� ���� ���

Curves� ��

Enumeration� ���

Error Bars� ���

Grid� ���

Grid Lines� �

Lines� ���

Markers� ���

Text� ���

Style Control

Operations� ��

Subtraction

Images� �� ���

Page 304: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

Example� ��

Sum

Data� ��

Surface

Fit� ��

Fitting� ��

Plot� ��

Svensson

Olof� ���

Swap

Bytes� ��

Current Data

��Memory��� ��

Memory�Current Data� ��

Variances�Current Data� ���

SYMBOL� ���

Terminal

Window� ��

Terminal Output� ��

Test

Interface� ��

Testing� ��

Text

Colour� ���

Concatenation� ���

Fonts� ��

Input

Graphical� ��

Modification� ��

Output

Fonts� ��

Style� ���

X�axis Label� ���

Y�axis Label� ���

Z�axis Label� ���

Thomas

Ursby� ��

Threshold

Images� �

Masking� ��

Thresholding

Data� ��

Display

Intensity� ���

Images� �

Tick Mark

Positions� ���

TIFF� ���� ���

File Format

Output� ��

Tilt

Detector

Calibration� ��

Determination� ��

Times Roman� ��

Time Series� �

Title� ��

Set� �

Style

Changing� ���

Top�Bottom

Inversion

Image� ��

Top�Hat

Convolution� ��� ���

Smoothing� ��

Total

Intensity� ��

Transformation

Geometric� �

Polar Coordinates� ��

Translation

Image� ���

Transpose� ��

Array� ��

Transposition

Array� ��

Triangulation

Interpolation� ���

TrueColor� ��

Two�Theta Angle

Calculate� ���

Un�define

Variable� ��� ��

Uncovered Graphics

Not Re�drawn� ��

Unformatted

File

Output� ���

Uniformity of Response� ���

Calibration� ��

Unit Cell

Conversion

Real�Reciprocal� ���

Unix

Script� �

Page 305: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

��

Batch Mode� ��

Unknown

Data

Formats� ��

file Format� ��

Unsigned

Integer

Input� ���

URL

FIT�DHome Page� ��

Ursby

Thomas� ��

Usage

Conditions� ��

Use

Network� �

User

Feed�back� ��

User Escape� ��

User Help� ��

User Messages

Macros� ���

Valid Input

Range� ��

Values

Over�loaded� ��

Variable� ���

Concatenation� ���

Definition� ��

Command Line� �

Example� ��

Program� ���

Remove� ��

Un�define� ��� ��

Variables� ��

List� ��

Variance

Arrays� � �

Variances

Current Data

Swap� ���

Versatile

Integration� ��

Version

FIT�DOld�

Versions

FIT�D� ���

Version Number

FIT�D� ��

Virtual Memory

Allocation� �

Problem�

Visualisation

Operations� ��

Voigt

Function

Fitting� ��

Wait

Macro� ���

WARNING

Messages� �

Warning

Messages� ��� �� ��

WARNING � ��

Wavelength

Calculate� ���

Calibration� ��

Photon Energy

Conversion� ���

Wax Ring

Fit� ���

Window

Data� �� ���

World Wide Web

FIT�DHome Page� ��

Write

Output

File� ���

X���

Colour Mapping� ��

Restrictions� ��

X�axis

Text Label� ���

X�axis Label

Style

Changing� ���

X�ray Image Intensifier

Detector� ���

X�Ray Image Intensifier

Photometrics

Compressed� ���

Princeton� ���

X�ray Image Intensifier� ���

Page 306: Copyright 1987-1997 Andy Hammersley / ESRF Use of FIT2D ... · Supp ort for eXceed and LAN W orkplace Pro PC X serv ers in bit plane T rue Color set up V Re dra w graphics when an

���

X�servers

Silicon Graphics

Problem� ��

XRII� ���

Y�axis

Text Label� ���

Y�axis Label

Style

Changing� ���

Z�axis

Display Range� ���

Text Label� ���

Z Scaling

Command� ��