LAUEGEN - INITIAL LAUE DATA PROCESSING STAGES ============================================= Version: 6.0 John W. Campbell, CCLRC Daresbury Laboratory CONTENTS -------- CHAPTER 1: OVERVIEW 1.1 INTRODUCTION 1.2 Introduction to XDL_VIEW 1.3 Running the Program 1.4 Screen Layout 1.5 Some Basic Concepts 1.6 Outline of the Main Options 1.7 Command Line Input 1.8 Cylindrical Cameras 1.9 References CHAPTER 2: THE 'READ PARAMETERS FILE' OPTION 2.1 INTRODUCTION CHAPTER 3: THE 'WRITE PARAMETERS FILE' OPTION 3.1 INTRODUCTION CHAPTER 4: THE 'LAUE SIMULATIONS' OPTION 4.1 INTRODUCTION 4.2 Colour Coded Displays 4.3 Interactive Displays 4.4 Gnomonic Projections 4.5 Set Direction CHAPTER 5: THE 'DISPLAY/MEASURE IMAGE' OPTION 5.1 INTRODUCTION 5.2 Measure Image 5.2.1 Introduction 5.2.2 Cursor In Centre 5.2.3 Find Conics Centre 5.2.4 Gnomonic Centre 5.2.5 Reset x_cen_f, y_cen_f 5.2.6 Input Spot Positions 5.2.7 Read Spots File 5.2.8 Write Spots File 5.2.9 Clear Spots List 5.2.10 Get Background Image 5.3 Show Predicted Pattern 5.3.1 Introduction 5.3.2 Display All Predicted 5.3.3 Display Nodals Only 5.4 X-Distortion Image 5.5 Y-Distortion Image 5.6 Re-Display Normal Image 5.7 Spot Input Parameter Table CHAPTER 6: THE 'FIND ORIENTATION' OPTION 6.1 INTRODUCTION 6.2 Spot Selection 6.2.1 Introduction 6.2.2 Read Spots File 6.2.3 Measure Spots on Image 6.2.4 Use Current Spots 6.3 The Auto-indexing 6.3.1 Introduction 6.3.2 The Procedure CHAPTER 7: THE 'PROCESS' OPTION 7.1 INTRODUCTION 7.2 Processing Options 7.3 Logging Parameter Value Changes 7.4 Changing Parameter Values in Process Mode 7.5 Integration Status CHAPTER 8: THE 'DETERMINE SPOT SIZE' PROCESSING OPTION 8.1 INTRODUCTION 8.2 Spotsize Options Menu 8.3 Control Parameters 8.4 The Procedure 8.5 Looking at the Results 8.5.1 Introduction 8.5.2 Show Spots on Image 8.5.3 Spot Length Histogram 8.5.4 Spot Width Histogram 8.5.5 Accept New Spot Size 8.5.6 Input Another Limit CHAPTER 9: THE 'REFINE ORIENTATION' PROCESSING OPTION 9.1 INTRODUCTION 9.2 Refinement Options Menu 9.3 Match Spots and Refine 9.3.1 Introduction 9.3.2 The Match Spots Option Menu 9.3.3 Display All Predicted 9.3.4 Display Nodals Only 9.3.5 Clear Matches List 9.3.6 Input Matches 9.3.7 Delete Matches 9.3.8 Read Matches File 9.3.9 Write Matches File 9.4 Select, Search and Refine 9.4.1 Introduction 9.4.2 Select Reflections Menu 9.4.3 Display All Predicted 9.4.4 Display Nodals Only 9.4.5 Select by Nodal Index 9.4.6 Select by Nodal h,k,l 9.4.7 Clear Reflections List 9.4.8 Input Reflections 9.4.9 Delete Reflections 9.4.10 Read Reflections File 9.4.11 Write Reflections File 9.5 Nodals Search and Refine 9.6 The Spot Search 9.7 The Refinement Procedure 9.7.1 Introduction 9.7.2 Start of the Procedure 9.7.3 Selecting Parameters to Refine and Refinement Method 9.7.4 Completion of the Procedure 9.8 Auto-refine Plate or Auto-refine Pack 9.9 Writing '.ge' Files CHAPTER 10: THE 'IMPROVE SOFT LIMITS' PROCESSING OPTION 10.1 INTRODUCTION 10.2 Soft Limits Options Menu 10.3 Determining 'dmin' or 'lambda-min' 10.4 Looking at the Results 10.4.1 Introduction 10.4.2 Normalised Histogram 10.4.3 Un-normalised Histogram 10.4.4 Show Results on Image 10.4.5 Accept New Soft Limit 10.4.6 Input Another Limit CHAPTER 11: THE 'INTEGRATE SPOTS' PROCESSING OPTION 11.1 INTRODUCTION 11.2 Integration Options Menu 11.3 The Integration Parameters 11.4 The Integration Procedure 11.5 The 'Integrate Plate' Option 11.6 The 'Examine Last Integration' Option 11.6.1 Introduction 11.6.2 Examine Profiles 11.6.3 Examine Individual Spots 11.6.4 Integration Statistics 11.7 Auto-integrate Pack 11.8 Write Intensities File 11.9 Integration Status 11.10 Bad Spots CHAPTER 12: COMMAND LINE PROCESSING OPTIONS 12.1 INTRODUCTION 12.2 The Processing Options 12.3 General Principles 12.4 The LG_SPOTSIZE Command 12.5 The LG_REFINE Command 12.6 The LG_DMIN Command 12.7 The LG_LMIN Command 12.8 The LG_INTEGRATE Command 12.9 The LG_WRITEINT Command 12.10 The LG_CLEARINT Command 12.11 The LG_READLDM Command 12.12 The LG_WRITELDM Command 12.13 Example of a Processing Command File APPENDIX 1: SETTING UP THE PROGRAM 1.1 INTRODUCTION 1.2 Symmetry Operators File 1.3 Fonts 1.4 Program Modes 1.5 Automatic Parameter Updates 1.6 Compiling and Linking LAUEGEN APPENDIX 2: THE PARAMETERS 2.1 INTRODUCTION 2.2 The Crystallographic/Pack Parameters 2.3 The Current Plate Parameters 2.4 The Extended Integration Related Parameters APPENDIX 3: FILE FORMATS 3.1 INTRODUCTION 3.2 The Parameters File 3.3 The Spot Positions File 3.4 The Spot Matches File 3.5 The Reflections List File 3.6 The Image Files 3.7 The .ge Files 3.8 The Output Intensities File APPENDIX 4: COORDINATE SYSTEMS 4.1 INTRODUCTION 4.2 Scanner Axes for Image Plate 4.3 Scanner Coordinates for Film 4.4 Camera Constants 4.5 Transformations APPENDIX 5: DISTORTION CORRECTIONS 5.1 INTRODUCTION 5.2 Standard Distortion Correction 5.3 Distortion Correction for Radially Scanned Plates 5.4 Polynomial Based Spatial Distortion Correction 5.5 Addition of Centre and Conversion to Rasters APPENDIX 6: THE PLATE CENTRE 6.1 INTRODUCTION APPENDIX 7: FINDING FIDUCIAL POSITIONS 7.1 INTRODUCTION APPENDIX 8: IMAGE BACKGROUND HANDLING 8.1 INTRODUCTION APPENDIX 9: NODAL SPOTS 9.1 INTRODUCTION APPENDIX 10: DETERMINING SPOT POSITIONS 10.1 INTRODUCTION APPENDIX 11: SPATIALLY OVERLAPPED SPOTS 11.1 INTRODUCTION APPENDIX 12: REFINEMENT METHODS 12.1 INTRODUCTION 12.2 The Least Squares Refinement Method 12.3 Powell Minimisation 12.4 The Automatic Refinement Protocol APPENDIX 13: OPENING IMAGE FILES 13.1 INTRODUCTION APPENDIX 14: RADIAL MASKING OPTION 14.1 INTRODUCTION APPENDIX 15: INTEGRATION STATUS WARNINGS 15.1 INTRODUCTION 15.2 Integration Status Check Points 15.3 Exit From Processing Mode 15.4 Quit The Program 15.5 Reset the Program Defaults 15.6 Read a New Parameters File 15.7 Enter the Processing Mode DEMONSTRATION 1: DEMONSTRATION FOR FIRST TIME USERS 1.1 INTRODUCTION 1.2 Preparation 1.3 Section 1: Setting Up (/Saving) Parameters 1.3.1 Introduction 1.3.2 Changing Values in Parameter Table 1 1.3.3 Reading in a Parameters File 1.3.4 Writing a Parameters File 1.3.5 Resetting the Defaults 1.3.6 Other Suggestions 1.4 Section 2: Laue Simulations 1.4.1 Introduction 1.4.2 Colour Coded Display 1.4.3 Interactive Display 1.4.4 Other Suggestions 1.5 Section 3: Displaying/Measuring an Image 1.5.1 Introduction 1.5.2 Inputting Parameters and Displaying the Image 1.5.3 Manipulating the Image 1.5.4 Measuring the Image 1.5.5 Showing a Predicted Pattern 1.5.6 Other Suggestions 1.6 Section 4: Find the Crystal Orientation (Auto-indexing) 1.6.1 Introduction 1.6.2 Preparation 1.6.3 The Auto-indexing 1.6.4 Other Suggestions 1.7 Section 5: Refining the Crystal Orientation 1.7.1 Introduction 1.7.2 Preparation 1.7.3 The Refinement 1.7.4 Writing the '.ge' Files 1.7.5 Other Suggestions 1.8 Other Program Options DEMONSTRATION 2: DEMONSTRATION USING TEST DATA SETS 2.1 INTRODUCTION 2.2 Preparation 2.3 Proflavin Test 2.3.1 Introduction 2.3.2 Setting/Saving the Parameters 2.3.3 Laue Simulations 2.3.4 Display/Measure Image 2.3.5 Find the Crystal Orientation 2.3.6 Refine the Crystal Orientation 2.3.7 Write the '.ge' Files 2.3.8 Improving the Soft Limits 2.3.9 Integrate Spots 2.4 Lysozyme Test 2.4.1 Introduction 2.4.2 Setting/Saving the Parameters 2.4.3 Laue Simulations 2.4.4 Display/Measure Image 2.4.5 Find the Crystal Orientation 2.4.6 Refine the Crystal Orientation 2.4.7 Writing the '.ge' Files 2.4.8 Improving the Soft Limits 2.4.9 Integrate Spots FIGURES: CHAPTER 1 1.1 Main Screen of LAUEGEN FIGURES: CHAPTER 4 4.1 Example of a Colour Laue Simulation 4.2 Example of an Interactive Rotation Simulation 4.3 Example of a Colour Gnomonic Projection FIGURES: CHAPTER 5 5.1 Example of an Image Display (Lysozyme) FIGURES: CHAPTER 6 6.1 Example of an auto-indexing results screen from LAUEGEN FIGURES: CHAPTER 8 8.1 Proflavin Spot Length Histogram 8.2 Proflavin Width Length Histogram FIGURES: CHAPTER 9 9.1 Example of a pop-up frame for selecting refinement parameters FIGURES: CHAPTER 10 10.1 Example of a normalised histogram for a 'dmin' determination FIGURES: CHAPTER 11 11.1 Example of a profile details window 11.2 Example of a scaled pixels plot 11.3 Example of a background subtracted pixels plot 11.4 Example of a scaled spot profile plot 11.5 Example of an integration statistics table FIGURES: APPENDIX 4 4.1 Laboratory and Detector Axes 4.2 Ideal and Detector Axes and Camera Constants 4.3 Film Fiducial Positions FIGURES: APPENDIX 8 8.1 Example of a background image for a Proflavin film, using the 2-Dbackground method FIGURES: APPENDIX 12 12.1 Outline of Automatic Refinement Protocol 12.2 Flowchart of Initial Refinement Phase FIGURES: DEMONSTRATION 2 2.1 Plot of the Proflavin film image 2.2 Plot of the Lysozyme image-plate image CHAPTER 1: OVERVIEW =================== 1.1 INTRODUCTION LAUEGEN is an X-windows based program for carrying out the initial stages of data processing for Laue diffraction images. It has facilities for displaying Laue simulations, displaying film/image-plate images, measuring spot sizes, finding and refining crystal orientations and soft limits and integrating spot intensities. It incorporates the functions of the programs NEWLAUE, SPOTIN and GENLAUE from the Daresbury Laboratory Laue Software Suite. (Campbell et.al. 1987; Helliwell et.al. 1989) and the more recent INTLDM integration program. The program makes use of a library of X-windows based routines, called XDL_VIEW, written by John Campbell at the Daresbury Laboratory (Campbell, 1994a). The program in its original form has been described by Campbell (1994b). It has now been modified to make use of the Laue Data Module (LDM) and related developments (Campbell, Clifton, Harding and Hao, 1994). The program incorporates M. Elder's auto-indexing code from NEWLAUE. Code for handling streaky spots is based on that by T.J. Greenhough and A.K. Shrive (Greenhough and Shrive, 1994). Thanks are given to Dr M.M. Harding and her colleagues at the University of Liverpool for their continuing contribution of ideas and for carrying out user trials of the program. Thanks are also due to Dr D. Nguti for developing the LDM compatible spot finding routine and to Dr Q. Hao for developing the routines used for spot intensity integration. Whilst the primary development of the program focussed on the interactive potential afforded by the use of an X-windows display, more recent developments include more automatic processing procedures to complement the interactive functions. These may prove to be particularly useful when re-processing data with some slighly modified set of parameters. Details of setting up the program can be found in Appendix 1 . In the description of program menus, the menu items available are generally indicated by the menu button label enclosed in angled brackets. e.g. or The user should assume that any prompt/reply sequences take place in the main text input/output window of the program (see below) unless otherwise stated. Errors (or warnings) may either be indicated by messages (to the main text input/output window of the program unless otherwise stated) or pop-up notices; the description 'message' in the text indicates the former and the description 'notice' indicates the latter. Two demonstrations are given to illustrate the use of the program LAUEGEN. List of sections: Introduction to XDL_VIEW Running the Program Screen Layout Some Basic Concepts Outline of the Main Options Command Line Input Cylindrical Cameras References 1.2 INTRODUCTION TO XDL_VIEW XDL_VIEW is a set of X-windows based routines providing 'view-objects' for various functions such as menus, parameter tables, image displays and text input/output. View-objects, which can return data to the calling program, will normally contain an 'active strip'. This indicates whether or not the program is currently awaiting input from that object. It consists of a square at the left hand side and a rectangle at the right hand side, usually stretching across the width of the view-object. When the program is ready to receive input from the menu, then the square is filled with green (or black on a black and white display) and a message is displayed in the rectangle. When the program is not waiting to receive input then both parts of the active strip are cleared. A program may be waiting to receive input from more than one view-object at a time and from different view-objects at different times and hence the reason for indicating to the user the current 'active/inactive' state of any particular view-object. The view-objects are basically designed for use on a colour display but will work, with limitations in some cases, on a monochrome display. For LAUEGEN, a colour display should be used if at all possible and the documentation assumes the use of such a display. Default fonts will normally be used but some user selection is possible (see Appendix 1) . Reference should be made to Volume 1 of the XDL_VIEW documentation to find detailed instructions on how to manipulate the various view-objects used by the program. Note: When running an XDL_VIEW based program such as LAUEGEN, do not attempt to dismiss any of the windows displayed using the window manager options as this will cause the whole program to exit. LAUEGEN is designed so that all windows will be automatically deleted by the program when appropriate. 1.3 RUNNING THE PROGRAM Normally the program may be run by typing the command 'laue lauegen' if it is set up as part of the Laue Software Suite; this will run the program in its normal interactive mode and will prompt for a log file. To run the program in other modes, the program may be run directly with appropriate command line arguments (see Appendix 1) ; the environment variable (logical name) SYMOP must be set to point to the CCP4 symmetry operators file. 1.4 SCREEN LAYOUT The basic screen layout for the program is divided into six areas. Figure 1.1 Main Screen of LAUEGEN (at end of chapter) Top Left A menu area used for selecting the options currently available. The options within a menu are, in general arranged such that the normal order of access would be from the top downwards without necessarily using all the options available. The basic menu structure of the program is hierarchical and most menus have an item at the bottom which returns the program to the previous level with a label such as or . Top Right Parameter table 1. This is an editable parameter table which contains the main crystallographic/pack parameters which relate to the current crystal and are common for all plates of the current pack. Bottom Left Parameter table 3. This area is used at various stages for different tables of parameters relating to the current option selected (e.g. box size and intensity threshold when using the match spots refinement option or spot intensity integration parameters). Middle This area is the main text input/output window. This is used to output textual information from the program when required and also, at some stages, for prompt and reply sequences e.g. for inputting file names. Bottom Right Parameter table 2. This is an editable parameter table which contains parameters relating to the current plate in the current pack being processed. Bottom Middle Command window. This window is for inputting program options and parameters via a command line. LDM parameter values may be input or inspected and the command line processing functions may be invoked. Additional windows e.g. windows for displaying Laue simulations or images are used at various stages of the program. These may be positioned independently of the main program window. Normally they will initially be positioned just to the right of the menu area. In some cases, the program will automatically bring a window to the front to allow user input (e.g. to reply to a question when the text input/output window is covered say by an image display) and then put it back again after the required input has been given. 1.5 SOME BASIC CONCEPTS a) The Parameters The parameters used by the program are basically those of the Laue Data Module (LDM). In fact an extended LDM parameter set specific to LAUEGEN (and INTLDM) is used with new parameters being defined for the intensity integration related steps. They fall essentially into four categories: 1) The crystal parameters such as the crystal system, lattice type, cell parameters, crystal orientation parameters and the resolution limit of the diffraction. 2) The parameters relating to the X-ray and detector system such the wavelength range and the positioning of the detector. 3) The parameters describing the scanned images and the spots on these images such as pixel size, numbers of rasters, spot sizes and area to be processed. Distortion parameters are included. 4) The integration related extended LDM parameters. The dataset and pack specific parameters appear are displayed in parameter table 1 and the plate specific parameters are displayed in parameter table 2. Parameters relating to the current program function are displayed, where required in parameter table 3. Where these belong to the LDM or extended LDM set of parameters they are shown in bold type. In the case of the spot_threshold parameter, this is also displayed in the parameter table 1 and may be changed from either parameter table when appropriate. The parameters used in LAUEGEN are described in Appendix 2 and further details may also be found in the LDM documentation. Laue simulations may be carried out when these parameters have been set as desired. b) Current Pack and Plate The program is designed to allow for processing data from a set of packs of images. Only those parameters for the current pack and plate are displayed at any one time. The current pack and plate may be reset via the two 'current pack' and 'current plate' items at the start of parameter table 1. c) Key Film/Plate For a pack with more than one film/image-plate, one of the films/plates in the pack, normally the first, is considered to be the reference or 'key' film. This film/image plate will be the one used with the auto-indexing option and will be the first one used in refinement of the crystal orientation. It will normally be the first one in the pack though there may be cases where another one is used e.g. because a film is over-exposed or missing. d) Parameter Updates When parameters are updated e.g. via the parameter tables or after a refinement procedure (orientation or soft limits) or spot size determination, the values may be automatically updated for other packs/plates as follows: For pack dependent parameters, values updated for the first pack will be applied to all other packs. For plate dependent parameters, values updated for the key plate (normally the first plate) will be updated for the other plates of the pack. If the pack is also the first pack then the parameters will be updated for all packs and plates. These are the general rules which by default apply to all parameters except w_c and the bulge parameter. The user may change the classes of parameter which will be automatically updated by setting the LAUEGEN_UPD environment variable as described in Appendix 1 . e) Log File By default the program will write a log file named 'lauegen.log'. To obtain a log file with a different name, the user may either set the LAUEGEN_LOG environment variable to the name of the required log file prior to running the program or, when the program is executed, following the program name with the code -l filename ( filenameis the user chosen log file name ). To suppress the output of a log file set the LAUEGEN_LOG environment variable to the string NONE and do not give a log file name via the command line. The log file basically contains information from the program when it is in processing mode when details will also be given of the (extended) LDM parameters on entering the processing mode and of parameter changes between selected processing options. On exiting the program, the current (extended) LDM parameter values are output. f) Program Modes The program is basically designed to be run in three different modes. The most common mode is the (default) interactive mode using the facilities available on an X-windows display. The other two modes are a terminal mode and a batch mode. Commands have been written to carry out some of the processing functions which can also be done interactively. These can also be requested via the programs's command window when running in interactive mode. (See Appendix 1 for how to run the program in these non-default modes) g) Other Considerations A number of other areas which affect the use of the program may need to be considered by the user. These are described in the appendices and include the following: * Coordinate systems * Distortion corrections * File structures * Use of fiducials * Handling of the plate 'centre' * Image background calculations 1.6 OUTLINE OF THE MAIN OPTIONS The following are the main options available in LAUEGEN selectable via options in the program's main menu: a) Setting up the crystallographic/pack/plate parameter tables The parameters in parameter tables 1 and 2 are assigned the LDM default values when the program is started. Individual parameters may be reset by editing the values directly in the parameter table (see XDL_VIEW documentation). A new set of parameters may be read in from a parameters file (LDM) using the 'Read Parameters File' option. When the required parameters have been set up, they may be saved in a parameters file (LDM) for future use using the 'Write Parameters File' option. b) Laue simulations Two basic types of simulations are available, 'colour' simulations and 'interactive' simulations. In each case a window is created with a display area for the simulation, an area to list details of a selected reflection, a control panel and an area used for requesting hard copy (Postscript) output of the simulation. 'Colour' simulations show the show the Laue patterns with the spots colour coded in a number of different ways. 'Interactive' simulations are in black and white and have sliders which allow the user to investigate the effects of changing the lambda-min, lambda-max and dmin soft limits; spot labelling is also available. c) Display/Measure Image This option enables a film or image-plate image to be displayed with options for inputting or determining the image centre, calculating a background image and measuring spot positions. A predicted Laue pattern, based on the current parameters, may also be displayed superimposed on the image. d) Find Orientation This option enables the crystal orientation to be determined by M. Elder's auto-indexing method. The option allows spot positions to be read from a previously generated spot positions file or measured from the image. e) Processing The 'Process' option puts the program into processing mode and the processing menu will be displayed. Currently, the following processing options are available. 1) Determine Spot Size This option enables an automatic search of an image to find spots and to determine suitable spot size parameters to be used in the processing of the data. 2) Refine Orientation This option allows for the refinement of the crystal orientation, first for the key plate of the current pack and then, if required, for other plates in the pack. Options are available for visually matching calculated and observed spot positions or for automatically searching for matches for selected reflections. When the refinement is complete, the .ge1/.ge2 files may be written for use by the integration program. 3) Improve Soft Limits. This option allows for the determination of improved values for the soft limits lambda-min and dmin by measuring integrated intensities for an over predicted pattern and by analysing the resultant intensities as a function of the wavelength or resolution. 4) Integrate Spots. This option allows for the integration of spot intensities in a manner analogous to that of the INTLDM spot intensity integration program based on routines written by Dr Q. Hao. 1.7 COMMAND LINE INPUT In interactive mode, commands may be input via the command window. In terminal or batch modes such commands (read from the terminal or input stream) provide the means by which the program is driven. The command line input is intended mainly for use with non-interactive commands for processing the data. However it has a few additional functions available. These are: a) Type in the command defaultsto reset the program default values for the parameters and internal program flags (this is only valid when not in processing mode). b) Input of LDM parameter Keyword/value pairs. This provides a means of inputting values of LDM parameters which are not displayed in the parameter tables as well as those which are. c) Showing the value of LDM parameters including those not displayed in LAUEGEN's own parameter tables. These are obtained by typing a question mark followed by the LDM keyword for the parameter e.g. ? nxrast For pack/plate specific parameters which are given without an explicit pack or plate specification, the value for the current pack and plate is shown. d) When the main menu is displayed, typing the command processwill put the program into processing mode and in the processing mode, typing the command endwill return the program to the main menu. e) Changing the current pack and/or plate numbers. The command pack or platefollowed by the required pack or plate number respectively is given. These commands may, in particular, be required when running the program in its 'terminal' or 'batch' mode. When the main menu is active the prompt in the command window is > and in processing mode it is process> The command line processing commands are described in Chapter 12 and are as follows: lg_spotsize Determine spot dimensions. lg_refine Refine orientation. lg_dmin Determine 'dmin'. lg_lmin Determine 'lambda-min'. lg_integrate Integrate spot intensities. lg_writeint Write intensities files. lg_clearint Clear intensities list. lg_readldm Read an LDM file. lg_writeldm Write an LDM file. 1.8 CYLINDRICAL CAMERAS The program now incorporates some changes to the LDM routines to enable a cylindrical camera to be used. The formulae for converting between reciprocal lattice coordinates and detector coordinates were provided by C. Wilkinson and M.S. Lehmann at the ILL, Grenoble. It should be noted that some of the formulations used by the program are based on a flat plate detector and do not strictly apply to the cylindrical detector case. These are the use of elliptical masks as described in Appendix 14 and the various distortion corrections as described in Appendix 5 . The spot shape finding routine will be affected by the first of these. In general, best results are likely to be obtained assuming circular spot shapes. Satisfactory orientation refinements have been achieved using cylindrical cameras at the ILL (Neutron Laue) and at the Photon Factory. 1.9 REFERENCES 1) Campbell J.W., Clifton I.J., Elder M., Machin P.A., Zurek S., Helliwell J.R., Habash J., Hajdu J. and Harding M.M. in "Biophysics and Synchrotron Radiation" pp. 53-60, edited by A. Bianconi and A. Congiu Castellano, Springer Verlag (1987) 2) Helliwell, J.R., Habash, J., Cruikshank, D.W.J., Harding, M.M., Greenhough, T.J., Campbell, J.W., Clifton, I.J., Elder, M., Machin, P.A., Papiz, M.Z. and Zurek, S. (1989) J. Appl. Cryst., 22 483-497. 3) Campbell J.W., (1994a) "XDL_VIEW, an X-windows based Toolkit for Crystallographic and Other Applications" (1995), J. Appl. Cryst., 28236-242 4) Campbell J.W., (1994b) "LAUEGEN, an X-windows based Program for the Processing of Laue X-ray Diffraction Data" (1995) J. Appl. Cryst., 28228-236 5) Campbell J.W., Clifton I.J., Harding M.M. and Hao Q. (1994) "A Laue Data Module (LDM) for use in the processing of Laue X-ray Diffraction Data" (1995) J. Appl. Cryst., 28635-640 6) Greenhough T.J & Shrive A.K., (1994); J. Appl. Cryst., 27111-121 Figure 1.1 Main Screen of LAUEGEN CHAPTER 2: THE 'READ PARAMETERS FILE' OPTION ============================================= 2.1 INTRODUCTION This option is used to read in the LDM parameter values for the parameters displayed in the program's parameter tables 1 and 2. When the option is selected, the following prompt is output: File name (default ext=.ldm): The user replies with the name of the required LDM parameters file; if no file extension is given, an extension of .ldm is assumed. A blank reply will cancel the request. The program checks that the file exists and can be opened; if there is an error, an error message will be output and the prompt will be repeated. The data are then read from the file and are checked by the program. Errors will be flagged. Values are reset for all the parameters shown in parameter tables 1 and 2. The LDM parameter value defaults values will be set for all parameters not explicitly given in the LDM data file. The current pack and plate will be set to one. In addition to the data items used by the program, other LDM parameter values will be read in and stored e.g. the film parameters n1od, baseod, g1od etc. Values of such parameters may be inspected or reset via the command window if required. The following points should also be noted: 1) When the 'read parameters file' option is selected, a check is made on the status of any spots currently integrated and a warning is output if any spots have veen integrated but not saved to an output file (for further details see Appendix 15 ). When a new parameters file is read in, the integrated intensities list and associated integration flags are cleared. 2) Default values are reset for all the LDM and extended LDM parameters prior to reading in the new data. Soft limit, spot size determination and spot search box size parameters are also reset to their default values. CHAPTER 3: THE 'WRITE PARAMETERS FILE' OPTION ============================================= 3.1 INTRODUCTION This option is used to write the values for the LDM parameters displayed in the program's parameter tables 1 and 2 to a parameters (.ldm) file to save them for future use. Any undisplayed LDM parameters which have been read in will also be written. When the option is selected, the following prompt is output: File name (default ext=.ldm): The user replies with the name of the required output parameters file; if no file extension is given, an extension of .gen will be added. A blank reply will cancel the request. The program checks that the file does not already exist and that it can be opened; if there is an error, an error message will be output and the prompt will be repeated. If the file already exists, the user is given the option of overwriting the file or selecting an alternative file name. CHAPTER 4: THE 'LAUE SIMULATIONS' OPTION ======================================== 4.1 INTRODUCTION This option allows for the display of Laue simulations based on the current values in parameter tables 1 and 2. When it is selected the following menu is displayed: This allows for the selection of one of two basic modes of display, a colour mode and an interactive mode. In each mode there is a display area for the simulation, an area to list details of a selected reflection, a control panel area and an area used for requesting hard copy (Postscript) prints of the simulations. Normal Laue simulations or Gnomonic projections of the Laue pattern may be displayed in either mode. 'Colour' simulations show the Laue patterns with the spots colour coded in a number of different ways. 'Interactive' simulations are in black and white and have sliders which allow the user to investigate the effects of changing the lambda-min, lambda-max and dmin soft limits; spot labelling is also available. Normally, by default, the Laue simulation view-object will be positioned just to the right of the main menu. It should be noted, however, that parameter table editing is active when Laue simulations are being displayed so that, if required, the Laue simulation display view-object may be moved to allow parameter values to be edited. When a parameter value is changed, the simulation will be recalculated and the new simulation displayed. In general the currently selected view-object options will be unchanged when the new simulation is displayed; however for 'Interactive' simulations it should be noted that if the lambda limits or dmin values are changed then new current values for lambda-min, lambda-max and dmin will be calculated based on the current slider positions; also, for 'Interactive' plots, all labels will be removed. A third option enables the setting of a new crystal orientation in terms based on user specified zones. List of sections: Colour Coded Displays Interactive Displays Gnomonic Projections Set Direction 4.2 COLOUR CODED DISPLAYS When this option is selected, the Laue simulation is displayed as coloured spots displayed on a black background. Various options may be selected via the control panel items. Also, details may be listed for selected spots and hard copy Postscript file plots produced if required. Figure 4.1 Example of a Colour Laue Simulation (at end of chapter) (Note: reproduced there in black and white) Control Panel Options The colour coding depends on the option selected via the Colour coding choice menu on the control panel. The options available are: Wavelength The wavelength range is split into eight ranges which are identified by eight different colours on a scale running from blue (low wavelength) to red (high wavelength). Multiple spots are colour coded by their highest wavelength component. Multiplicity The spots are colour coded by multiplicity as follows: blue: singles cyan: doubles yellow: triples red: multiplicity > 3 Wavelength/Multiplicity The singles are colour coded as for the first option and multiples are colouredwhite. Nodality Non-nodal spots are coloured blue and nodal spots are coloured yellow. The nodal index may be set via the 'Nidx' value item on the control panel and has a default starting value of 4. The 'Spot types' choice menu on the control panel allows the user to choose one of the following three options: * Display 'all' spots i.e. singles and multiples * Display singles only * Display multiples only The display of spatially overlapped spots may be controlled via the 'Spatials' choice menu on the control panel. There are three options: * Display all spots including spatially overlapped spots * Exclude spatially overlapped spots * Display the spatially overlapped spots only The user may select one of three spot sizes, small medium or large for the display via the 'Spot size' choice menu on the control panel. The display, of a key at the top left of the display area showing the colour coding, may be turned on or off via the 'Key' choice menu on the control panel. The nodal index, used in deciding whether or not a spot is a nodal for the plot colour coded by nodality, can be reset via the 'Nidx' value item on the control panel. The value must be in the range 0 to 12. Listing Spot Details When the mouse Button1 is clicked with the cursor on a spot position, details of that reflection will be listed in the reflection details area. The following information is listed: The indices (highest indices component for a multiple) The wavelength (lowest component for a multiple) The multiplicity 1 for a single; for multiples the value is followed by the numbers of the minimum and maximum harmonics present relative to the nodal indices for the spot (numbered from 1 = the fundamental). The coordinates The 'film' xf, yf coordinates in millimetres from the centre of the pattern. The selected spot is marked by a surrounding white circle on the display area. The selection may be removed by clicking Button2 or Button3 of the mouse (or Button1 when the cursor is within the display area but not pointing to a spot. When Button1 is clicked, the nearest spot to the cursor is selected provided that the distance squared (pixels) to the spot is no more than 18. Hard Copy To get a hard copy plot in the form of a Postscript file, select the panel button marked PS in the hard copy request area at the top of the view object. A question and answer sequence is then followed using a panel i/o item to the right of the PS button. Invalid replies will give pop-up error notices. The hard copy output may be abandoned by pressing the Escape key when a prompt is displayed. The question and answer sequence is as follows: Postscript file name: This reply is the name of the output Postscript file. Spot diameter in mm [x.x]: This gives the required spot size for the spots which need not be the same as that on the display. The default value given is an approximate match to that currently being used on the display. The reply must be in the range of 0.1 mm to 10.0 mm. Add key [y]: This enables the user to choose whether (the default) or not to display a key on the output plot. This key, with some additional information describing the nature of the plot, will be output below the actual Laue simulation. Comment: Up to 150 characters of comment may be input. The comment will be automatically split into lines if needed. Note: On monochrome displays, these Laue simulations are of limited use as all the colours in the colour scales are represented by white. However any hard copy requested will have the normal colour representations in it. 4.3 INTERACTIVE DISPLAYS When this option is selected, the Laue simulation is displayed as black spots displayed on a white background. Various options may be selected via the control panel items. These include options to vary the soft limits via sliders, options to highlight various classes of spots and options to label selected reflections. Also, details may be listed for selected spots and hard copy Postscript file plots produced if required. Figure 4.2 Example of an Interactive Rotation Simulation (at end of chapter) Control Panel Options Three panel slider items are present which enable the user to see, in an interactive manner, the effect of varying the soft limits lambda-min, lambda-max and dmin. They were designed for use on colour displays which have 'writeable colour maps'. In fact 50 colours are used on the display with the reflections being colour coded by wavelength or dmin depending on the slider currently selected. The 50 colours are then set to white or black depending on the position of the currently selected slider. If the slider is moved then the display is altered merely by changing the colours in the colour map thus giving a rapid change of pattern as the slider is moved. When changing from one slider to another, it is necessary for the program to perform some additional calculations and to redraw the pattern; it is recommended therefore that, when changing to a new slider, the user should first click Button1 on the grip box of the slider so that the redrawing is done before the new slider is moved. On displays which do not have writeable colour maps and on monochrome displays, the use of the sliders is less effective as the pattern needs to be redrawn each time a slider is moved. The current values for lambda-min, lambda-max and dmin are displayed to the right of their respective sliders. The starting limits and step intervals are defined by the calling program. The 'Highlight' choice menu on the control panel may be used to enable various classes of reflections to be highlighted. The options available are as follows: No highlighting This is the default; all reflections are shown as black spots. Highlight multiples Doubles are indicated by blue vertical crosses; higher multiples are indicated by red stars (on monochrome displays, the corresponding symbols are drawn in black) Highlight nodals Nodal reflections are indicated by red vertical crosses (or black on a monochrome display). The nodal index may be set via the 'Nidx' value item on the control panel and has a default starting value of 4. Note: When spots are highlighted and the soft limit sliders are used, the plot will be redrawn each time a slider is moved. The sliders are best used when no reflections are highlighted. The user may select one of three spot sizes, small medium or large for the display via the 'Symbols' choice menu on the control panel. The nodal index, used in deciding whether or not a spot is a nodal for the plots with nodals highlighted, can be reset via the 'Nidx' value item on the control panel. The value must be in the range 0 to 12. The 'Labels' choice menu allows a number options for labelling. These are: Labels off No labels will be displayed and the labelling facility is currently disabled. Minimum hkl When a spot is labelled and the spot is a multiple, show the indices of the component with the lowest indices. Maximum hkl When a spot is labelled and the spot is a multiple, show the indices of the component with the highest indices. Nodal hkl Show the nodal indices for the spot on the label. If there are labels already displayed when a new labels option is selected, the existing labels will be redrawn as needed. Note: When labels are displayed and the soft limit sliders are used, the plot may be redrawn when a slider is moved. This may because the relevant displayed indices have changed or because a labelled spot has disappeared or reappeared. The sliders are best used when no labels are displayed. Listing Spot Details When the mouse Button1 is pressed with the cursor on a spot position, details of that reflection will be listed in the reflection details area. The following information is listed: The indices (highest indices component for a multiple) The wavelength (lowest component for a multiple) The multiplicity: 1 for a single; for multiples the value is followed by the numbers of the minimum and maximum harmonics present relative to the nodal indices for the spot (numbered from 1 = the fundamental). The coordinates The 'film' xf, yf coordinates in millimetres from the centre of the pattern. The selected spot is marked by a surrounding red circle on the display area (black on a monochrome display). The selection may be removed by clicking Button1 when the cursor is within the display area but not pointing to a spot. When Button1 is pressed, the nearest spot to the cursor is selected provided that the distance squared (pixels) to the spot is no more than 18. The spot details are also listed when a spot is labelled. Labelling Spots Providing that one of the labelling options has been selected via the 'Labels' choice menu, spots may be labelled on the plot as follows: * Move the cursor to the required spot. * Press and hold down Button2 of the mouse. * Move the mouse till the label is in the required position. * Release Button2 of the mouse. A line is drawn from the nearest corner of the box surrounding the label to the labelled spot. When a label is being positioned, this line is shown while the label is near to the spot but if the label is moved far from the spot, then instead of the line, the spot position is marked with a large cross and the label is detached; when Button2 is released, the cross is removed and the attaching line is drawn. * Move the cursor onto the label to be moved. * Press and hold down Button2 of the mouse. Note that when Button2 is pressed, the plot will be redrawn. * Move the mouse till the label is in the required position. * Release Button2 of the mouse. Labels may be deleted as follows: * Move the cursor onto the label to be deleted. * Click Button3 of the mouse. Hard Copy To get a hard copy plot in the form of a Postscript file, select the panel button marked PS in the hard copy request area at the top of the view object. A question and answer sequence is then followed using a panel i/o item to the right of the PS button. Invalid replies will give pop-up error notices. The hard copy output may be abandoned by pressing the Escape key when a prompt is displayed. The question and answer sequence is as follows: Postscript file name: This reply is the name of the output Postscript file. Standard (s) or absolute (a) scale [s]: With standard scaling, the simulation will be 18 cm square. For absolute scaling, the plot will be on the actual scale as determined by the crystal to film distance. If this gives a plot larger than 18 cm square, then a warning message will be given and the plot will be clipped. Spot diameter in mm [x.x]: This gives the required spot size for the spots which need not be the same as that on the display. The default value given is an approximate match to that currently being used on the display. The reply must be in the range of 0.1 mm to 10.0 mm. Symbol size in mm [x.x]: This question is only asked if spots are being highlighted on the current plot. This gives the required size for the symbols to be drawn on the plot; these symbols need not be the same size as those on the display. The default value given is an approximate match to that currently being used on the display. The reply must be in the range of 0.5 mm to 10.0 mm. Use coloured symbols [n]: This question is only asked if spots are being highlighted on the current plot. By default the symbols on the hard copy will be plotted in black but coloured symbols may be requested if desired. Comment: Up to 150 characters of comment may be input. The comment will be automatically split into lines if needed. 4.4 GNOMONIC PROJECTIONS If desired, the Laue simulations may be displayed in the form of gnomonic projections. This is a view of the reciprocal lattice from the origin and projected on to a plane. For a given Laue spot on a detector normal to the X-ray beam, let the angular coordinates be (2*theta, beta) where theta is the Bragg angle and beta is the azimuthal angle. The gnomonic projection transforms the coordinates to (pi/2-theta, pi+beta) and represents them on a plane normal to the X-ray beam. For convenience of visualisation, the projections from LAUEGEN are inverted through the centre of the plot so that a spot in the projection is plotted on the same side of the centre as the corresponding Laue reflection. Note that spots on the OUTSIDE of the Laue plot correspond to spots on the INSIDE of the gnomonic projection. Figure 4.3 Example of a Colour Gnomonic Projection (at end of chapter) (Note: reproduced there in black and white) When producing a gnomonic projection, it is necessary to select a minimum radius (Gnomonic 'rmin' in parameter table 3) from the Laue plot. The scaling is done (projection distance calculated) such that spots at this distance in the normal Laue pattern will be transformed to be at the boundary distance (LDM 'rmax' parameter) from the projection (i.e. spots just outside the minimum circle are mapped to spots just inside the boundary circle of the plot). The initial value for the Gnomonic 'rmin' parameter is set the first time the Laue simulations option is invoked. It is set to (rmax/10.0) and if this is less than the current value of 'rmin' then it is set to (rmin). The user may change this value as desired via the parameter table. The value is retained unless a new LDM parameters file is read in or the program defaults are reset. Note also that gnomonic projections may only be produced if the detector is normal the the X-ray beam i.e. the 'detector tilt' parameter must be 0.0 degrees or, for back reflection Laue, 180.0 degrees. 4.5 SET DIRECTION This option enables the user to define a new cystal orientation for the simulation based on the choice of one or two crystal zones. When the option is selected, the following prompt/reply sequence is entered via the main I/O window: Indices for zone along beam: The reply gives the three indices (separated by spaces) of the zone which is to be oriented along the beam direction. Define zone to lie in XZ plane (y/n) [n]: The reply is 'y' if a second zone direction is to be defined or 'no' (the default) if no further zone direction is to be defined. If defined, the orientation which puts the specified zone in the XZ plane (the plane defined by the beam and rotation axes (see also Appendix 4) ) is selected. Indices for zone: This question is only asked if the reply to the previous question was 'y'. The three indices of the zone which is to lie in the XZ plane are input separated by spaces. The program will then calculate and set the new missetting angles 'phix', 'phiy' and 'phiz'. If a simulation is currently displayed a new pattern will automatically be calculated and the display updated. Note that the spindle angle retains its current value. Figure 4.1 Example of a Colour Laue Simulation Figure 4.2 Example of an Interactive Rotation Simulation Figure 4.3 Example of a Colour Gnomonic Projection CHAPTER 5: THE 'DISPLAY/MEASURE IMAGE' OPTION ============================================= 5.1 INTRODUCTION This option enables a film or image-plate image to be displayed with options for inputting or determining the image centre, calculating a background image and measuring spot positions. Figure 5.1 Example of an Image Display (Lysozyme) (at end of chapter) A predicted Laue pattern, based on the current parameters, may also be displayed superimposed on the image. The option is available from the processing menu and during parameter refinement as well as from the main menu. When the option is selected, the following menu is displayed: The program first checks that at least one pack has has been defined; if it has not, a pop-up error notice will be displayed and the program will return to the previous menu when its 'continue' box has been selected (e.g. the main menu if the option was called from that menu). A film/plate centre for spot position determination is determined from the position of the fiducials or from the defined centre position. The image is read in at this stage if this has not already been done and the image is then displayed in an image view-object. The centre position is marked on the displayed image. The options which may be selected from the menu are described in detail in the next sections. List of sections: Measure Image Show Predicted Pattern X-Distortion Image Y-Distortion Image Re-Display Normal Image Spot Input Parameter Table 5.2 MEASURE IMAGE 5.2.1 Introduction When this option is selected any spots currently in the input spots list are marked on the image display and another menu is displayed: The first four options are concerned with the measurement of the centre position of the image, options five to eight with the measurement of spot positions and option nine with the calculation of a background image. When the required measurements have been performed, the user returns to the previous menu by selecting the option. If the current film/plate is not the same as the last one measured then the spot positions list will start clear. The measurement options are described in the following sections. List of subsections in this section: Cursor In Centre Find Conics Centre Gnomonic Centre Reset x_cen_f, y_cen_f Input Spot Positions Read Spots File Write Spots File Clear Spots List Get Background Image 5.2.2 Cursor In Centre The symbol for the current spot measurements centre position is cleared from the display. The message 'Input Centre Position' is output to the active strip area of the image view-object and the user moves the cursor to the required centre position (on the main image or on the magnifying window) and clicks Button1 of the mouse to input that position. The new centre position is marked by a symbol on the display. A pop-up notice asks the user whether the x_cen_f and y_cen_f centre position parameters are to be updated and the x_c and y_c camera constants reset to zero. If the answer is yes then the parameter values will be changed for the current pack and plate and also, if appropriate, for other packs and plates (see Chapter 1 and Appendix 1 ). If the answer is no then the new centre centre position is only used for the measurement of spot positions; x_cen_f, y_cen_f, x_c and y_c may be updated at a later stage using the option if required. 5.2.3 Find Conics Centre This option enables the determination of a Laue diffraction pattern centre from the intersection of three or more zone conics. At least five spot positions from each conic must be input by the user. When the option is selected, all current symbols are cleared from the display. Spot input parameters are then set in parameter table 3 (section 5.7) . The following menu is then displayed: The message 'Input Conic 1' is displayed in the image active strip area. Spot positions should then be input for the first conic (Error notices will be displayed if there are any problems encountered when trying to determine a spot position). When at least five spot positions have been input (move cursor to spot position (on the main image or on the magnifying window) and click Button1 of the mouse), the conic may be calculated by selecting the menu option.The program will then fit a conic to the measured spots using a least squares procedure;if a singular matrix is found, an error message will be output; the user may then choose to input more spots for the current conic or to remove that conic. The process is then repeated for further conics. After at least three conics have been determined, the position of the centre of the Laue pattern may be calculated as the point of intersection of the conics by selecting the option. The program uses the image mid point as an estimate of the centre and refines the position using the Powell minimisation routine from the Laue library. The determined centre position is output and the user is given the choice of accepting or not accepting the result. If, during the input of spot positions of a conic, the user wishes to clear the spot selection for that conic, the the option may be selected; the user may then repeat the input for the same or for an alternative conic. When finding the conics centre, warning messages will be output if the current program limits, for the number of conics and spots per conic, are exceeded. If the new centre position has been accepted then a pop-up notice asks the user whether the x_cen_f and y_cen_f centre position parameters are to be updated and the x_c and y_c camera constants reset to zero. If the answer is yes then the parameter values will be changed for the current pack and plate and also, if appropriate, for other packs and plates (see Chapter 1 and Appendix 1 ). If the answer is no then the new centre centre position is only used for the measurement of spot positions; x_cen_f, y_cen_f, x_c and y_c may be updated at a later stage using the option if required. 5.2.4 Gnomonic Centre This option enables the determination of a Laue diffraction pattern centre by using the fact that, in gnomonic projection, the zone conics transform into straight lines. If an incorrect centre is used in the transformation, the lines become bent; thus by minimising the distance (in gnomonic projection) of a spot somewhere in the middle of the conic from the line joining two spots near two 'ends' of the conic a centre position can be refined. To get a good centre, several conics passing through the centre and surrounding the centre should be used. The program requires a minimum of three such conics to be defined. Three spots are selected for each conic; the first should be near the centre, the second about halfway round the conic and the third where the conic nears the centre again. When the option is selected, all current symbols are cleared from the display. Spot input parameters are then set in parameter table 3 (section 5.7) . details). The following menu is then displayed: Messages in the image active strip area indicate which spot is to be input e.g. 'Input Conic 1 start spot', 'Input Conic 1 middle spot', 'Input Conic 1 end spot' etc. (Error notices will be displayed if there are any problems encountered when trying to determine a spot position). After the sets of three spots for at least three conics have been determined, the position of the centre of the Laue pattern may be calculated by selecting the option. The program uses the image mid point as an estimate of the centre and refines the position using the Powell minimisation routine from the Laue library. The determined centre position is output and the user is given the choice of accepting or not accepting the result. If, during the input of spot positions of a conic, the user wishes to clear the spot selection for that conic, the the option may be selected; the user may then repeat the input for the same or for an alternative conic. When finding the gnomonic centre, warning messages will be output if the current program limit, for the number of conics, is exceeded. If the new centre position has been accepted then a pop-up notice asks the user whether the x_cen_f and y_cen_f centre position parameters are to be updated and the x_c and y_c camera constants reset to zero. If the answer is yes then the parameter values will be changed for the current pack and plate and also, if appropriate, for other packs and plates (see Chapter 1 and Appendix 1 ). If the answer is no then the new centre centre position is only used for the measurement of spot positions; x_cen_f, y_cen_f, x_c and y_c may be updated at a later stage using the option if required. 5.2.5 Reset x_cen_f, y_cen_f If this option is selected, then the currently displayed centre position for spot positions determination will be used to update the x_cen_f and y_cen_f parameters and will also set the x_c and y_c parameters to zero. The parameter values will be changed for the current pack and plate and also, if appropriate, for other packs and plates (see Chapter 1 and Appendix 1 ). 5.2.6 Input Spot Positions Spot input parameters are set in parameter table 3 (section 5.7) . The following menu is then displayed: When the menu item is selected, the program is in 'Add Spots' mode and the message 'Input Spot Positions' is displayed in the active strip of the image view-object. Any spots currently in the spots list will be marked by red crosses on the image display. New spot positions are input by moving the cursor to the required spot position on the image display (on the main image or on the magnifying window) and clicking Button1 of the mouse. When a spot position is selected, it will be marked by a red cross on the display. A warning message will be output when the program's spot list is full. Error notices will be displayed if there are any problems encountered when trying to determine a spot position. To delete spots, select the menu item, move the cursor to the symbol of the spot to be deleted (again on the main image or on the magnifying window) and click Button1 of the mouse. (The selected spot nearest to the cursor will be deleted provided that the distance squared from the cursor to symbol on the main image display area does not exceed 18). To input further spot positions, select the item from the menu. When all the required spots have been input, select the menu item. Note that the spots input list is cleared either when a new film/image-plate pack is input or when the film/plate number has been changed since the previous menu item selection or when it is cleared explicitly (see below) . 5.2.7 Read Spots File This option is used to read in spot positions from a file. If there are already spots in the current spots list then the user is given the choice of adding the spots from the read in file to those currently in the list or of overwriting the current spots. Again the user is given the choice of whether or not to use the measured centre from the file to replace the current spot positions centre; if not the current spot positions centre is used. The user is then prompted for the spots file name as follows: File name (default ext=.spots): The user replies with the name of the required spot positions input file; if no file extension is given an extension of .spots is assumed. A blank reply will cancel the request. The program checks that the file exists and can be opened; if there is an error, an error message will be output and the prompt will be repeated. The file will then be read; if it does not start with the keyword 'spots:' an error message will be output and the file name prompt will be repeated. The spot positions will then be read with any invalid records being flagged. A warning message will be output if the program's spot list becomes full. When the file has been read, the number of spots added to the spots list will be shown (and the number of input errors if there were any). Symbols will be drawn on the film image for the centre position and for all the spots currently in the spots list. 5.2.8 Write Spots File This option is used to write the current list of spot positions to a file. If there are no spots in the current spot positions list, an error notice will be displayed and the option abandoned. Otherwise the following prompt is output: File name (default ext=.spots): The user replies with the name of the required output spots file; if no file extension is given an extension of .spots will be added. A blank reply will cancel the request. The program checks that the file does not already exist and that it can be opened; if there is an error, an error message will be output window and the prompt will be repeated. If the file already exists, the user is given the option of overwriting the file or selecting an alternative file name. The spots input centre position and the spot positions are then written to the requested file. 5.2.9 Clear Spots List When this option is selected, the current spot positions list is cleared. 5.2.10 Get Background Image This option is used to calculate a new background image for the current film/plate. When the option is selected the following menu is displayed: <2-D Search> This enables one of three background image calculation methods to be invoked. When a background image has been calculated, it will remain in use until another plate is selected. a) 2-D Search This background image calculation is for single crystal X-ray diffraction images (i.e. one with spots over a fairly slowly changing background. The method calculates the background at a pixel by taking the average of the lowest pixel values in a box surrounding the pixel such that the number of such values is a requested percentage of the total number of pixels in the box. To optimise the calculation, the box is 'walked' through the image moving a pixel at a time starting at the top left. It then repeats the process of moving from to bottom, then one pixel to the right, then from bottom to top, and then one pixel to the right until the film image has been covered. The calculation is done on the compressed image as displayed in the image view-object. When the option is selected the following prompt/reply sequence is entered: Box size (compressed pixels - odd) [11]: The reply is the required size of the square box to be used in calculating the background value at each pixel position. The size is in pixels for the compressed image. The Percentage of background pixels [50]: The reply is the percentage of the pixels within the box which are to be used in calculating the background value for the current pixel. Messages will be output when the background calculation is started and when it is completed. An error message will be output if the selected box size is too large for the displayed image and the calculation will be abandoned. An example of such a background image (for a Proflavin film) is shown in the figure at the end of Appendix 8 . b) Radial X Strip This background image calculation is for single crystal X-ray diffraction images (i.e. one with spots over a fairly slowly changing background. The method calculates the background at a pixel by taking the average of the lowest pixel values in a box surrounding the pixel such that the number of such values is a requested percentage of the total number of pixels in the box. The background values are found for a horizontal (along 'xd') strip of pixels running through the centre of the image and the values from the two halves of the strip are averaged to give a radially averaged background function from which a background image is calculated. The calculation is done on the compressed image as displayed in the image view-object. When the option is selected the following prompt/reply sequence is entered: Strip width (compressed pixels - odd) [21]: The reply is the required width ('yd' direction) of the strip (and box size) to be used in calculating the radial background function. The size is in pixels for the compressed image. Percentage of background pixels [50]: The reply is the percentage of the pixels within the box which are to be used in calculating a background value. Messages will be output when the background calculation is started and when it is completed. An error message will be output if the selected box size is too large for the displayed image or if the program is unable to allocate some extra temporary memory that it requires and the calculation will be abandoned. c) Radial Y Strip This is analogous to the 'Radial X Strip' option except that the strip taken is in the vertical direction (along 'yd') instead of the horizontal direction. 5.3 SHOW PREDICTED PATTERN 5.3.1 Introduction This option enables a predicted Laue pattern based on the current parameters in parameter tables 1 and 2 to be overlaid on the displayed image. The program first generates the predicted pattern (if this has not already been done for the current parameter values) and determines the film/plate centre position. Normally all predicted reflections will be displayed by default; however there is a program limit on the number of predicted reflections which may be displayed on an image and if this is exceeded selected nodals will be displayed instead; in this latter case a prompt will request the user input of a nodal selection index (see description of the <Display Nodals Only> option). When a pattern is displayed, all current corrections, such as centre offsets and distortion parameters, will be applied to the get the predicted spot positions. The following menu will then be displayed allowing the user to change the selection of predicted reflections to be displayed: The options are described in the following sections. List of subsections in this section: Display All Predicted Display Nodals Only 5.3.2 Display All Predicted When this option is selected all predicted reflections will be displayed provided that the number does not exceed the program maximum for the number of predicted reflections which may be displayed on an image. If this number is exceeded an error notice will be displayed and the option will be abandoned. Nodal spots will be shown as blue crosses and non-nodal spots as green crosses. (See also Appendix 9 ) 5.3.3 Display Nodals Only The program will calculate the nodal reflections (up to a program maximum nodal index - see Appendix 9 ) and output a histogram showing the number of nodal reflections as a function of nodal index. The following prompt is then output: Nodal spot selection index [4]: The reply is the required index for the selection of the nodal spots to be displayed. An error message will be output and the prompt repeated if the given value is outside the allowed range. If the number of spots is greater than the program limit for the number of possible spots to be used in a refinement, then the selected spots list will be truncated and a warning notice displayed. The selected nodal reflection positions will be overlaid on the displayed image as blue crosses. 5.4 X-DISTORTION IMAGE If this option is requested, an image is created showing the x-distortion at each point of the image calculated using the current values of the distortion parameters. The image is compressed as for the normal image display in the main image display area. The pixel values represent the distortion in units of 1/100 rasters e.g. 500 is equivalent to 5 rasters. The user defined colour map is set so that there is a range of colours blue ... green ... yellow ... orange ... red going from low to high. Points outside the valid range for correction are shown with a pixel value of zero. 5.5 Y-DISTORTION IMAGE This is the same as the previous option except that the y-distortion at each point of the image is shown. 5.6 RE-DISPLAY NORMAL IMAGE After displaying a distortion image, selecting this option enables the normal image display to be shown again. 5.7 SPOT INPUT PARAMETER TABLE When input spot positions are to be measured, the following parameters are output to parameter table 3: Spot method: Spot box (mm): Spot threshold: The spot may be either 'c_of_g' to measure the spot centre of gravity within the specified spot measurement box (see also Appendix 10 ) or 'input' to use the cursored input position directly. The spot box size in mm defines the size of a box centred at the input cursor position and used when finding the spot centre of gravity position; when finding such a position only pixels whose intensities exceed the background value at the box centre position by the requested spot threshold value are considered. The spot box size retains its current value unless a) it is modified via this parameter table in one of the 'Display/measure image' options or in the 'Refine orientation' option 'match spots and refine' where it is called the 'match box' (see Chapter 9) . or b) when a new LDM parameter file is read; in this latter case the value is set to 1.0 mm which is also the program's initial value. or c) when the program parameter defaults are reset. The spot threshold value is the same parameter as that given as the LDM parameter 'spot thresh' in parameter table 1 and the value in that parameter table will be updated if it is changed via parameter table 3 which provides the only means of update at this stage of the processing. Figure 5.1 Example of an Image Display (Lysozyme) CHAPTER 6: THE 'FIND ORIENTATION' OPTION ======================================== 6.1 INTRODUCTION This option allows for the determination of the crystal orientation using the auto-indexing method developed by M. Elder. Nodal spot positions used in the determining the orientation may be read in from a previously prepared spots file or may be measured from the film/image-plate image. If the current plate is not the key plate the program will reset it to be that after displaying a warning notice. When the option is selected the following menu is displayed: List of sections: Spot Selection The Auto-indexing 6.2 SPOT SELECTION 6.2.1 Introduction The spot selections menu gives the user three means of setting the required nodal spot positions before entering the auto-indexing procedure itself. These are described in the following sections. List of subsections in this section: Read Spots File Measure Spots on Image Use Current Spots 6.2.2 Read Spots File This lets the user read in a set of spot positions from a previously prepared spot positions file (e.g. from the program's Display/Measure option). The user is then prompted for the spots file name as follows: File name (default ext=.spots): The user replies with the name of the required spot positions input file; if no file extension is given an extension of .spots is assumed. A blank reply will cancel the request. The program checks that the file exists and can be opened; if there is an error, an error message will be output and the prompt will be repeated. The file will then be read; if it does not start with the keyword 'spots:' an error message will be output and the file name prompt will be repeated. The spot positions will then be read with any invalid records being flagged. A warning message will be output if the program's spot list becomes full. When the file has been read, the number of spots read will be shown. Provided that some spots were found the auto-indexing procedure will then be entered. 6.2.3 Measure Spots on Image When this option is selected, the program first checks to ensure that at least one pack has been defined; if it has not, an error notice will be displayed and the option will be abandoned. A film/plate centre for spot position determination is determined from the position of the fiducials or from the defined centre position (see Appendix 6 for further details). The image is read in at this stage if this has not already been done and the image is then displayed in a image view-object. The centre position is marked on the displayed image together with any spots currently in the input spots list. The following menu is then displayed: The first three options are concerned with the measurement of the centre position of the image, options four to seven with the measurement of spot positions and option eigth with the calculation of a background image. When the required measurements have been performed, the user returns to the previous menu by selecting the option. If the current plate is not the same as the last one measured then the spot positions list will be cleared. The options are the same as those available via the option of the main menu and are described in detail in the documentation of that option (see Chapter 5 ) 6.2.4 Use Current Spots If there is already a list of input spot positions held within the program e.g. from using the option of the main menu then these can be used for the auto-indexing by selecting the item. 6.3 THE AUTO-INDEXING 6.3.1 Introduction Having selected the required nodal spots, the auto-indexing procedure is then entered and carried out as described below. List of subsections in this section: The Procedure 6.3.2 The Procedure Once the required nodal spot positions have been input, using one of the options described above, the auto-indexing procedure is entered. The program checks that at least three spot positions have been input; if not, an error notice will be displayed and the current attempt at auto-indexing will be abandoned. The following prompt/reply sequence is then entered: Limit of h**2+k**2+l**2 (max=40) [10]: The reply is the maximum value of h**2 + k**2 + l**2 for the set of nodal spots between which angles are to be calculated. (use a higher value than the default if the lattice is centred or if solutions cannot be found) Error in spot positions (mm) [0.5]: The reply is an estimate of the error in the measured spot positions which are to be used in the auto-indexing procedure. A message is then output to indicate that the program is pre-calculating the angles between the low index reflections. If the number of spot positions input exceeds the maximum which may be used by the program for auto-indexing then a warning notice will be displayed and the number of spots used will be truncated to this maximum value. The program then matches the angles between the calculated nodal spot positions and the angles between the observed spot positions to find possible solutions for the orientation. The procedure will be truncated if a program limit for the maximum number of allowed solutions is exceeded and an error notice will be displayed; this will normally only happen if the index limits and estimated spot position errors are given excessively large values. For each solution found, the angles are given an initial refinement. If no valid solutions have been found, an error notice will be displayed and a pop-up notice will give the user the choice of retrying the auto-indexing with different limits (of index limits and errors in spot positions) or abandoning the auto-indexing. Otherwise the solutions are sorted in increasing order of rms deviation between the observed and calculated angles i.e. with the best solutions first. A new 'auto-indexing screen' is then displayed. This has a base frame containing three view-objects - a menu area at the left hand side, a text table at the top right hand side and an input/output window at the bottom right hand side. The functions available via this screen allow for the examination and selection of the auto-indexing solutions. Figure 6.1 Example of an auto-indexing results screen from LAUEGEN (at end of chapter) Details of the best solutions (up to 10 in number), i.e. those with the lowest rms values after their initial angle refinements, are shown in the text window. The items listed for each solution are the solution number (from 1 upwards), the missetting angles PhiX, PhiY, PhiZ and un-refined and refined rms values. The number of 'best result' solutions, i.e. those with the maximum number of matches between calculated and observed angles, and the number of matches found for these solutions are output at the bottom of the table. The menu in the auto-indexing screen menu area has the following options: The first and third options are for changing the number of the pack which is to be processed. The second option initiates the spot determining procedure itself. 8.3 CONTROL PARAMETERS A few parameters are required to control the spot search and spot size determining procedure. These are displayed in parameter table 3. Normally the default values should be satisfactory. Threshold factor: The spot search routine Uses pixels more than THRESHFAC*background above the local background value as being pixels which belong to spots. The default value is 2.0. No. of angle bins: The spot size analysis is carried out as a function of angle around the normal to the image centre though only one length and width parameter is ultimately selected. This parameter determines the number of bins to be used in the analysis. The default value is 12 and the maximum allowed number of bins is 64. Std Dev cutoff: The number of standard deviations from mean spot dimension for which spots are eliminated as being too small or too big to be non-overlapped and non-spurious. The default value is 3.5. Expand by: This is the factor by which the average spot dimensions (for all the accepted spots) are to me multipled to give recommended spot dimensions for use in the processing of the data. The default value is 1.5. These parameters are reset to their default values if the program parameter defaults are reset or a new LDM parameters file is read in. 8.4 THE PROCEDURE When the 'Determine Spot Size' option is selected, the required image is read if it is not currently stored. A 2-D background image is calculated (see Chapter 5 ) using a box size of around 1/25'th the height of the displayed image and a percentage of pixels in the box to be considered as background of 50. The area used for the spot search is based on the rmin, rmax, xlow, xhigh, ylow and yhigh parameters with an additional exclusion region being applied to each of them. This is to try and avoid finding spurious spots near the centre of the image or its egdes and to ensure that the background determining boxes are all within the useable region of the image. The width of the additional exclusion region corresponds to half the size of the diagonal of the background determining box size. This routine is used to find the Laue spot positions in an image stored in memory. The pre-calculated background image is passed to the spot search routine and the routine searches for pixels at the required threshold level above background to determine those pixels which are presumed to belong to spots. The routine continuously updates the spot position by updating the calculation of its centre of gravity as the spot is built up from contiguous above threshold pixels. At the same time as the spot is being built up, a rotated image of the spot is also being built up along the horizontal axis so that the spot length is just determined as the horizontal extent of the finished spot and the spot width as the vertical extent of the rotated spot. A list of spot details is stored in an in-memory spot list. The spot search routine was written by Dr D. Nguti and is based on that used in the IMSTILLS program of the MOSFLM oscillation data processing package. When the spots have been found, the spot list is analysed again using routines written by Dr Nguti. This rejects spots which are likely to be spurious (e.g. overlapped) and analyses the spot dimensions as a function of angle around the image centre. Once the analysis is complete, proposed values are output to the main I/O window for the spot length and spot width parameters. The full analysis details are also written to the log file (if present). 8.5 LOOKING AT THE RESULTS 8.5.1 Introduction When the spot size analysis has been completed, the results may be examined and the proposed values or other user selected values may be used to reset the spt length and spot width parameters. The 'Spot Size Results Menu' has the following items: The first option shows the positions of the found spots overlayed on the image. The second and third options display the results of the angular analyses of the spot lengths and widths. Options four and five enable the updating of the spot size values value. The options are described in the following sections. If the 'Return to Previous Menu' option is selected without having updated the current spot size values, then a popup notice warns the user of this fact an gives the option of returning to the current menu to update the values or returning to the previous menu without making a change to the current values. List of subsections in this section: Show Spots on Image Spot Length Histogram Spot Width Histogram Accept New Spot Size Input Another Limit 8.5.2 Show Spots on Image This option enables the position of the found spots to be shown superimposed on the image from which they were determined. The determined spot positions are marked by red crosses. The image remains displayed until either a histogram is displayed or a return is made from the 'Spot Size Results' Menu. 8.5.3 Spot Length Histogram This option displays a histogram of the determined spot length as a function of angle around the image centre. The bold line at the top of each histogram bar indicates the value after applying the spot expansion factor. The lower line across the bar indicates the average spot length value as actually determined. The blue line across the histogram indicates the proposed single value for the spot length parameter. Figure 8.1 Proflavin Spot Length Histogram (at end of chapter) 8.5.4 Spot Width Histogram This option displays a histogram of the determined spot width as a function of angle around the image centre. The bold line at the top of each histogram bar indicates the value after applying the spot expansion factor. The lower line across the bar indicates the average spot width value as actually determined. The blue line across the histogram indicates the proposed single value for the spot width parameter. Figure 8.2 Proflavin Width Length Histogram (at end of chapter) 8.5.5 Accept New Spot Size If this option is selected then the determined values for the spot length and spot width parameters will be accepted as the new values for those parameters. The values will be updated in the parameter table 2 and for subsequent plates and packs if appropriate. 8.5.6 Input Another Limit Prompts are output requesting the values to be used for the spot length and spot width parameters and the input values will be accepted as the new values for these parameters. The values will be updated in the parameter table 2 and for subsequent plates and packs if appropriate. Figure 8.1 Proflavin Spot Length Histogram Figure 8.2 Proflavin Width Length Histogram CHAPTER 9: THE 'REFINE ORIENTATION' PROCESSING OPTION ===================================================== 9.1 INTRODUCTION This option allows for the refinement of the crystal orientation, first for the key plate of the pack and then, if required, for other plates in the pack. Options are available for visually matching calculated and observed spot positions or for automatically searching for matches for selected reflections. When the refinement is complete, the .ge1/.ge2 files may be written for use by the integration program INTLAUE. When the option is selected, a check is made to ensure that at least one pack has been defined; if it has not then an error notice will be displayed and the option will be abandoned. Otherwise the current plate is set to be the key plate if this is not already the case. The refinement of this key plate must be completed before attempting to carry out refinements for other plates in the pack. List of sections: Refinement Options Menu Match Spots and Refine Select, Search and Refine Nodals Search and Refine The Spot Search The Refinement Procedure Auto-refine Plate or Auto-refine Pack Writing '.ge' Files 9.2 REFINEMENT OPTIONS MENU The 'Refinement Options Menu' is then output as follows: The first option enables the current pack number to be reset to the first pack. The second option is the same as that available from the main menu and is described in Chapter 5 . The next three options are methods for selecting the calculated and observed spot positions to be used in the refinement of the crystal orientation followed by the refinement procedure itself. The remaining options allow for the use of more automated refinement protocols, for the writing of .ge files as required by the spot intensity integration program INTLAUE and for moving on to the next plate or pack. The refinement specific options are described in detail in the sections below: If the current predicted pattern is close to the observed pattern, the the user will normally use the option; this enables the selection of reflections, to be used for the refinement, based on the choice of a nodal index; the program then searches for the observed spot positions within a box centred at the predicted position and uses the predicted/observed spot positions as the basis of the refinement. Alternatively the user may wish to try the or option; however, at this stage in its development, it may not necessarily produce as good results as doing refinement cycles manually with the user choosing which parameters to refine and how many spots to use on each cycle and choosing how many cycles to carry out. If there is not a close match between the predicted and observed spot positions then the option should be used to manually select pairs of predicted and observed spot positions to be used in an initial refinement; subsequently the option may be used when a closer pattern match has been obtained. In some cases the simple selection of reflections for searching based on nodal index may not be adequate for various reasons; the option enables more control over the reflections list allowing for example the reflections list to be expanded or for 'rogue' reflections to be deleted. 9.3 MATCH SPOTS AND REFINE 9.3.1 Introduction The program will first calculate the Laue pattern based on the current parameter values if this has not already been done. The following parameters are then set in parameter table 3: Match box (mm): Spot threshold: The items give the size of box and an intensity threshold above background used when determining a spot position using a centre of gravity method (see Appendix 10 and also Chapter 5 ). A film/plate centre, for spot position determination, is determined from the position of the fiducials or from the defined centre position (see Appendix 6 ). The film/image-plate image is read in at this stage if this has not already been done and the image is then displayed in a image view-object. Normally all predicted reflections will be displayed on the image by default; however there is a program limit on the number of predicted reflections which may be displayed on an image and if this is exceeded selected nodals will be displayed instead; in this latter case a prompt will request the user input of a nodal selection index (see description of the <Display Nodals Only> option below). List of subsections in this section: The Match Spots Option Menu Display All Predicted Display Nodals Only Clear Matches List Input Matches Delete Matches Read Matches File Write Matches File 9.3.2 The Match Spots Option Menu The 'Match Spots Options Menu' is then displayed with the following items: The first two options control which predicted spot positions are to be shown overlaid on the image. When the option is selected the spot matches list is automatically cleared. If the user wishes to redo the current input of matches then the list can be cleared using the third option. Options four and five allow for adding or deleting matches to/from the current matches list. Spot matches may also be written to a spot matches file or read from a previously generated spot matches file. When all the required matches have been input, the user selects the option and the refinement procedure itself will be entered. The options from the 'Match Spots Options Menu' are described in detail in the following sections. 9.3.3 Display All Predicted For further details, see the description of the option of the main menu option (Chapter 5 ). 9.3.4 Display Nodals Only For further details, see the description of the option of the main menu option (Chapter 5 ). 9.3.5 Clear Matches List This option clears all pairs of calculated and observed spot positions from the current spot matches list. The symbols indicating the matches are removed from the image display. 9.3.6 Input Matches The message 'Input predicted position of matching pair' is output to the active strip of the image view-object. The user may then select pairs of equivalent predicted and observed positions to be used in the refinement. To select a predicted spot, move the cursor to the spot symbol (on the main image or on the magnifying window) and click Button1 of the mouse. (The selected spot nearest to the cursor will be selected provided that the distance squared from the cursor to symbol on the main image display area does not exceed 18). The predicted spot position is indicated by a red cross. The message 'Input observed spot position of matching pair' will then be displayed in the image active strip. The observed spot position is then input by moving the cursor to the required spot position (on the main image or on the magnifying window) and clicking Button1 of the mouse. The spot position will be determined by a centre of gravity calculation using the box size and intensity threshold values from parameter table 3 (note that the spot threshold parameter is the same parameter as that given as the LDM parameter 'spot thresh' in parameter table 1 and the value in that parameter table will be updated if it is changed via parameter table 3 which provides the only means of update at this stage of the processing). Error notices will be displayed if there are any problems encountered when trying to determine a spot position. When the observed spot position has been determined, it is marked by a red box. A warning notice will be output when the program's spot matches list is full. A spot match will only be added to the list of spot matches when both the predicted and observed positions have been successfully input. When the input of a match has been completed, the program will be ready for another match to be input if required. Selection of the , , or option from the menu will switch off the spot matches input mode. 9.3.7 Delete Matches When this option is selected, the message 'Input predicted position of matching pair to delete' will be written in the active strip of the image view-object. To delete a spot match, move the cursor to the symbol of the predicted spot position of the spot pair to be deleted (on the main image or on the magnifying window) and click Button1 of the mouse. (The predicted spot nearest to the cursor will be selected deleted provided that the distance squared from the cursor to symbol on the main image display area does not exceed 18). The selected predicted/observed spot pair will be removed from the spot matches list and their symbols deleted from the display. Selection of the , , or option from the menu will switch off the spot matches delete mode. 9.3.8 Read Matches File This option is used to read in spot matches from a file. An error notice will be displayed if no reflections have been predicted. If there are already matches in the current spot matches list then the user is given the choice of adding the matches from the read in file to those currently in the list or of overwriting the current spot matches list. The user is then prompted for the spot matches file name as follows: File name (default ext=.matches): The user replies with the name of the required spot matches input file; if no file extension is given an extension of .matches is assumed. A blank reply will cancel the request. The program checks that the file exists and can be opened; if there is an error, an error message will be output and the prompt will be repeated. The file will then be read; if it does not start with the keyword 'matches:' an error message will be output and the file name prompt will be repeated. The spot matches will then be read with any invalid records being flagged. A warning message will be output if the program's spot matches list becomes full. As each match is read, the program will search for the given reflection in the predicted reflections list; if it cannot be found an error message will be output and the match will not be added to the spot matches list. When the file has been read, the number of reflection matches added to the spot matches list will be shown (and the number of input errors if there were any). The symbols for the predicted and observed spot positions will be drawn on the image display. 9.3.9 Write Matches File This option is used to write the current list of spot matches to a file. If there are no matches in the current spot matches list, an error notice will be displayed and the option abandoned. Otherwise the following prompt is output: File name (default ext=.matches): The user replies with the name of the required output matches file; if no file extension is given an extension of .matches will be added. A blank reply will cancel the request. The program checks that the file does not already exist and that it can be opened; if there is an error, an error message will be output window and the prompt will be repeated. If the file already exists, the user is given the option of overwriting the file or selecting an alternative file name. The reflection indices and the measured spot positions are then written to the requested file. Note that predicted positions are not output to this file but will be found from a current reflections prediction if this file is read back into the program. When the required matches have been input, the option is selected and the program will enter the refinement procedure as described below after copying the matched reflections to refinement observations list. 9.4 SELECT, SEARCH AND REFINE 9.4.1 Introduction This option enables the selection of a set of reflections to be used in the refinement of the crystal orientation. Once the reflections list has been created, the program will search for the observed spot positions of the selected reflections an then enter the refinement procedure. A plate centre for spot position determination is determined from the position of the fiducials or from the defined centre position (see Appendix 6 ). The image is read in at this stage if this has not already been done and the image is then displayed in a image view-object. Normally all predicted reflections will be displayed on the image by default; however there is a program limit on the number of predicted reflections which may be displayed on an image and if this is exceeded selected nodals will be displayed instead; in this latter case a prompt will request the user input of a nodal selection index (see description of the <Display Nodals Only> option below). List of subsections in this section: Select Reflections Menu Display All Predicted Display Nodals Only Select by Nodal Index Select by Nodal h,k,l Clear Reflections List Input Reflections Delete Reflections Read Reflections File Write Reflections File 9.4.2 Select Reflections Menu The 'Select Reflections Menu' is then displayed with the following items: The first two options control which calculated spot positions are to be shown overlaid on the image. When the option is selected, the selected reflections list is automatically cleared. The third and fourth options provide two ways of selecting reflections for refinement based on their nodal indices. If the user wishes to redo the current input of selected reflections then the list can be cleared using the fifth option. Options six and seven allow for adding or deleting reflections to/from the current selected reflections list. The selected reflections list may also be written to a reflections list file or read from a previously generated reflections list file. When the required reflections have been selected, the user selects the option and the refinement procedure itself will be entered. The options from the 'Select Reflections Menu' are described in detail in the following sections. 9.4.3 Display All Predicted For further details, see the description of the option of the main menu option (Chapter 5 ). 9.4.4 Display Nodals Only For further details, see the description of the option of the main menu option (Chapter 5 ). 9.4.5 Select by Nodal Index The program will calculate the nodal reflections (up to a program maximum nodal index) and output a histogram showing the number of nodal reflections as a function of nodal index. The following prompt is then output: Nodal spot selection index [4]: The reply is the required index for the selection of the nodal spots to be used in the refinement. An error message will be output and the prompt repeated if the given value is outside the allowed range. If the number of spots is greater than the program limit for the number of possible spots to be used in a refinement then the selected spots list will be truncated and a warning notice displayed. The selected nodal reflection positions will be overlaid on the displayed image as red crosses. 9.4.6 Select by Nodal h,k,l This is similar to the 'Select by Nodal Index' option except that individual values are input for the nodal index limits for h, k and l. The following prompts are output after the histogram has been displayed: Nodal spot selection h index [4]: Nodal spot selection k index [4]: Nodal spot selection l index [4]: This option may enable a more even distribution of spots across the image to be obtained for some cells and crystal orientations. 9.4.7 Clear Reflections List This option clears the selected reflections. The symbols indicating the selected reflection are removed from the image display. 9.4.8 Input Reflections The message 'Input predicted position of reflection to add' is output to the active strip of the image view-object. The user may then start inputting positions of predicted spot positions to use in the refinement of the crystal orientation. To select a predicted spot, move the cursor to the spot symbol (on the main image or on the magnifying window) and click Button1 of the mouse. (The selected spot nearest to the cursor will be selected provided that the distance squared from the cursor to symbol on the main image display area does not exceed 18). The predicted spot position is indicated by a red cross. A warning notice will be output when the program's reflection list is full. When a predicted position has been input, the program will be ready for another predicted position to be input if required. Selection of the , , or option from the menu will switch off the select reflections input mode. 9.4.9 Delete Reflections When this option is selected, the message 'Input predicted position of reflection to delete' will be written in the active strip of the image view-object. To delete a selected reflection, move the cursor to the symbol of the predicted position of the reflection to be deleted (on the main image or on the magnifying window) and click Button1 of the mouse. (The selected reflection nearest to the cursor will be deleted provided that the distance squared from the cursor to symbol on the main image display area does not exceed 18). The selected reflection will be removed from the selected reflections list and its symbol deleted from the display. Selection of the , , or option from the menu will switch off the selected reflections delete mode. 9.4.10 Read Reflections File This option is used to read in a selected reflections list from a file. An error notice will be displayed if no reflections have been predicted. If there are already reflections in the current selected reflections list then the user is given the choice of adding the reflections from the read in file to those currently in the list or of overwriting the current selected reflections list. The user is then prompted for the reflections list file name as follows: File name (default ext=.reflist): The user replies with the name of the required reflections list input file; if no file extension is given an extension of .reflist is assumed. A blank reply will cancel the request. The program checks that the file exists and can be opened; if there is an error, an error message will be output and the prompt will be repeated. The file will then be read; if it does not start with the keyword 'reflist:' an error message will be output and the file name prompt will be repeated. The reflections will then be read with any invalid records being flagged. A warning message will be output if the program's selected reflections list becomes full. As each reflection is read, the program will search for the given reflection in the predicted reflections list; if it cannot be found an error message will be output and the reflection will not be added to the selected reflections list. When the file has been read, the number of reflections added to the selected reflections list will be shown (and the number of input errors if there were any). The symbols for the selected reflections will be drawn on the image display. 9.4.11 Write Reflections File This option is used to write the current selected reflections list to a file. If there are no reflections in the current selected reflections list, an error notice will be displayed and the option abandoned. Otherwise the following prompt is output: File name (default ext=.reflist): The user replies with the name of the required output reflections list file; if no file extension is given an extension of .reflist will be added. A blank reply will cancel the request. The program checks that the file does not already exist and that it can be opened; if there is an error, an error message will be output window and the prompt will be repeated. If the file already exists, the user is given the option of overwriting the file or selecting an alternative file name. The reflection indices of the selected reflections are then written to the requested file. When the required reflections have been selected, the option is selected and the program will search the image for the selected reflections nd enter the refinement procedure as described in sections below. 9.5 NODALS SEARCH AND REFINE The program will first calculate the predicted Laue pattern based on the current parameter values if this has not already been done. The program will then determine the number of distinct nodals for each nodal index from 1 to 12 (eliminating any spatially overlapped spots). A histogram is output showing these values. The following prompt is then output: Nodal spot selection index [4]: The user replies with a nodal index in the range 1 to 12 giving the nodal index to be used in selecting spots for the refinement. An error message will be output if the number given is outside this range and the prompt will be repeated. If the number of spots selected is greater than the program limit for the number of spots which may be used in the refinement, then a warning message will be output to indicate that the spot list has been truncated to this number. The number of nodal spots selected is then output and the procedure continues with the spot search as described below (see next section). 9.6 THE SPOT SEARCH A check is first made to ensure that there are spots is the list of spots for which to search; if there are none an error message is displayed and the search procedure is abandoned. A check is then made to ensure that the current image file is open or can be opened and, if it cannot, the search is abandoned. The image is then read from the file if it has not already been read; again, if there is an error, the search will be abandoned. If the spot width parameter is no zero then the following prompt will be output: Use radial masks in spot position determination (y/n) [y]: Normally the reply will be yes but during the early stages of refinement it may be better to reply no and search for the spot position within a larger box. If the radial masks option is not being used, the program then requests the input of the box size to be used in the search for a spot via the prompt: Box size (mm) [x.xx]: The reply is the box size in mm. (the default size is 2.0*(spot delta) - spot length). If a non-default value is given then this will be the default next time round unless the spot length or spot delta parameters have been reset or the refinement option re-entered. This is followed by the input of a value giving the threshold level above the background level for which pixels are assumed to belong to a spot. Threshold above background for c_of_g calc [xxx.x]: The reply is the threshold level. The default value is the value of the spot thresh parameter in parameter table 1. If a non-default value is given then the spot thresh parameter will be updated with this value. The film/image-plate image file is opened at this stage if this has not already been done and the program starts searching for the reflections after outputting the message '===Searching for Reflections==='. Spot centres of gravity will be found within the defined box or within the required radial ellipse depending on whether the radial masking option is 'No' or 'Yes'. (See also Appendix 10 ). After determining the required film/image-plate centre position, the following sequence of operations is carried out for each of the spots in the list: * Reject the spot if it is marked as being spatially overlapped (see Appendix 11 ). * Determine the predicted spot position on the image allowing for the offset and distortion parameters (see Appendix 5 ). * Get the image background value at the predicted spot position (see Appendix 8 ). * Find the spot centre of gravity position (see Appendix 10 ) * See if part of spot is outside the box and, if so, makes an adjustment to the position to allow for this (see Appendix 10 ) and re-determine the position. * Provided that some pixels above the required threshold value have been found, the spot position is then added to the 'observed spots' list. A check is made to ensure that at least one spot has been found; if not, an error notice will be displayed and this current refinement option will be abandoned. Provided that some spots have been found, their rms deviation (in mm.) and the number of spots found will be output. 9.7 THE REFINEMENT PROCEDURE 9.7.1 Introduction The refinement procedure may be divided into three sections as described in the following sections. List of subsections in this section: Start of the Procedure Selecting Parameters to Refine and Refinement Method Completion of the Procedure 9.7.2 Start of the Procedure The program first checks to ensure that some spots have been selected for the refinement and found; if not, an error message will be output and the current refinement option will be abandoned. The following prompt is then output: Number of spots to be used in refinement [nnn]: The default is the total number of spots found via the currently selected procedure. The user replies with the number of spots to be used in the refinement which must be in the range 1 to the default value displayed. If a value less than 1 is given, an error notice will be displayed and, on continuing, the prompt will be repeated. If a value larger than the default value is given, then the default value will be used. When only some of the reflections are selected, the observed reflections for refinement are selected from the list of spots in order of increasing (|h|+|k|+|l|) value. The following prompt is then output: Difference plot required [n]: The reply is 'y' if a difference plot is required before carrying out the refinement or 'n' (the default) if it is not. If a difference plot is requested then the current image is displayed. For each spot to be used in the refinement, the observed spot position is marked by a symbol; this may either be a blue box or, if the distance between the predicted and observed positions is greater than the spot delta, by a red star. A blue vector is drawn from the the observed spot position to the predicted spot position and exaggerated by a factor of 5 to indicate the current lack of agreement between observed and calculated spot positions. The menu area displays two options, a option to carry on with the refinement and a option to abandon the current refinement. The rms deviation (in mm.) between the predicted and observed refinement spot positions, together with the number of spots to be used in the refinement, is then output. 9.7.3 Selecting Parameters to Refine and Refinement Method A new window is then displayed containing a parameter table and a menu. The parameter table enables the user to select the parameters which are to be refined and the method to be used. When these have been selected the user will normally select the option from the menu to initiate the actual refinement process; there is however also a menu option which may be selected if the current refinement is to be abandoned. Figure 9.1 Example of a pop-up frame for selecting refinement parameters (at end of chapter) The parameter table has several sections as follows: a) Setting parameters The YES/NO parameter toggle values indicate whether or not these parameters are to be refined. For the key film/plate, the following parameters may be refined: phix, phiy, phiz, c_to_f, x_c, y_c For other films/plates the parameters in this section are: c_to_f, x_c, y_c, w_c See also the parameter list in Appendix 2 ; c_to_f = crystal-film distance) All the parameters in this section are refined by default. b) Cell parameters This section is only present when the key film/plate is being refined. Only the unique cell parameters for the crystal system in question will be listed e.g. a, b, c, beta for monoclinic or a, c for tetragonal. By default, no cell parameters will be refined. For ease of use in the most usual case, the individual cell parameter entries are preceded by a 'Refine Cell' item; if this is set to 'Yes', then the 'Yes' flag will be set for all except the first individual cell parameter refinement flags; if this is reset to 'No' then all the individual cell parameter refinement flags will be set to 'No'. At least one cell parameter must have the 'No' flag set and the program will, in fact, not allow all the individual cell parameter flags to be set to 'Yes' c) Distortion parameters The individual distortion parameters (i.e. y_scale, twist, tilt, bulge or y_scale, twist, tilt, roff, toff or y_scale, twist, tilt depending on the distortion type) are listed preceded, for ease of use, by a 'Distortion' item; if this is set to 'Yes', then the 'Yes' flag will be set for each of the individual distortion parameter refinement flags; if this is reset to 'No' then all the individual distortion parameter refinement flags will be set to 'No'. If required, the distortion parameter flags may be set individually. By default, the distortion parameters are not refined. For the 'spdxy' distortion type there is, in addition to the 'Distortion' set of parameters, a separate section of 'Polynomial fit' parameters (spdxy, spd_x, spd_y); again the individual parameter refinement flags may be set or the 'Polynomial fit' item may be used to set all the polynomial related parameters. The program will not allow parameters in both the distortion and polynomial fit sections to be refined at the same time. Also if the polynomial fit parameters are being refined, the parameters c_to_f, x_c and y_c may not be refined at the same time. d) Refinement method The refinement 'Method' item has a drop down menu with two refinement options available. These are a non-linear least squares refinement method, LSR, and a Powell minimisation method. More details of these methods are given in Appendix 12 . The item is followed by some individual items for the method currently selected. For the 'LSR' method these are: a) Shift limit (default = 0.001) The refinement will be terminated if all parameter shifts are less than this this value. b) Derivative step (default = 0.1E-05) The derivative value for a parameter as needed for a non-linear least squares refinement procedure, is determined by shifting the parameter value by the given step and recalculating the function value. The derivative is then taken as the shift in function value divided by the step size. c) Damp factor (default = 0.5) As shifts tend to be over estimated by this type of method, it is usual to apply only a fraction of the calculated shift after each refinement cycle. The default value will normally be satisfactory though a smaller value may be used when close to the final solution to get a slightly lower rms value than might otherwise be obtained. For the 'Powell' method there is the one parameter: a) Accuracy (default = 0.1E-05) The refinement will be terminated when the fractional decrease in residual is less than this value. When the menu item has been selected, the pop-up frame will be removed and the refinement will start. 9.7.4 Completion of the Procedure [During the refinement the scaling factors of 1.0 are applied to all parameters except the cell parameters which are scaled by 0.001.] For either method a warning message will be output if convergence has not been reached after 50 cycles of refinement and the refinement will be incomplete. Other error messages may possibly be output depending on the method selected. The values of the refined parameters are then listed followed by the refined rms value (in mm.), number of reflections used in the refinement and the previous rms value. The following prompt is then output: Display difference plot [n]: The reply is 'y' if a difference plot is required showing the results of the refinement or 'n' (the default) if it is not. If a difference plot is requested then the current image is displayed. For each spot used in the refinement, the new predicted spot position is found and the program re-determines the observed spot position (centre-of-gravity) using a box (or ellipse) centred at the new predicted position. (The box/ellipse size and the intensity threshold above background used are the values set when the spot positions were determined prior to this refinement). The previous observed spot position is marked by a symbol; this may either be a small blue cross (normal case) or a blue box if the distance between the newly determined observed spot position and the previously determined observed position was greater than delta, or by a red box if there was an error finding the spot at the new predicted position (e.g. no pixels over the threshold value). A blue vector is drawn from the (old) observed spot position to the (new) predicted spot position and exaggerated by a factor of 5 to indicate the current lack of agreement between observed and calculated spot positions. The menu area displays a single option to carry on with the refinement procedure after examining the difference plot. The following prompt is then output: Accept refined parameters [y]: The reply is 'yes' (the default) if the refined parameters are to be accepted and the parameter tables updated or 'no' if the values prior to the current refinement are to be retained. This is followed by the prompt: Continue refinement with current spots [n]: A reply of 'yes' gives the user the option of repeating the parameter refinement using the current set of observed spot positions, perhaps refining a different selection of parameters. The procedure repeats from the display of the pop-up frame for refinement parameters selection. Alternatively a reply of 'no' returns the program to await selection of a new option from the 'Refinement Options Menu' 9.8 AUTO-REFINE PLATE OR AUTO-REFINE PACK When one of these options is selected, the program will carry out a series of refinement cycles automatically following a built-in protocol either for the current plate or pack depending on which option is selected. The procedure followed is described in more detail in Appendix 12 . The following brief question and answer sequence is invoked: Refine cell parameters (y/n) [y]: The reply is 'yes' (the default) if cell parameters are to be refined during the procedure or 'no' if they are not. Start nodal index or no. spots [4]: This determines how many spots are to be used in the initial stages of the refinement. This may be given either as the nodal index to use in selectiing the spots (4-12) as described above for the manual procedure or as the target number of spots to use (if a value >20 is given). Any other value <=20 will be adjusted to be in the range 4-12 to be treated as a nodal index. If a target number of spots is input, it determines which nodal index is used to determine the spots to be used in the refinement. It causes the selection of the lowest nodal index for which at least the required number of spots are predicted (up to a maximum of 12); note that the number of spots actually found and used in the refinement may be less than the requested number so that it may be desirable to input a larger number to try and achieve the required target. Final nodal index or no. spots [4]: This determines how many spots are to be used in the final stages of the refinement specified as described for the reply to the previous prompt. During the refinement procedure, a special window is displayed (???) showing the progress of the refinement. This window is spit into 4 areas: Left hand window This information displays the current status of the refinement procedure with the following items: * The current pack and plate numbers. * The current refinement cycle number (the cycle number itself in blue). * An indication of the current refinement phase (initial, main or final) and step within that phase e.g. reflection generation, spot search, parameter refinement. * A list of the parameters which may be refined for the current plate with green 'lights' indicating those actually being refined during the current cycle. * The number of spots searched for and found and the rms deviation between predicted and observed spot positions for the current cycle. * The latest refined rms value between predicted and observed spot positions and the number of spots used in the latest refinement cycle. The rms value itself is highlighted in blue. * A summary table showing how many plates fall within each rms range (in steps of 0.01 mm up to 0.1 mm) after refinement. This table is also output to the main I/O window of the program and to the log file, if present, on completion of the automatic refinement option. To right window This is a button which may be used to interrupt the automatic refinement procedure if required. Middle right window This displays a 'thermometer' showing the current rms of the refinement. The red level shows the rms deviation. The scale is graduated in units of 0.05 mm up to a maximum of 0.3 mm with the 0.05 level emphasised as it is often a reasonable target level to aim at. The thermometer acts as a 'minimum' thermometer with the blue marks indicating the lowest level reached for the current plate during its refinement cycles. Bottom right window A button to dismiss the automatic refinement results window after the results have been inspected and to return to the use of the 'Refinement Options' Menu. The button only becomes active after the automatic refinement protocol is completed. On fast computers it is likely that a lot of the information passes by too quickly to be absorbed and most of it is provided so that progress may be monitored when a refinement is slow. Most useful are the thermometer display, the highlighted rms value and, at the end of the procedure, the refinement rms summary. Full details of all the refinement cycles are written to the log file if present. It may be worth noting that the automatic refinement procedure uses a different background determining procedure when finding spot positions than is used when doing the manual cycles of refinement. This means that, even if exactly the same cycles were done manually as are done in the automatic protocol, the results may turn out slightly different. 9.9 WRITING '.GE' FILES This option is required to give compatibility with the other programs of the Laue software suite which are not yet based on the LDM developments. The data are written for the current pack with a maximum of six plates in that pack. The following prompt is output: Root name for .gen/.ge1/.ge2 files: The reply is the root part of the required file name for the output .gen, .ge1 and .ge2 files. The corresponding file type extensions are added to this root to give the actual file names. If a file extension is given in the reply then this extension will be removed and ignored. If a blank reply is given, then the write .ge files option will be abandoned. If any of the three files are already present then an error message will be output indicating that the file exists and the user will be given the option of whether or not to overwrite these files. If the film/plate currently being refined is not the first one then the film is temporarily reset to the first film so that a predicted pattern may be calculated for this first film/plate to give the coordinates required for the .ge1 file. The program will open the .gen file; if there is an error doing this then an error message will be output and the root file name prompt will be repeated. The parameters data are then written to the .gen file. The program will then open the .ge1 and .ge2 files; if there is an error doing this then an error message will be output and the root file name prompt will be repeated. The following prompt/reply sequence will then be entered: Do you want to write spatials to the file [n]: The user replies with 'yes' if spots, determined as being spatially overlapped, are to be written to the .ge1/.ge2 files or 'no' (the default) if they are not to be written. Enter Min I to by-pass measurements of subsequent films/plates [100]: The reply is an intensity value used by the integration program INTLAUE with a default value of 100. The .ge1/.ge2 files reflection data are then written. An error message will be output if a multiplicity greater than 30 is found and any harmonics in excess of this will be lost. A summary of reflection counts is then output. Finally, the input of a pack number is requested via the following prompt:- Pack ID [0]: The reply is any integer value; this number is stored in the .ge1 file header information and is referenced by the integration program INTLAUE. The writing of the .ge1/.ge2 files is then completed. Figure 9.1 Example of a pop-up frame for selecting refinement parameters CHAPTER 10: THE 'IMPROVE SOFT LIMITS' PROCESSING OPTION ======================================================= 10.1 INTRODUCTION This option allows for the improvement of the soft limits values for 'dmin' or 'lambda-min' by over-predicting the pattern for the parameter in question, integrating the intensities for non-overlapped singles and analysing the resultant intensity distribution as a function of the parameter. When the option is entered, the pack for processing will be the current pack by default. A menu option enables this to be reset to the first pack if this is not the current pack and if required. The plate will be set to the key plate of the pack for the soft limits determination. List of sections: Soft Limits Options Menu Determining 'dmin' or 'lambda-min' Looking at the Results 10.2 SOFT LIMITS OPTIONS MENU The 'Soft Limits Options' menu is as follows: This first two options display the histograms which form the basis of the intensity analysis. The third option enables the display on the image of the spots close to the soft limit which have been determined to have significant or non-significant intensities. Options four and five enable the updating of the soft-limit value. The options are described in the following sections. If the 'Return to Previous Menu' option is selected without having updated the current soft limit value, then a popup notice warns the user of this fact an gives the option of returning to the current menu to update the value or returning to the previous menu without making a change to the soft limit value. List of subsections in this section: Normalised Histogram Un-normalised Histogram Show Results on Image Accept New Soft Limit Input Another Limit 10.4.2 Normalised Histogram This option displays a histogram of the ratio of the number of significant intensities to the number of measured intensities (non-overlapping singles) as a function of resolution or wavelength. The ratios are normalised to give a value of 1.0 to the bin which has at least 10 significant spot intensities and which has the has the highest such ratio. A horizontal line is drawn at the test fraction used as the soft limit determining criterion. An arrow points to the determined soft limit value. Figure 10.1 Example of a normalised histogram for a 'dmin' determination (at end of chapter) 10.4.3 Un-normalised Histogram This option displays a histogram of the ratio of the number of significant intensities to the number of measured intensities (non-overlapping singles) as a function of resolution or wavelength. The ratios are not normalised as in the previous case. A horizontal line is drawn at the test fraction used as the soft limit determining criterion. As the input test fraction value is for the normalised case, the displayed fraction indicated by the horizontal line is adjusted to take account of this fact. An arrow points to the determined soft limit value. 10.4.4 Show Results on Image This option enables the examination of the image for the spots close to the soft limit being determined. The image is displayed and the following menu is given: 'lmin' If the first option is selected then the predicted Laue pattern will be superimposed on the displayed image with the soft limit set to program determined value or any user value which has been input to supersede this. If the section option is selected then the user in prompted for minimum and maximum resolution/wavelength limits. By default, these will be the determined (or user input) soft limit value and this value plus the current bin width for the parameter in question. The spots within this range are marked as folows on the image: Red circles Significant intensities Blue crosses (+) Measured but not significant intensities Cyan crosses (x) Spatially overlapped spots Only singles are considered for display. If a limit, lower than that used in the prediction for the soft limit determination, is requested then the program will predict a new pattern. For displaying the low 'dmin' or 'lmin' spots, the program needs to repeat the spot integration though it does not redo the profile determination. 10.4.5 Accept New Soft Limit If this option is selected then the determined value of the soft limit will be accepted as the new value for that limit. The value will be updated in the parameter table 1 and for subsequent packs if appropriate. 10.4.6 Input Another Limit A prompt is output requesting the value to be used for the soft limit in question and this value will be accepted as the new value for that limit. The value will be updated in the parameter table 1 and for subsequent packs if appropriate. Figure 10.1 Example of a normalised histogram for a 'dmin' determination CHAPTER 11: THE 'INTEGRATE SPOTS' PROCESSING OPTION =================================================== 11.1 INTRODUCTION This option allows for the integration of spot intensities using routines developed by Dr Q. Hao as also used in the separate integration program INTLDM. In addition to integrating spatially separate spots, the routines allow for the deconvolution of intensities from spatially overlapped spots. The control of the integration makes use of some extra parameters defined for LAUEGEN as part of an extended LDM parameter set. When integration is carried out, the integrated intensities are stored internally in a Laue Integrated Reflections List (LIRL). When such a list is present, the program may output integration status warnings at certain stages to ensure that the user is aware of the implications of what is being done, for example attempting to exit the process mode or the program with intensities which have been integrated but not written to an output file; full details are given in Appendix 15 . The option may also be used to write out the integrated intensities to appropriate files and to examine details of the last integration carried out or show the current integration status. When the option is entered, the pack for processing will be the current pack by default. A menu option enables this to be reset to the first pack (and plate) if this is not the current pack and if required. List of sections: Integration Options Menu The Integration Parameters The Integration Procedure The 'Integrate Plate' Option The 'Examine Last Integration' Option Auto-integrate Pack Write Intensities File Integration Status Bad Spots 11.2 INTEGRATION OPTIONS MENU The 'Integration Options' menu is as follows: The first, fourth and seventh options are for pack/plate selection. The second and fifth option enable the actual integration to be carried out either for a single plate or for the pack as a whole. The third option enables the results of the integration, for the last plate integrated, to be examined. The sizth option enables the integrated intensities to be written out to appropriate output files. The last option shows the current integration status indicating which packs/plates have been integrated and whether or not the integrated intensities have been written to output files; this option also allows sets of integated intensities to be deleted if desired. The main options associated with the integration are described in separate sections below. 11.3 THE INTEGRATION PARAMETERS Parameter table 3 displays a number of parameters used in the integration process. The parameters belong to the extended LDM dataset for LAUEGEN and are described in detail in Appendix 2 . Briefly they are as follows: int_ftype: The output integrated intensities file type .mtz or .ge (.ge1/.ge2). int_template: File name template for the output integrated intensities files. nprof: This is the number of radial bins to be used in determination of the intensity profiles. prof_rotate: Rotate/do-not-rotate spot profiles during their formation and use (applies only to elliptical spots) promin: This is the minimum intensity for which spots will be included in the determination of profiles. For film, the default values is 100.0 and, for other detectors, the default is 600.0. Note that if 'promin' was not set in the input LDM data set, then it will be set to 100.0 or 600.0 the first time a soft limit determination or integration in requested either in interactive mode or from the command line depending on the image type at that time. The value will then remain unless its is reset manually or the program default parameters are reset or a new LDM file is read in; changing the image type parameter does not change 'promin' if a non-zero have has already been set. prof_all: Form profiles separately for each plate in a pack or use profiles determined from the key plate only. ovlim: This is the number of overloaded pixels allowed within a spot peak for the integrated intensity still to be considered as good. If there are more than this number of overloaded pixels, the intensity will be flagged as an intensity overload. scale_int: Scale factor to be applied to the output integrated intensities when written to the output files. 11.4 THE INTEGRATION PROCEDURE The cyrstal orientation parameters must be well refined to give a very close match between observed and predicted spot positions before carrying out an integration. If the appropriate refinement has not been carried out (as judged by whether or not the 'refined flag' is set) then a warning or error notice will be displayed. For the 'Integrate Plate' option the user may continue the integration despite the warning if desired. The integration procedure makes use of a set of LDM compatible integration routines (SAINT - Stand Alone INTegration) written by Hao Quan and based on the method of Rossmann (Rossmann M. Acta. Cryst. (1979) 12pp. 225-238). The integration procedure involves the following: 1) Profile shape. An image is divided into 1 to 17 radial bins. All profile shapes use elliptical masking as standard and treat a circular spot as a special case of an ellipse when both axes are equal. If profile rotation is requested, then account is taken of the lengths and theta angles around the beam direction of the individual spots used to form the profiles. The spots forming the profile are rotated to an angle theta=0.0 radially around the beam centre position. When using the profile for integrating a spot, the reverse rotation is applied to the bin profile. These rotations involve the mapping of nearest pixel points and the advantage of taking account of the ellipse orientations and possibly variable lengths must be offset against any loss of accuracy due to the mapping process. Profile rotation may well be most beneficial if the spots cover many pixels but should probably be used with caution if the spots only cover a few pixels. Profile rotation is never done for circlular spots i.e. those defined with the SPOT_WIDTH parameter = 0.0. 2) Background determination. The three background plane constants: a, b, c are given by setting Sigma(rho - ap - bq - c)**2 n to a minimum over 'n' background points in a spot box, where 'rho' is the optical density, 'p' and 'q' are the two-dimensional positions of the pixel. The background plane is re-calculated by omitting pixels outside the expected Gaussian distribution about mean background. 3) Forming profiles. 'N' spots which satisfy following conditions are selected to form a profile in every bin of the image: * Non-overlapped. * Integrated intensity 'J' greater than the requested PROMIN value Minimising (JP - rho + ap + bq + c) gives profile 'P' for every point within the spot box: 4) Profile fitting. The integrated intensity by profile fitting is given by: I = Sigma P(rho - ap - bq - c) * Sigma P / Sigma P**2 m m m 5) Standard deviation. The integrated error, 'sigma', in fitting the profile can be determined from the differences between measured optical densities and the scaled profile. Thus, sigma**2 = sigma**2(P) + m / n*sigma**2(B) where sigma(P) and sigma(B) are the standard errors in determining the peak and background regions within the reflection box, respectively: sigma**2(P) = Sigma [JP - (rho - ap - bq - c)]**2 m sigma**2(B) = Sigma rho**2} - 1 / n*Sigma rho**2 n n 6) Spatially Overlapped Spots The program will integrate spots which are spatially overlapped provided they are not closer than the distance set for the LDM parameter SPOT_EPSILON. If the deconvolution of spatially overlapped spots is not required, then a large value should be given for SPOT_EPSILON. Spots are only marked as 'too close to integrate' if they have first been flagged as spatially overlapped i.e. the SPOT_EPSILON value only affects the integration criterion and not the overlap criterion. For spatially overlapped spots, any pixels which belong to the peak areas of neigbouring spots are excluded from the set of pixels used in background calculation and from the set of pixels used in determining the profile fitted intensities. 7) Spots with Overloaded Pixels Using profile fitting, spots with only a few overloaded pixels can still be integrated to give good intensities. These intensities are determined by omitting the pixel positions of the oveloaded pixels from profile fitting mask when a spot is integrated. The number of overloaded pixels allowed within a spot, to be treated in this way, is set by the user (the OVLIM extended LDM parameter) and an appropriate number will clearly depend on the number of pixels in the spot. The intensity derived from any spot with more than the requested limit of overloaded pixels is flagged as being an intensity overload. 11.5 THE 'INTEGRATE PLATE' OPTION The 'Integrate Plate' option initiates the spot integration for the current plate. After opening and reading the image data file (if it is not already been done) and detemining the plate centre position, a check is made to ensure that the orientation has been refined for the plate. If it has not, a warning notice will be displayed and the user may either abandon the option or continue despite the warning. If the intensities have already been integrated for the plate, then a warning notice will be displayed and the user may decide either to re-do the integration (deleting the previously integrated intensities for the plate) or abandon the option. The spot profiles are then be determined if not already calculated and stored and the spot integration carried out. Details of the integration are written to the log file, if present. The profiles information and integration statistics written to the log file are analogous to those described in the next section. The integrated intensities are stored in an internal Laue Integrated Reflections List (LIRL). 11.6 THE 'EXAMINE LAST INTEGRATION' OPTION 11.6.1 Introduction This option enables the results from the integration of the most recently integrated plate to be examined. An error notice wiil be displayed if no integration has been done and the option will be abandoned. Otherwise, the following menu will be displayed: List of subsections in this section: Examine Profiles Examine Individual Spots Integration Statistics 11.6.2 Examine Profiles When this option is selected, the profile for the first bin is displayed and the following menu is output: The menu enables the user to step through each of the profiles as required. A new window shows the profile details. Figure 11.1 Example of a profile details window At the top (in blue) is the profile bin number and the angular range for that profile bin in degrees. At the bottom the pack number and plate number are displayed; these refer to the plate from which the profiles were determined. In the centre of the window is the profiles data showing all the points in the profiles spot box. The background subtracted profile values (in red) are scaled to a range from 0 to 15 represented as hexadecimal digits from 0-9 and A-F. A border of '*' characters (black) 1 pixel thick shows the boundary between the spot and background regions. Numbers outside this border (blue) are background subtracted background region values and should ideally be zero. Points within the integration box which are not part of the spot, border or background area are represented by '.' characters (black). 11.6.3 Examine Individual Spots This option enables single spots to be re-integrated so that the integration results for a single spot may be examined. A spot may be selected from a displayed image of by index. The following menu is output: The first option enables thes display of the image. If the second option is selected then a spot may be selected from the displayed image using the cursor (if the image is not already diplayed, then it will be automatically displayed when the option is selected). As an alternative, a spot may be selected by giving its indices (the third option); in this case the reflection indicies will be requested via a prompt in the main I/O window; if the requested reflection is not in the predicted reflections list, an error notice will be displayed. The fourth option in the menu enable the image display to be dismissed if desired; in any case it will automatically be dismissed when a return is made to the previous menu. When a spot has been selected either from the image or by index, a new window is displayed showing a scaled pixels plot for the spot integration and a new menu is output as follows enabling various plots to be displayed: The options are as follows: Scaled Pixels Plot This plot lists the scaled pixel values associated with the given spot. At the top of the window, the following information is given: * The spot indices. * The spot position (predicted) in raster units. * The pack and plate number. * The integrated intensity and its standard deviation. * The determined background plane parameters. At the bottom of the window, the plot type is indicated together with the scale factor applied to scale the pixel values to a range from 0 to 99. In the centre of the window, The integration box shows the values of the scaled (to a range from 0 to 99) pixels within the areas associated with the spot, border and background regions. Pixels outside these areas are represented by '.' characters. Figure 11.2 Example of a scaled pixels plot All values in this plot are displayed in black. Background Subtracted Pixels Plot The information at the top and bottom of this plots is the same as for the scaled pixels plot described above. In the centre of the window, the integration box shows the background subtracted values of the pixels within the areas associated with the spot (red) and background (blue or green) regions. In the background region, the green values indicate the rejected pixels (if written to the log file any such pixels are indicated by the characer 'R'). The pixels are on the same scale as for the first (scaled pixels) plot. The border pixels are shown as '*' characters (in black) and separate the spot from the background region. Pixels outside these areas are represented by '.' characters (black). For spatially overlapped spots, overlapped pixels which have been excluded because they are overlapped by neighbouring spots are marked by the character 'X' (black). Overloaded pixels which have been excluded from the spot peak are marked by the character '+' (black). Figure 11.3 Example of a background subtracted pixels plot Scaled Spot Profile Plot The information at the top and bottom of this plots is the same as for the scaled pixels plot described above. In the centre of the window, the plot shows the profile used when determining the profile fitted intensity for the spot. The profile pixels (red in the spot region and blue in the background region) are scaled to a range from 0 to 99 (note that this is a different scaling factor from that used in the other two plots). The border pixels are shown as '*' characters (in black) and separate the spot from the background region. Pixels outside the spot, border and background areas are represented by '.' characters )in black). For spatially overlapped spots, overlapped pixels which have been excluded because they are overlapped by neighbouring spots are marked by the character 'X' (black). Overloaded pixels which have been excluded from the spot peak are marked by the character '+' (black). Figure 11.4 Example of a scaled spot profile plot Output Plots to Logfile The output of results from an individual spot integration to the log file is not done automatically but the three plots (as described above) may be output to the log file (if present) by selectin this option. 11.6.4 Integration Statistics Selecting this option displays a window giving a brief statistical summary of the integration results for the last plate integrated. A menu is also output with a single lt;Continue> item to be selected when the table has been examined. Figure 11.5 Example of an integration statistics table In the summary table, spots are divided into five categories: * All Spots. * Singles (spatially separated). * Multiples (spatially separated). * Singles (spatially overlapped). * Multiples (spatially overlapped). For each category, the following items of information are output: * The total no. of spots predicted. * The number of good spots; i.e. integrated and not bad/overload. * The number of spots with overload pixels present. * The number of spots with negative intensities. * The mean spots intensity (non-negative intensities). * The mean Intensity/sigma(Intensity) value (non-negative intensities). * The number of spots with intensities > 3.0*sigma(Intensity). * The number of spots with intensities > 10.0*sigma(Intensity). The numbers of good spots and the mean I/sig(I) values for both separated singles and for multiples are highlighted in red in the statistics table. Notes: 1) There may be a few predicted spots for which the integration box used does not lie fully within the image. These are not integrated. 2) Spots with negative intensities are also included in the good spots category. 3) Spots with no more than OVLIM overloaded pixels are also included in the good spots category. 4) For the counts of spots with intensities > 3 sigma and > 10 sigma, good spots and intensity overloads are included. 11.7 AUTO-INTEGRATE PACK When this option is selected, all the plates for the current pack will be integrated. If spots have already been integrated for one or more of the plates in the pack, then the user will be asked whether or not the integration is to be skipped for these plates or whether it is to be redone. The integration procedure is then invoked. The integrated intensities will be stored in the internal Laue Integrtaed Reflections List (LIRL). After calling the 'Auto-integrate Pack' option, the 'Examine Last Integration' option may be used bearing in mind that this will only show the results for the last plate integrated if there is more than one plate in the pack. All profiles calculated and the integration statistics from each plate will, however, be written to the log file (if present). 11.8 WRITE INTENSITIES FILE To write integrated intensiites, currently stored internally in the Laue Integrated Reflections List (LIRL), to output MTZ or .GE1/.GE2 files, the 'Write Intensities File' option must be selected. The option must be selected for each pack separately. If no integrated intensities are present for any of the plates in the pack, then an error notice will be displayed and the option will be abandoned. If all the intensities for the pack have already been written to file, then a warning notice will be output and the user may choose either to cancel the request or to re-output the data. The output file name or names are formed using the integrated intensities file name template. If the files already exist a warning notice will be displayed giving the user the choice of overwriting the files or abandoning the output. If the files cannot be opened, an error message will be displayed and the option will be abandoned. Details of files written will be output to the log file (if present). 11.9 INTEGRATION STATUS This option enables the current integration status of the packs and plates to be examined and alos, if required, sets of intensities to be deleted from the internal Laue Integrated Reflections List (LIRL). When the option is selected, the integration status is shown in the main I/O window for the first pack and the following menu is displayed: The first three options select the pack for which the integration status is to be displayed. The status for each of the plates in the pack is listed in the main I/O window. The status may be one of the following: * Not Integrated * Integrated * Integrated and written to a file The next three options enable the intensities to be deleted (if present) for a plate, pack or all packs and plates. The plate & pack numbers are requested where relevant. Warning messages will be written to the log file indicating any sets of intensities deleted. 11.10 BAD SPOTS An integrated spot is flagged as bad and a bit is set in the integration code flag if any of the following occur: * (bit 0) No non-overlapped/non-overloaded peak pixels . * (bit 1) Less than 20% of peak pixels are non-overlapped/non-overloaded. * (bit 2) Less than three non-overlapped background pixels. * (bit 4) Less than 20% of background pixels are non-overlapped. The 20% (approximate) values are calculated from the expression (NPIX-3)/5 where NPIX is the number of pixels is the peak or background as relevant. CHAPTER 12: COMMAND LINE PROCESSING OPTIONS =========================================== 12.1 INTRODUCTION In addition to the interactive processing commands of LAUEGEN, there are a number of commands which may be entered via the command line. These may be used in any of the program modes (interactive, terminal or batch) and provide facilities for a more automated approach to Laue data processing. List of sections: The Processing Options General Principles The LG_SPOTSIZE Command The LG_REFINE Command The LG_DMIN Command The LG_LMIN Command The LG_INTEGRATE Command The LG_WRITEINT Command The LG_CLEARINT Command The LG_READLDM Command The LG_WRITELDM Command Example of a Processing Command File 12.2 THE PROCESSING OPTIONS The following processing commands may be input when the program is in 'process' mode: lg_spotsize Find spots on an image and determine appropriate spot dimensions for use in the Laue data processing. lg_refine Refine the crystal orientation and related parameters. lg_dmin Determine a value for the soft limit 'dmin'. lg_lmin Determine a value for the soft limit 'lambda-min'. lg_integrate Integrate spot intensities. lg_writeint Write integrated intensities to output MTZ or .GE1/.GE2 files. lg_clearint Clear the integrated intensities list. lg_readldm Read an LDM parameters file. lg_writeldm Write an LDM parameters file. 12.3 GENERAL PRINCIPLES The command line processing commands are designed to be used with the minimum number of additional parameters in the command line. If the program is being run interactively or in terminal mode then the program will prompt for the additional parameters which are available if the command followed by the character >is specified following the command name e.g. lg_dmin > The prompts, in general, give the question followed by the name of the parameter for use in the command line in {} followed by the current value in [] e.g. Number intensity profile bins {nprof} [12]: In general, the commands apply to the current pack (by default or if the parameter 'pack' is given), to all packs if the parameter 'all' is given or in the cases of lg_refineor lg_integrateor lg_clearintto the current plate if the parameter 'plate' is given. However the lg_readldmand lg_writeldmcommands apply to the dataset as a whole. When required, the current pack and plate numbers may be reset as needed via the packor platecommands or via parameter table 1 (or some menus) if the program is being run in interactive mode. The default values for the other parameters required by the commands are the current values of these parameters within LAUEGEN. If these values are overridden by parameter/value specifications following the processing command (or in reply to the prompt sequence if requested), then these overriding values apply only during the execution of the command and do not affect the current LAUEGEN values. In the command line, the parameter/value pairs when specified are given in the form name=value e.g. lg_integrate plate nprof=15 promin=500.0 Spaces may be left on either side of the '=' sign or the '=' sign may be omitted e.g. lg_integrate all nprof = 15 promin 500.0 In interactive mode, a 'CANCEL' button is displayed at the right hand side of the command window during the execution of potentially time consuming commands enabling them to be interrupted if necessary without killing the program. Such commands are: lg_spotsize lg_refine lg_dmin lg_lmin lg_integrate Any errors encountered or commands interrupted will result in appropriate messages being displayed (in a manner appropriate to the current mode) and written to the log file (if present). If the program is being run in interactive or terminal modes and an error is detected during the execution of one of the command line processing options, then in some cases the user may be presented with the option of continuing the processing with the next pack or plate in spite of the current error. Commands allowing this include: lg_spotsize (next pack) lg_refine (next plate or next pack) lg_dmin (next pack) lg_lmin (next pack) lg_integrate (next plate or next pack) lg_writeint (next pack) The results from all the command line processing commands are wriiten to the log file (if present). In interactive mode progress bars are displayed during some of the processing stages and in interactive or terminal mode, output messages are used to indicate the steps being carried out where appropriate. Examples are as follows: ===Reading image data now=== ==Starting background calculation== ==Generating reflections and finding overlaps== ==Automatic refinement for pack 1, plate 1== ==Determining spot size for pack 1== ==Determining profiles for pack 1, plate 1== Where required the pack and plate numbers may be reset using the pack or platecommands followed by the required pack or plate number respectively. e.g. pack 2 plate 1 All commands are case insensitive. 12.4 THE LG_SPOTSIZE COMMAND This command allows for an initial determination of spot size parameters for use in the processing of the data. The method involves searching an image for spots and determining suitable spot size parameters from these spots bearing in mind that Laue images may well contain overlapping spots. The basic method and parameters required are described in Chapter 8 for the equivalent interactive command. The optional parameters which may follow the command are as follows: pack or all (current pack or all packs) thresh = value (threshold for spot search) nbins = value (no. of angular analysis bins) sdcut = value (standard deviation cutoff) expand = value (expand factor) e.g. lg_spotsize nbins=36 The corresponding prompt sequence is: Scope (pack, all) [pack]: Threshold factor (*background) for search {thresh} [...]: Number angular analysis bins {nbins} [...]: Standard deviation cutoff for good spots {sdcut} [...]: Expansion factor - observed->proposed size {expand} [...]: The spot length and spot width parameters will be automatically updated to the determined values at the end of the procedure and values will be reset for subsequent packs/plates where appropriate following the normal parameter updates policy. 12.5 THE LG_REFINE COMMAND This allows for the refinement of the crystal orientation and related parameters using the automatic refinement protocol as described in Appendix 12 . The optional parameters which may follow the command are as follows: pack or all or plate (current plate, pack or all packs) cell or nocell (refine/do-not-refine cell) n1 (start no. of nodals or nodal index) n2 (final no. of nodals or nodal index) e.g. lg_refine all nocell 5 250 The parameter format for this command differs from the more usual format in that there are no parameter name/value pairs. The default is to refine the cell parameters. If a number (integer) is given in the command line it is taken as being the start no. of nodals or nodal index. If a second number (integer) is given it is taken as being the final no. of nodals or nodal index. The corresponding prompt sequence is: Scope (plate, pack, all) [pack]: Refine cell (cell, nocell) [cell]: Start number of nodals or nodal index [...]: Final number of nodals or nodal index [...]: On completion of the refinement the relevant parameter values are automatically updated together with those of any subsequent packs/plates where relevant following the normal parameter updates protocol. In interactive mode or terminal mode a brief summary is output (to the main i/o window or to the terminal respectively) showing the number of refined plates with rms values in a series of ranges from .01 mm to .10 mm (and >.10 mm) in steps o;f 0.01 mm. Full details of the refinement cycles are, as usual, written to the log file (if present). 12.6 THE LG_DMIN COMMAND This allows for the determination of an improved value for the soft limit 'dmin' parameter using the procedure as described in Chapter 10 . The optional parameters which may follow the command are as follows: pack or all (current pack or all packs) nprof value (no. of bins for profiles) prof_rotate y/n (rotate profiles (yes or no)) promin value (minimum intensity for profiles) nbins value (no. of bins for soft limit analysis) binw value (bin width for soft limit analysis) frac value (start fraction of current soft limit) sigtest value (sigma for significant spots) frtest value (fraction for significant spots test) e.g. lg_dmin nbins=40 The corresponding prompt sequence is: Scope (pack, all) [pack]: Number intensity profile bins {nprof} [...]: Rotate profiles if elliptical spots {prof_rotate} (y/n) [...]: Minimum intensity for profiles {promin} [...]: Number of 'dmin' bins {nbins} [...]: Bin width for 'dmin' {binw} [...]: Start fraction of current 'dmin' {frac} [...]: Sigma test for significant intensity {sigtest} [...]: Fraction test for soft limit significance {frtest} [...]: When the updated value of 'dmin' has been determined then, if the program is in interactive or terminal mode, a brief summary histogram of the results is output to the main I/O window or terminal. This shows the counts etc. associated with the bins surrounding the selected soft limit value e.g. Bin Range Nmeas Nobs Ratio Norm 6 2.05 - 2.10 336 17 0.05 0.05 7 2.10 - 2.15 292 43 0.15 0.15 8 2.15 - 2.20 315 42 0.13 0.13 9 2.20 - 2.25 261 45 0.17 0.17 <<<<<< 10 2.25 - 2.30 204 39 0.19 0.19 11 2.30 - 2.35 258 60 0.23 0.23 12 2.35 - 2.40 186 43 0.23 0.23 The value determined for 'dmin' is also displayed e.g. Value determined for 'dmin' is 2.20 (was 2.30) If the value is OK or the program is in batch mode then the the 'dmin' parameter value is automatically updated together with that of any subsequent packs where relevant following the normal parameter updates protocol. If there is a warning associated with the 'dmin' determination and the program is in interactive mode or terminal mode then the user is asked whether or not to accept the new value before proceeding to update it and any subsequent pack values if appropriate.. 12.7 THE LG_LMIN COMMAND This allows for the determination of an improved value for the soft limit 'lmin' parameter using the procedure as described in Chapter 10 . The optional parameters which may follow the command are as follows: pack or all (current pack or all packs) nprof value (no. of bins for profiles) prof_rotate y/n (rotate profiles (yes or no)) promin value (minimum intensity for profiles) nbins value (no. of bins for soft limit analysis) binw value (bin width for soft limit analysis) frac value (start fraction of current soft limit) sigtest value (sigma for significant spots) frtest value (fraction for significant spots test) e.g. lg_lmin nbins=40 The corresponding prompt sequence is: Scope (pack, all) [pack]: Number intensity profile bins {nprof} [...]: Rotate profiles if elliptical spots {prof_rotate} (y/n) [...]: Minimum intensity for profiles {promin} [...]: Number of 'lmin' bins {nbins} [...]: Bin width for 'lmin' {binw} [...]: Start fraction of current 'lmin' {frac} [...]: Sigma test for significant intensity {sigtest} [...]: Fraction test for soft limit significance {frtest} [...]: When the updated value of 'lmin' has been determined then, if the program is in interactive or terminal mode, a brief summary histogram of the results is output to the main I/O window or terminal. This shows the counts etc. associated with the bins surrounding the selected soft limit value e.g. Bin Range Nmeas Nobs Ratio Norm 1 0.44 - 0.46 110 4 0.04 0.04 2 0.46 - 0.48 127 12 0.09 0.10 3 0.48 - 0.50 116 23 0.20 0.21 <<<<<< 4 0.50 - 0.52 132 31 0.23 0.25 5 0.52 - 0.54 122 28 0.23 0.24 6 0.54 - 0.56 98 31 0.32 0.33 7 0.56 - 0.58 112 39 0.35 0.36 The value determined for 'lmin' is also displayed e.g. Value determined for 'lambda-min' is 0.48 (was 0.55) If the value is OK or the program is in batch mode then the the 'lmin' parameter value is automatically updated together with that of any subsequent packs where relevant following the normal parameter updates protocol. If there is a warning associated with the 'lmin' determination and the program is in interactive mode or terminal mode then the user is asked whether or not to accept the new value before proceeding to update it and any subsequent pack values if appropriate.. 12.8 THE LG_INTEGRATE COMMAND This allows for the integration of spot intensities using the procedure as described in Chapter 11 and as also used in the INTLDM program. It makes use of the LDM compatible spot integration routines written by Dr Q. Hao. The optional parameters which may follow the command are as follows: pack or all or plate (current plate, pack or all packs) nprof value (no. of bins for profiles) prof_rotate y/n (rotate profiles (yes or no)) promin value (minimum intensity for profiles) prof_all y/n (profiles for all plates in pack (yes or no)) ovlim value (no. allowed overload pixels in a good spot) e.g. lg_integrate nprof=16 The corresponding prompt sequence is: Scope (plate, pack, all) [pack]: Number intensity profile bins {nprof} [...]: Rotate profiles if elliptical spots {prof_rotate} (y/n) [...]: Minimum intensity for profiles {promin} [...]: Profiles for all plates in pack {prof_all} (y/n) [...]: Number of overload pixels allowed in a spot {ovlim} [...]: The integrated intensities data are written to an internal Laue Integrated Reflections List (LIRL). When required these intensities need to be written explicitly to the output file(s) using for example the lg_writeint command. 12.9 THE LG_WRITEINT COMMAND This allows for the integrated intensities currently stored in an internal Laue Integrated Reflections List (LIRL) to be written to output intensities files. Each pack of data is written to a separate output file or pair of files. See also Chapter 11 for further details about the writing of output intensities files. The optional parameters which may follow the command are as follows: pack or all (current pack or all packs) int_ftype code (output file type code (mtz or ge)) int_template template (output file names template) scale_int value (scale factor for output intensities) The corresponding prompt sequence is: Scope (pack, all) [pack]: File type (ge/mtz) {int_ftype} [...]: File template {int_template} [...]: Scale factor for output intensities {scale_int} [...]: An intensity file will be written for a requested pack provided that there are integrated intensities stored for at least one plate of the pack. 12.10 THE LG_CLEARINT COMMAND This allows for integrated intensities currently stored in an internal Laue Integrated Reflections List (LIRL) to be cleared for a selected plate, pack or for all packs and plates. The optional parameters which may follow the command are as follows: pack or all or plate (current plate, pack or all packs) The corresponding prompt sequence is: Scope (plate, pack, all) [pack]: 12.11 THE LG_READLDM COMMAND This allows an LDM parameters file to be read. The lg_readldmmust be followed by either the name of the LDM file to be read or, when the program is in interactive or terminal mode, the prompt request character > in which case the following prompt is output: File name: If the given file name has no extension given explicitly a file name extension of .ldm is assumed. The requested LDM file is then read with other items being initialised as described for the interactive 'Read Parameters File' option in Chapter 2 . 12.12 THE LG_WRITELDM COMMAND This allows an LDM parameters file to be written. The lg_writeldmmust be followed by either the name of the LDM file to be written or, when the program is in interactive or terminal mode, the prompt request character > in which case the following prompt is output: File name: If the given file name has no extension given explicitly a file name extension of .ldm is assumed. The requested LDM file is then written as described for the interactive 'Write Parameters File' option in Chapter 3 . 12.13 EXAMPLE OF A PROCESSING COMMAND FILE The following is an example of a sequence of commands which could be used to process a single pack of data using the parameters defined in the LDM file 'lys.ldm'. It should be noted that the crystal orientation must be determined prior to running such a series of commands and that it must be sufficiently good to enable the automatic orientation refinement protocol to home in on a refineable solution. @lys.ldm process lg_spotsize lg_refine lg_dmin lg_lmin lg_integrate lg_writeint end quit If these commands are stored in a file lys_batch.ctl, then, on a Unix system, the processing could be done using the LAUEGEN 'batch' mode by giving a command such as: lauegen -b -l lys_batch.log < lys_batch.ctl & Using the LAUEGEN program in interactive (or terminal) mode, the same processing could be done using the command: @lys_batch.ctl APPENDIX 1: SETTING UP THE PROGRAM ================================== 1.1 INTRODUCTION The program LAUEGEN is an X-windows based program distributed with the Daresbury Laboratory Laue Software Suite. It uses the library of X-windows based XDL_VIEW routines also distributed along with that suite. Documentation for these routines is available and it would be useful to get a printed copy of Vol 1 of this documentation from Daresbury which has pictures illustrating the text. The text of the documents is in the directory $CCP4_MASTER/ccp4/x-windows/xdl_view/doc. It also uses routines from the Laue library and from the CCP4 libraries. List of sections: Symmetry Operators File Fonts Program Modes Automatic Parameter Updates Compiling and Linking LAUEGEN 1.2 SYMMETRY OPERATORS FILE Before running the program the environment variable or logical name SYMOP must be set to point to the CCP4 space group symmetry operators file symop.lib. On a Unix system on which the CCP4 suite is installed, this may be done via the following command: setenv SYMOP $CLIBD/symop.lib On a VMS system on which the CCP4 suite is installed, this may be done via the following command: DEFINE/USER_MODE SYMOP CLIBD:SYMOP.LIB Otherwise the directory in which the symop.lib file resides will need to be determined and given explicitly in the string pointing to that file. 1.3 FONTS The program LAUEGEN is set up through the XDL_VIEW routines to use a 'standard' set of fonts. Basically five sizes of font are available from very small (1) to very large (5). By default LAUEGEN is set up to use the small font (no. 2) when it has an option to choose a font size. The user may override this option by setting the environment variable (or logical name under VMS) LAUEGEN_FONT to a value in the range 1 to 5 indicating the required font size. If the default fonts are not available then the fonts to be used will need to be defined as X-windows resources Xdl*font1...Xdl*font5 for five normal fonts and Xdl*boldFont1...Xdl*boldFont5 for five bold fonts. These should normally be fixed width fonts. Each series must be in ascending size order. Bold fonts must match normal fonts to within 1 pixel in width and two in height. Some of the view-objects assume that the small font does not exceed 7x13 in pixels in size; a warning message will be output if this size is exceeded. The following is an example of specifying the fonts as X-windows resources: Xdl*font1: -adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1 Xdl*font2: -adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1 Xdl*font3: -adobe-courier-medium-r-normal--14-140-75-75-m-90-iso8859-1 Xdl*font4: -adobe-courier-medium-r-normal--18-180-75-75-m-110-iso8859-1 Xdl*font5: -adobe-courier-medium-r-normal--24-240-75-75-m-150-iso8859-1 Xdl*boldFont1: -adobe-courier-bold-r-normal--10-100-75-75-m-60-iso8859-1 Xdl*boldFont2: -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 Xdl*boldFont3: -adobe-courier-bold-r-normal--14-140-75-75-m-90-iso8859-1 Xdl*boldFont4: -adobe-courier-bold-r-normal--18-180-75-75-m-110-iso8859-1 Xdl*boldFont5: -adobe-courier-bold-r-normal--24-240-75-75-m-150-iso8859-1 These lines will be included in, for example, the .Xdefaults file. 1.4 PROGRAM MODES In addition to the standard interactive program mode, two other modes of running the program are available (though not yet developed). These are a terminal mode, again to be run interactively but without any windows display and just using any character based terminal. The third mode is intended for processing in a non-interactive batch or background mode. When the program is executed, the mode may be selected by following the program name with one of the following flags: -x or -X X-windows interactive mode (the default) -t or -T Terminal mode -b or -B Batch/background mode 1.5 AUTOMATIC PARAMETER UPDATES When parameters are updated, the values may be automatically updated for other packs/plates as follows: * For pack dependent parameters, values updated for the first pack will be applied to all other packs. * For plate dependent parameters, values updated for the key plate (normally the first plate) will be updated for the other plates of the pack. If the pack is also the first pack then the parameters will be updated for all packs and plates. These are the general rules which by default apply to all parameters except w_c and the bulge parameter. The user may change the classes of parameter which will be automatically updated by setting the LAUEGEN_UPD environment variable (or logical name under VMS) to a code number with flags set for the classes of parameters to be updated as follows (value is sum of the numbers given for the required flags): Class of Parameter Number Default Update lambda_min, lambda_max 1 yes Update d_min 2 yes Update phix, phiy, phiz 4 yes Update c_to_f 8 yes Update x_cen_f, y_cen_f 16 yes Update x_c, y_c 32 yes Update w_c 64 no Update y_scale 128 yes Update twist, tilt 256 yes Update bulge 512 no Update roff, toff 1024 yes Update spd parameters 2048 yes Update spot size parameters 4096 yes The default is equivalent to 7615 (all=8191) 1.6 COMPILING AND LINKING LAUEGEN The source code is in lauegen.for and the include files are in the composite file lauegen.inc. This latter file may be split into its component files with the 'isplit' program supplied with the Laue suite. If your compiler does not support the include statements as used then they may be 'included' in the source code file using the 'fincl' utility supplied with the Laue suite. Apart from these include statements and the use of long variable & subroutine names, the code should be in standard Fortran 77. It should be noted that the XDL_VIEW routines are written in 'C' and need to be installed as described in their documentation to ensure that the appropriate Fortran/C interfacing is done. The program needs to be linked with the following libraries which should be in the directory pointed to by $CCP4_LIB libldm, liblaue, libxdl_view, libccp4 and also to the Xt and X11 x-windows libraries. In some situations, the limits set within the program may not be sufficiently large to cope with a particular case. The most likely instance is an image which is too large. In such a case, change the value of the MAX_IMG_WORDS parameter in lauegen.inc and rebuild the program. The required value for a machine using 4-byte words will be the number of pixels in the image divided by 2 for IMAGE_DATA = 'i2', 'mar', or 'pfbyte' or divided by 4 for IMAGE_DATA = 'byte'. APPENDIX 2: THE PARAMETERS ========================== 2.1 INTRODUCTION The LAUEGEN program makes use of the Laue Data Module (LDM). In fact an extended LDM parameter set with additional integration related parameters being defined for use with LAUEGEN and also the program INTLDM. The LDM parameters are described briefly in the following sections but more detailed descriptions and definitions can be found in the LDM documentation. The extended, integration related parameter are described in detail. List of sections: The Crystallographic/Pack Parameters The Current Plate Parameters The Extended Integration Related Parameters 2.2 THE CRYSTALLOGRAPHIC/PACK PARAMETERS These are the parameters displayed in the parameter table 1 of the program. Further details are given in the LDM documentation and the corresponding keywords are indicated in the table below. They are as follows: Crystal System and Alignment system SYSTEM This is the crystal system and is one of the following: Triclinic (Tri.) Monoclinic (Mon.) Orthorhombic (Ort.) Tetragonal (Tet.) Hexagonal (Hex.) Rhombohedral (Rho.) Cubic (Cub.) When setting the crystal system, the drop down menu may be used or the abbreviation, shown in brackets above, may be entered. lattice LATTICE This is the lattice type and is one of the following: Primitive (P) 'A' face centred (A) 'B' face centred (B) 'C' face centred (C) Body centred (I) Face centred (F) Rhombohedral (R) When setting the lattice type, the drop down menu may be used or the abbreviation, shown in brackets above, may be entered. symmetry SYMMETRY This is a flag indicating whether or not the space group symmetry has been defined. Symmetry operators may be input via an LDM parameters file or via the command window. LAUEGEN only uses this symmetry, if present, for the determination of systematic absences. rotation Axis ROTATION_AXIS This defines which 'signed' reciprocal axial direction is the one closest to the crystal rotation axis. It may be +a*, +b*, +c*, -a*, -b* or -c*. The code may be entered or the value selected from the drop down menu. beam Axis BEAM_AXIS This defines which 'signed' reciprocal axial direction is the one closest to the X-ray beam direction away from the source. It may be +a*, +b*, +c*, -a*, -b* or -c*. The code may be entered or the value selected from the drop down menu. Pack Identifier pack id PACK_ID[] This is the pack identifier (integer) for the current pack. By default it is the same as the pack number. Spindle Setting spindle SPINDLE[] The rotation angle around the spindle (rotation) axis in degrees. Cell Parameters a, b, c, alpha, beta, gamma A, B, C, ALPHA, BETA, GAMMA These are the real cell parameters in Angstroms and degrees. Note that the values are only displayed for the ones unique to the current crystal system. Any others input will be stored internally but only displayed and used if the crystal system parameter is changed. Soft Limits lmin LMIN[] The minimum wavelength of the white beam in Angstroms for the current pack. lmax LMAX[] The maximum wavelength of the white beam in Angstroms for the current pack. dmin DMIN[] The resolution limit in Angstroms. Crystal Orientation Parameters phix, phiy, phiz PHIX[], PHIY[], PHIZ[] The crystal missetting angles in degrees around the laboratory frame X, Y and Z axes. (see Appendix 4 for coordinate systems) Image/Detector Parameters image type IMAGE_TYPE The detector type which is currently either 'film' or 'ip' (image plate). A drop down menu is supplied. image data IMAGE_DATA The data format in an image file. The options are currently 'byte' (unsigned byte data -no header), 'i2' (unsigned two-byte data - no header), 'mar' or 'pfbyte' (Photon Factory - single byte pixels using a log scale - no header). detector geom. DGEOM Detector geometry = 'flat' for a flat plate or 'cyl' for a cylindrical camera. Note that some of the formulae used by the program strictly speaking only apply to the flat plate case (spot ellipses, distortion corrections). numpack NUMPACK The number of packs of images in the dataset. nplates NPLATES The number of images (plates) in a pack. fiducials FIDTYPE This parameter indicates whether or not fiducial marks are to be used. (See Appendix 7 for further details) distortion DISTORTION_TYPE This has three possible values which may be selected from the drop down menu. They are: standard Standard case; the distortion parameters which may be refined will be twist, tilt and bulge. r/toff This is for use with radially scanned image plates; the distortion parameters which may be refined will be twist, tilt, roff and toff. spdxy This is to use a polynomial based distortion correction in addition to a twist and tilt correction. The relevant distortion parameters for the current plate will be displayed in parameter table 2 (see next section). For further details on these distortion parameters, see Appendix 5 . detector tilt DTILT This allows for a detector tilt expressed as an angle of rotation in degrees around the crystal rotation axis. A value of 180 gives the back reflection Laue case. This is ignored for a cylindrical camera. spot eps SPOT_EPSILON Spots closer than this distance in mm will be flagged as being too close to consider spatial overlap deconvolution at the integration stage. spot thresh STHRESH When searching for spot positions, only pixels with intensities greater than this threshold level above the local background are used. overload pix OVERLOAD_PIXEL Pixel values greater than or equal to this (integer) value are considered to be overloads. If a value of zero is given then all pixel values, for the type of data in the image, will be considered valid. template TEMPLATE A filename template used to construct image file names if they are not explicitly input. A field of # characters within the template will be replaced by the pack identifier (plus a plate letter a, b... if there is more than one plate per pack) to give the required file name. nxrast NXRAST The number of rasters in the 'xd' direction of the image file. nyrast NYRAST The number of rasters in the 'yd' direction of the image file. raster RASTER_SIZE The image scanning raster size in microns. Where there is a difference in the 'xd' and 'yd' directions, this is the value in the 'xd' direction; the y-raster size usedinternally is calculated from this using the y_scale parameter (see below). axis order AXORD The axis order in the input image file defined with respect to the xd, yd directions. The data order code defines the axis order in the image in terms of x and y (the detector xd, yd axes). The slower moving axis is given first followed by the faster moving axis. A minus sign is used when the order of an axis is reversed. The code 's' if present indicates that byte swapping is to be done and the code 'n' indicates that no byte swapping is to be done (byte swapping only relevant for some image data types). Characters, other than 'x', 'y', '-', '+', 's' and 'n', or their upper case equivalents, are ignored. Examples of valid axis order strings are xy, +xd+yd and -yxs. rmin RMIN Exclude a region of radius 'rmin' in mm from the pattern centre from any predictions and spot processing e.g. to exclude a bad region caused by a back stop. rmax RMAX The maximum radius, in mm, of the circular area around the pattern centre to be used in pattern prediction and spot processing. xlow, xhigh, ylow, yhigh XLOW, XHIGH, YLOW, YHIGH These limits describe a rectangular area of the image to be used for determining spot positions and for pattern prediction. They are in raster units and are the low and high limits along 'xd' and 'yd' respectively. By default, the whole image will be used subject to the 'rmin' and 'rmax' defined above. 2.3 THE CURRENT PLATE PARAMETERS The parameters associated with the current plate are displayed in parameter table 2. These are as follows: filename FILENAME[][] The image file name for the current plate either from an explicit definition or constructed from the template if no explicit name was given. ctof CTOF[][] This is the crystal to plate distance in mm. x_cen_f, X_CEN_F[][] This value defines the position along 'xd' of the uncorrected 'plate centre' in rasters (see Appendix 6 ). y_cen_f, Y_CEN_F[][] This value defines the position along 'yd' of the uncorrected 'plate centre' in rasters (see Appendix 6 ). x_c offset X_C[][] This is the camera constant for correction of the 'plate centre' position (see Appendix 6 ) to give the corrected centre coordinate along 'xd'. The units are mm. (see also Appendix 4 ) y_c offset Y_C[][] This is the camera constant for correction of the 'plate centre' position (see Appendix 6 ) to give the corrected centre coordinate along 'yd'. The units are mm. (see also Appendix 4 ) w_c offset W_C[][] This is the camera constant for correction of the plate orientation in degrees. (see also Appendix 4 ) y_scale Y_SCALE[][] The 'scanner parameter' which may also be defined as the x-raster size divided by the y-raster size. twist TWIST[][] The 'twist' distortion parameter in 1/100 degree units (see Appendix 5 ). tilt TILT[][] The 'tilt' distortion parameter in 1/100 degree units (see Appendix 5 ). bulge BULGE[][] The 'bulge' distortion parameter in 1/100 degree units (see Appendix 5 ). This is only displayed when the 'standard' distortion correction option is being used (see section above). roff ROFF[][] The radial offset 'roff' parameter in 10 micron units (see Appendix 5 ). This is only displayed when the 'r/toff' distortion correction option is being used (see section above). toff TOFF[][] The tangential offset 'toff' parameter in 10 micron units (see Appendix 5 ). This is only displayed when the 'r/toff' distortion correction option is being used (see section above). spdxy SPDXY[][] The xy cross term associated with the polynomial spatial distortion correction (see Appendix 5 ). This is only displayed when the 'spdxy' distortion correction option is being used (see section above) spdx_n SPDX_N[][] etc. The polynomial order for the 'xd' spatial distortion correction (see Appendix 5 ). This is only displayed when the 'spdxy' distortion correction option is being used (see section above). Selecting the edit option from the drop down menu pops up a window in which all the correction terms, associated with the polynomial based corrections along 'xd' and 'yd', may be displayed and edited if required. spdy_n SPDY_N[][] etc. The polynomial order for the 'yd' spatial distortion correction (see Appendix 5 ). This is only displayed when the 'spdxy' distortion correction option is being used (see section above). Selecting the edit option from the drop down menu pops up a window in which all the correction terms, associated with the polynomial based corrections along 'xd' and 'yd', may be displayed and edited if required. spot length SPOT_LENGTH[][] This is the estimated elliptical spot length in mm. (or the spot diameter if circular spots are assumed (see Appendix 14 ) spot width SPOT_WIDTH[][] This is the estimated elliptical spot width in mm. If a value of 0.0 is given, then circular spots with a diameter equal to the spot length are assumed. If a value greater than zero is given then the radial masking option is used (see Appendix 14 ) spot factor SPOT_FACTOR[][] The elliptical spot length scaling factor if radial masking is being used (see Appendix 14 ). spot border SPOT_BORDER[][] The elliptical spot background border width in pixels if radial masking is being used (See Appendix 14 ). Spot delta SPOT_DELTA[][] This is a spot separation parameter in mm. Any spots closer than this will be considered to be spatially overlapped. This value is only used when the spot_width is zero, otherwise spatial overlaps are determined using the radial masks (see Appendix 14 ). 2.4 THE EXTENDED INTEGRATION RELATED PARAMETERS INT_FTYPE This indicates the type of output file required for the integrated intensities. It may either be 'mtz' (the default) to output an MTZ relection file or 'ge' to output the old style .ge1/.ge2 files. INT_TEMPLATE This provides a template from which the output integrated intensities file names are constructed. It must contain a field of hash characters which will be replaced by the pack identifier number when the output file name is formed. The default template is 'int####.mtz'. If the output file type is 'ge' then two output file names will be constructed with extensions .ge1 and .ge2; any given extension will be ignored in this case. If the output file type is 'mtz' then the file extension will be as specified in the template. NPROF This is the number of bins to be used for profile determination and fitting. These are selected radially around the centre of the pattern. The default value is that returned by the routine LFN_SAINT_DF and, at the time of writing, is 8. The value must be an integer in the range 1-17. PROF_ROTATE This is a flag indicating whether or not to rotate profiles data to theta = 0.0 radially around the beam direction when forming profiles from elliptical spots ('yes' or 'no'). The default value is 'yes'. If profile rotation is used then a reverse rotation is applied to the profile when a spot is integrated. The potential advantage of taking account of the exact radial angles and possibly variable lengths of the spots must be offset against a degree of inaccuracy resulting from the pixel mapping process involved. No rotation is done when spots are circular. PROMIN This is the minimum intensity for which spots are to be included in the determination of profiles. The default value is 0.0 which indicates an undefined value. If the default value is used then LAUEGEN will use a value of 600.0 for image-plate data and a value of 100.0 for film data. Any positive real value is valid. PROF_ALL This flag indicates whether profiles are to be determined for each plate of a multi-plate pack (code = 'yes') or whether they are only to be determined using the key (normally the first) plate of the pack (code = 'no'). The default is 'no'. The keyword has no effect if there is only a single image in a pack. OVLIM This is the number of overloaded pixels allowed within a spot peak for the integrated intensity still to be considered as good. If there are more than this number of overloaded pixels, the intensity will be flagged as an intensity overload. SCALE_INT This is a scale factor to apply to the output integrated intensities before being written to the output file. This is important if the file output type is 'ge' as the output intensities are stored in this case as integers up to 32767. The default value is 0.0 to indicate an undefined value. If the default value is used then LAUEGEN will use a value of 0.1 for image-plate data and a value of 1.0 for film data.Any positive real value is valid. APPENDIX 3: FILE FORMATS ======================== 3.1 INTRODUCTION This Appendix gives a full description of the LAUEGEN specific file formats and a brief description of the formats of other files used by the program. List of sections: The Parameters File The Spot Positions File The Spot Matches File The Reflections List File The Image Files The .ge Files The Output Intensities File 3.2 THE PARAMETERS FILE This is an LDM keyworded parameter file. For details, see the documentaion of the Laue Data Module available as part of the Daresbury Laboratory Laue Software Suite. 3.3 THE SPOT POSITIONS FILE The spot positions file has the following format: spots: (as shown) xcen ycen (2F9.3) x1 y1 (2F9.2) x2 y2 " etc. " xcen, ycen are the coordinates of the centre position, in rasters, relative to which the spot positions were measured (along the image xd, yd directions respectively - see Appendix 4 ). x1 y1, x2 y2 etc. are the spot coordinates in raster units (along the image xd, yd directions respectively - see Appendix 4 ). When the files are read in by LAUEGEN, the reading is in free format and the 'spots:' keyword is case insensitive. 3.4 THE SPOT MATCHES FILE The spot matches file has the following format: matches: (as shown) h1 k1 l1 x1 y1 (3I5,2F8.2) h2 k2 l2 x2 y2 " etc. " h1 k1 l1 x1 y1, h2 k2 l2 x2 y2 etc. are the reflection indices and observed spot coordinates converted to mm (along the image xd, yd directions respectively - see Appendix 4 ). When the files are read in by LAUEGEN, the reading is in free format and the 'matches:' keyword is case insensitive. 3.5 THE REFLECTIONS LIST FILE The reflections list file has the following format: reflist: (as shown) h1 k1 l1 (3I5) h2 k2 l2 " etc. " h1 k1 l1, h2 k2 l2 etc. are the reflection indices. When the files are read in by LAUEGEN, the reading is in free format and the 'reflist:' keyword is case insensitive. 3.6 THE IMAGE FILES The basic film/image-plate files used by the Laue suite contain the pixels data only and do not have any header information. For film data, each pixel is stored as a single unsigned byte and for image-plate data, each pixel is stored as an unsigned two-byte integer. The standard data order for the Daresbury Laboratory Laue Suite is to have xd (xf) as the slower moving index in the file and yd (yf) as the faster moving index (see Appendix 4 ). For image-plate data the byte order, within each two byte integer, should be that appropriate to the computer on which the programs are being run. LAUEGEN and INTLDM will cope with other orders and with byte swapped data but other programs in the suite (e.g. INTLAUE) will not. Two additional image formats are also supported; these are the 'MAR' image plate format (including header and overflow pixels handling) and a Photon Factory format which stores pixel intensities in single bytes using a logarithmic scale (pixel intensity = nint(10**(4.0*ipix/255.0)-1) where 'ipix' is the stored pixel value from 0-255). 3.7 THE .GE FILES The .ge1/.ge2 files are binary files which are used internally by the Laue suite and are not documented here. Note: these currently cater for only 6 films/plates in a pack; there are plans to replace this current format with a new one at some stage. A .gen parameter file will also be written along with these for use with the INTLAUE program. Its structure is described in the documentation of the GENLAUE program. Additional records containing a polynomial based spatial distortion correction may be written by LAUEGEN at the end of such a file. 3.8 THE OUTPUT INTENSITIES FILE Two possible output file formats are available. These are the .ge1/.ge2 files as originally used in the Daresbury Laboratory Laue Software Suite and a newer MTZ format as specified in 1995. The MTZ file has the following columns: H Measured 'h' index K Measured 'k' index L Measured 'l' index PACK_ID Pack identifier PLATE Plate number within pack XF 'x' coordinate of spot in mm from pattern centre (ideal) YF 'y' coordinate of spot in mm from pattern centre (ideal) LAMBDA Wavelength (Angstroms) I Integrated intensity (real) SIGI Sig(I) (0.0 = not integrated) MULT Multiplicity MINHARM Minimum harmonic number MAXHARM Maximum harmonic number NOVPIX The number of overloaded pixels found in the spot when being integrated (-1 if not determined) FLAGS bit 0 spatial overlap bit 1 too close to integrate bit 2 overload bit 3 bad spot (other than overload) APPENDIX 4: COORDINATE SYSTEMS ============================== 4.1 INTRODUCTION The coordinate system is that defined for use within the Laue Data Module. The relationship between the ideal ('film') coordinate system ('xf', 'yf') used by the Laue software suite and the 'Laboratory Coordinate System' (X, Y, Z) is illustrated. Figure 4.1 Laboratory and Detector Axes (at end of appendix) The relationship of the detector axes 'xd', 'yd' to these ideal coordinates is also illustrated for the case where no additional distortion corrections are made. Figure 4.2 Ideal and Detector Axes and Camera Constants (at end of appendix) The illustrations are for flat plate detectors.If the cylindrical camera option is used, the cylinder axis is assumed to be parallel to the rotation (laboratory 'Z' axis) with the crystal situated on the axis. Details of the coordinate transformations with distortion corrections are given in Appendix 5. List of sections: Scanner Axes for Image Plate Scanner Coordinates for Film Camera Constants Transformations 4.2 SCANNER AXES FOR IMAGE PLATE These are defined such that 'xd' is essentially along 'xf' and 'yd' along 'yf'. 4.3 SCANNER COORDINATES FOR FILM The drum coordinate system used by the program is defined with 'xd' along the axis of the drum and 'yd' around the cylindrical surface of the drum. The film is mounted on the drum with the drum rotation axis along 'xd' as illustrated. The numbering of the fiducials must also be as shown for the two cameras in use at Daresbury. Figure 4.3 Film Fiducial Positions (at end of appendix) The direction of drum rotation on Optronics microdensitometers is opposite to that of the Joyce Loebl Scandig, and consequently the direction of 'yd' is effectively reversed. To allow for this the film must be inverted top-to-bottom when placed on the drum of an Optronics machine. This is the only change required, and the fiducial coordinates should be given relative to the Scandig coordinate frame ('xd' along the drum axis from left to right, 'yd' around the drum in an anticlockwise direction). Thus in both these cases 'xd' is essentially along 'xf' and 'yd' along 'yf'. 4.4 CAMERA CONSTANTS These are parameters which relate the position of the measured centre and film/plate orientation (e.g. as derived from the fiducial spots) to the position and orientation of the ideal co-ordinate frame ('xf', 'yf'). Where fiducials are present, they may be used to determine a measured centre position (x_cen_f, y_cen_f) and an initial value for the orientation correction angle (w_c) (see Appendix 6 .) These values will be approximate and the errors or corrections to these to get the exact pattern centre are the camera constant offsets x_c, y_c in mm. The orientation correction w_c (degrees) also needs to be refined. The corrected centre x_cen, y_cen (in raster units along 'xd' and 'yd') is given by: x_cen = x_cen_f + x_c*mm_rast_x y_cen = y_cen_f + y_c*mm_rast_y where mm_rast_x and mm_rast_y are factors converting millimetres to raster units along 'xd' and 'yd' respectively. Where fiducials are not used, x_cen_f, y_cen_f need to be determined by some other means and input and w_c is normally set to zero (see also Appendix 6 ). There are options in LAUEGEN for finding the centre position from the Laue pattern itself. 4.5 TRANSFORMATIONS The basic parameters which define the transformation between the ideal coordinates 'xf', 'yf' (in millimetres for the ideal case) and scanner/image co-ordinates 'xd', 'yd' (in raster units) are x_cen, y_cen the position of the pattern centre or direct beam (raster units), w_c (the the angle between 'xf' and 'xd') and K a scale factor (note that K is equal to 1.0 unless a distortion correction is being applied as the crystal-to-image (c_to_f) distance is implicit in the coordinates). A further scale parameter 'y_scale' is used to define the relative scales along 'yd' and 'xd'. This is necessary for example because X-ray film is double-sided and the film image is at a slightly larger radius than the drum surface when the film is mounted. The effect is to increase the separation between samples along 'yd' by approximately 0.2%. This same factor is also needed when the pixel is not exactly square as in some image plate scanning systems. In LAUEGEN, two conversion factors from millimetres to rasters are used mm_rast_x (along 'xd') and mm_rast_y (along 'yd') where y_scale = mm_rast_y/mm_rast_x. The basic transformation is given by xd = x_cen + K*(xf*cos(w_c) - yf*sin(w_c))*mm_rast_x yd = y_cen + K*(xf*sin(w_c) + yf*cos(w_c))*mm_rast_y giving coordinates in raster units along 'xd' and 'yd'. (w_c converted to radians for determining sin(omega) and cos(omega)). The transformations taking account of distortion corrections are given in Appendix 5. Figure 4.1 Laboratory and Detector Axes Figure 4.2 Ideal and Detector Axes and Camera Constants Figure 4.3 Film Fiducial Positions APPENDIX 5: DISTORTION CORRECTIONS ================================== 5.1 INTRODUCTION This appendix describes the expressions used in converting the ideal predicted spot coordinates xf, yf (mm) into actual detector coordinates (in rasters) allowing for various types of distortion. The basic transformation without distortion corrections is described above in Appendix 4 . Note that the corrections are for flat plate detectors and will have more limited success if a cylindrical camera is used. Let the ideal predicted spot position be xf, yf. The coordinates xq, yq with respect to the same origin but rotated to be parallel to the detector axes are given by: xq = xf.cos(w_c) - yf.sin(w_c) yq = xf.sin(w_c) + yf.cos(w_c) The corrections for the various types of distortion correction are described in the following sections. List of sections: Standard Distortion Correction Distortion Correction for Radially Scanned Plates Polynomial Based Spatial Distortion Correction Addition of Centre and Conversion to Rasters 5.2 STANDARD DISTORTION CORRECTION This is the tilt, twist, bulge correction as used in MOSFLM for processing film data. The distortion corrected coordinates are given by: xfd = K*xq yfd = K*yq where K=1.0+(torad/c_to_f)*(tilt*xq+twist*yq+bulge*sqrt(xq**2+yq**2)) and where torad is a conversion factor from 1/100 degrees to radians Thus the distortions are equivalent to variations in crystal-to-film distance with position on the film. 'tilt' is an 'xf' dependent variation due to rotation of the cassette about the film axis 'yf', while 'twist' is 'yf' dependent. 'bulge' gives rise to a radial dependence of crystal-to-film distance and is equivalent to a cone-shaped film with a half angle close to 90 degrees. Note that whereas an error in crystal-to-film distance gives rise to a linear dependence of coordinate shift, distortions always result in a quadratic variation of discrepancy between observed and calculated positions on the film. 5.3 DISTORTION CORRECTION FOR RADIALLY SCANNED PLATES For a radially scanned image plate such as the MAR system, the distortion parameters used are the 'twist' and 'tilt' as described above and the two parameters 'roff' and 'toff' a radial and tangential offset correction factor. The distortion corrected coordinates are given by: xfd = K*xq + 0.01*(-toff.sin(psi)+roff.cos(psi)) yfd = K*yq + 0.01*(toff.cos(psi)+roff.sin(psi)) where K=1.0+(torad/c_to_f)*(tilt*xq+twist*yq) torad is a conversion factor from 1/100 degrees to radians cos(psi)=xq/sqrt(xq**2+yq**2), sin(psi)=yq/sqrt(xq**2+yq**2) 5.4 POLYNOMIAL BASED SPATIAL DISTORTION CORRECTION If the 'spdxy' polynomial based spatial distortion correction is used, then the following corrections are made: First xfd = K*xq yfd = K*yq where K is the same as for the 'r/toff' correction The spatial distortion cross xy term is then applied to xfd xfd = xfd+spdxy*yfd Normalised coordinates in the range -1.0 to 1.0 are then calculated xp = (2.0*xfd-spdx_min-spdx_max)/(spdx_max-spdx_min) yp = (2.0*yfd-spdy_min-spdy_max)/(spdy_max-spdy_min) The coordinates are then corrected using the Chebyshev polynomial coefficients . spdx_n xfd = xfd + Sigma (spdx(i)*T(i-1)(xp) - 0.5*spdx(1)) i=1 spdy_n yfd = yfd + Sigma (spdy(i)*T(i-1)(yp) - 0.5*spdy(1)) i=1 where T(n)(X) = cos(n*arcos(X)) are the Chebyshev polynomial terms 5.5 ADDITION OF CENTRE AND CONVERSION TO RASTERS After applying the distortion corrections, the corrected detector coorinates in raster units are calculated as follows: xd = x_cen_f + (x_c + xfd)*mm_rast_x yd = y_cen_f + (y_c + yfd)*mm_rast_y where mm_rast_x and mm_rast_y are conversion factors from mm into xd and yd rasters respectively. APPENDIX 6: THE PLATE CENTRE ============================ 6.1 INTRODUCTION When the program needs to make use of the plate centre position e.g. for calculating predicted spot positions on the image, the following procedure is carried out the first time the image is read for a particular plate. If x_cenf and y_cen_f are non-zero for the plate in question then these values are used. If not then, if fiducials are to be used, the fiducials are found and values are set for x_cen_f, y_cen_f and w_c as follows: x_cen_f = ( x[1] + x[3] )/2 y_cen_f = ( y[1] + y[3] )/2 w_c = ARCTAN(( y[3] - y[2] )/( x[3] + x[2] )) (in degrees) where x[1], y[1], x[2], y[2], x[3], y[3] are the fiducial positions (along 'xd', 'yd') in raster units If the program was unable to find the fiducials or if fiducials are not being used, then a pop-up notice is displayed and a warning is output that the plate centre is being set to the image mid-point, nxrast/2, nyrast/2 (w_c is left unchanged in this case). APPENDIX 7: FINDING FIDUCIAL POSITIONS ====================================== 7.1 INTRODUCTION The required positioning of fiducials and the determination of the plate centre etc from them are described in Appendix 4 and Appendix 6 . This appendix describes how the program searches for the fiducials given their expected positions as parameters in the LDM data file. If the values of x_cen_f and y_cen_f have been set, then the fiducial positions are ignored and no search will be done. Thus to use fiducial marks, x_cen_f and y_cen_f must be set to zero for the plate in question as well as setting the fiducials type flag to 'yes'. The fiducials search starts with the box size from the LDM parameters FIDBOX around the given expected input positions FIDX1, FIDY1, FIDX2, FIDY2, FIDX3, FIDY3 and with a pixel intensity threshold of FTHRESH. The program searches for the spot centre of gravity within the box for each fiducial using the pixels with intensities above the threshold value. If not all three fiducials can be found, then a warning message will be output and the following prompt given: Retry with modified limits [y]: If a reply of 'yes' is given the following prompt and answer sequence is entered: Threshold value [thresh]: This enables a new (reduced) pixel intensity threshold to be selected. Box size (mm) [fidbox]: This enables a new (increased) fiducials search box size to be input. The search process will then be repeated. The process continues until the fiducial positions have been found or until the user decides not to retry any further; in this latter case it will be necessary to process the pack by making use of a user specified centre (x_cen_f, y_cen_f, see also Appendix 6 ). If a log file is being written, then details of the found fiducial positions will be written to that file. APPENDIX 8: IMAGE BACKGROUND HANDLING ===================================== 8.1 INTRODUCTION When a plate image is read for the first time then a default background image will be calculated using the radial x-strip option. This is described in detail in Chapter 5 . The number of pixels width of the search strip is given by: npbox = 2*(img_h/50) + 1 where img_h is the height of the displayed (compressed) image in pixels. For a 2400*2400 pixel film image or a 1200*1200 MAR image plate image, the compressed image height is 600 and npbox=25. The lowest 50 percent of pixels are used to determine the background values. If required, an alternative background image may be calculated via the 'Display/Measure Image' option (see Chapter 5 ). This background image will be used until another pack/plate has been selected.input. Note that the background calculations in LAUEGEN are done on a compressed image (compressed as the image in the main image display window). When a threshold above background is required for finding a spot position, the nearest point in the compressed image to the predicted spot position is found and the value from the background image at that point is used (see also Appendix 10 ). Figure 8.1 Example of a background image for a Proflavin film, using the 2-Dbackground method (at end of appendix) Figure 8.1 Example of a background image for a Proflavin film, using the 2-Dbackground method APPENDIX 9: NODAL SPOTS ======================= 9.1 INTRODUCTION Currently, in the Daresbury Laboratory Laue Suite, nodal reflections are defined as those reflections for which none of the absolute values of the 'nodal' indices hn, kn and ln (the reflection indices after dividing the by their highest common factor) exceeds 12. When reflections are predicted, any such spots are flagged as being nodals and these flags are passed to the output .ge1 file when it is written. When spots are selected for a refinement, the nodal spots are used as they tend to be the ones which are best separated from surrounding spots. In this case the user selects a nodal index (from 1-12) and only those spots, for which the absolute values of hn, kn, and ln do not exceed this value, are used. In one refinement option, separate limits for hn, kn and ln may be selected. Also in the case where Laue simulations are done, a nodal index (from 1-12) may be selected and those spots, for which the absolute values of hn, kn and ln do not exceed this value, are marked on simulations where nodal spots are distinguished. APPENDIX 10: DETERMINING SPOT POSITIONS ======================================= 10.1 INTRODUCTION Note that the procedure used for determining spot positions as part of the automatic parameter refinement protocol differs in a number of details from that described here; these differences are noted in Appendix 12 . When a spot position is to be determined, the pixels, in a box of user defined size (odd number of pixels square) centred at the predicted position, are used. A background value for the box is determined using the value in the background image closest to the box centre (see Appendix 8 ). The centre of gravity of all pixels, with intensities more than a given threshold value above the background level (STHRESH) is then determined. When searching for spots for a refinement, it may happen that the spot found is closer to an edge of the box than the radius specified via the spot size. In this case, an estimate is made of a more accurate position by estimating the amount of spot which has been cut off. For example, if the spot is cut off at the high 'x' side of the box then the estimated shift to the spot position in rasters is: cgx - xm + spot_diam/2.0 - box_size/2.0 where cgx is the initial estimate of the centre of gravity in 'x' (in rasters). xm is the predicted spot position in 'x' (in rasters). spot_diam is the spot diameter in rasters. box_size is the box size in rasters. A new spot position is measured at this adjusted position using a box of half size equal to the spot radius multiplied by 1.5 to give some latitude. When radial masking is used, a similar procedure is followed except that the centre of gravity is determined for pixels within the elliptical mask defined for the spot instead of a square box. APPENDIX 11: SPATIALLY OVERLAPPED SPOTS ======================================= 11.1 INTRODUCTION When the Laue Reflection List (LRL) routines (as used by LAUEGEN) generate a predicted Laue pattern, this is followed by the determination of which spots will be spatially overlapped given the minimum spot separation distance 'spot_delta'. This is done by scanning the image space in strips across the 'xd' direction and along 'yd'. The number of strips used is given by the following expression: num_strips = (num_reflex)/(max_spots_in_strip/3.0) + 2 where num_reflex is the number of predicted reflections and max_spots_in_strip is the maximum number of spots which may be stored/strip. The factor or 3.0 is introduced as the distribution of spots throughout the image will not, in general, be even. For each strip an extra 2.0*spot_delta is added to the width to ensure that all potentially overlapped spots are considered. The spots within a strip are sorted into order by 'yd' and then searched for overlaps. Spots whose centres are closer than 0.01 mm are considered to be potentially multiples and are marked for further treatment as such. Spots more separated than 0.01 mm but closer than the user specified 'spot_epsilon' value are flagged as being spatially overlapped and also as being too close to attempt separation at the integration stage. Spots separated by more than 0.01 mm and 'spot_epsilon' but closer than the user defined 'spot_delta' value are flagged as spatially overlapped spots. Spatially overlapped spots are not used for refinement purposes. When radial masking is used, the 0.01 mm limit and 'spot_epsilon' are treated in the same manner but more distant spots will only be marked as spatially overlapped if the radial masking ellipses for the spots overlap. APPENDIX 12: REFINEMENT METHODS =============================== 12.1 INTRODUCTION The program LAUEGEN uses two sets of routines for the least squares refinement of parameters. These are a non-linear least squares refinement using the routine 'LSQMIN' from the Daresbury Laboratory Laue Suite Laue library routines and a 'Powell' minimisation routine 'SSQMIN' also from that library. These routines minimise the sum of squares of 'm' given functions of 'n' parameters. The function minimised is: M F(x) = Sigma [f(j)(X(1),X(2),...X(N))]**2 (M>=N) j=1 An estimate of the solution must be supplied to the routines and a subroutine to calculate the values of the functions f(j), j=1,2,...M for any values of the parameters X[i] must also be given. List of sections: The Least Squares Refinement Method Powell Minimisation The Automatic Refinement Protocol 12.2 THE LEAST SQUARES REFINEMENT METHOD This is similar to the standard type of crystallographic refinement where the non-linear least squares problem is transformed into a linear least squares problem for which an approximation to the required corrections to the parameters can be solved by linear least squares. The process is iterated until convergence is achieved. The procedure requires a knowledge of the partial derivatives of the function to be minimised with respect to the parameters. In the procedure adopted by 'LSQMIN' an approximate value for the partial derivative of each parameter is calculated by making a small shift in the parameter value, calculating the new function value, and dividing the shift by the change in the function value. As this is an approximation only, the user is given the option of selecting the step size for use in the derivative calculation (Deriv. step); the default is 0.1E-05 which seems to work all right in most cases. It is common in the non-linear least squares refinement that the required parameter shifts tend to be over estimated so that it is advisable only to apply a fraction of the calculated shifts at each iteration. The user may select this fraction (Damp factor); the default value of 0.5 is usually satisfactory though it may be possible to get a marginally better refinement by using a smaller fraction towards the end of the refinement. The other tuning parameter under user control is a shift limit (default = 0.001); if all the parameter shifts are less than this then the refinement procedure will be terminated. In any case, a limit on the number of iterations to be performed is given; this is set at 50. (Note; these default values are those used in the 'Refine Orientation' option of LAUEGEN. 12.3 POWELL MINIMISATION The modified Powell minimisation routine used in LAUEGEN is based on methods and code described in 'Numerical Recipes in C' by W. Press, B. Flannery, S. Teukolsky and W. Vettering Cambridge University Press. In some instances it gives a slightly better refinement of the parameter values than the least-squares method. It is however significantly more time consuming and, if used in the 'Refine Orientation' option of LAUEGEN, it should only be used at the very end of a refinement procedure. The user may alter the value for the fractional tolerance in the function value such that failure to decrease by more than this amount one one iteration signals completeness; the default value used in the 'Refine Orientation' option is 0.1E-05 which should normally be satisfactory. The smaller this value, the longer the procedure is likely to take. The procedure is an iterative one and a maximum of 50 iterations is allowed in the 'Refine Orientation' option. The Powell minimisation routine is also used in a number of other places in the program where the number of parameters and observations are small; these are for finding the centre from the intersection of a number of conics or for refining the centre position making use of gnomonic projection geometry. 12.4 THE AUTOMATIC REFINEMENT PROTOCOL The automatic refinement procedure whether invoked fro the 'Refinement Options' menu or via the lg_refinecommand uses the same protocol being that of the LDM based subroutine LFN_AUTO_REFN. This routine is used to carry out an automatic orientation refinement for a single plate, a pack or all packs and plates. The refinement procedure is split into three phases after an initial spot search. These are illustrated in a flow chart. Figure 12.1 Outline of Automatic Refinement Protocol (at end of appendix) Spots with a fixed nodal index (the program set default of 4 or a user specified nodal index or minimum number of spots) are used throughout the procedure until the final refinement phase is reached. The three phases are as follows: 1) The first phase will attempt to get the refinement started even if the initial rms is poor (> 0.25 mm or less than half the spots found). This phase will continue to try and get a reasonable rms (up to a maximum of 8 cycles) provided that, either the number of spots found is increasing or the rms is falling and the number of spots does not decrease by more than one quarter in a cycle. The phase is regarded as complete when the rms is <= 0.25 mm provided that at least half the spots have been found. The main refinement phases may then be entered. Figure 12.2 Flowchart of Initial Refinement Phase (at end of appendix) 2) The main refinement phase carries out a standard refinement protocol of 4 cycles (7 if the polynomial based spatial distortion correction is being used). The parameters refined are as follows: a) Standard or radial scan distortion parameters. Cycle 1: Phis, ctof, x_c, y_c (key plate), or ctof, x_c, y_c, w_c (others) Cycle 2: As for cycle 1 + cell parameters (if required). Cycle 3: As for cycle 2 + distortion parameters. Cycle 4: Same as cycle 3. b) Polynomial based distortion correction. Cycle 1: Phis, ctof, x_c, y_c (key plate), or ctof, x_c, y_c, w_c (others) Cycle 2: As for cycle 1 + cell parameters (if required). Cycle 3: As fot cycle 2 + y_scale, twist, tilt. Cycle 4: Phis (key plate) or w_c (others) + cell (if required) + polynomial based distortion parmeters. Cycle 5: As for cycle 4. Cycle 6: As for cycle 3. Cycle 7: As for cycle 4. 3) The final refinement phase uses a nodal index with a program set default e.g. 6 (or a user specified nodal index or minimum number of spots) and carries out a final two cycles of refinement (4 if the polynomial based spatial distortion correction is being used). The parameters refined are as follows: a) Standard or radial scan distortion parameters. Cycle 1: Phis, ctof, x_c, y_c (key plate), or ctof, x_c, y_c, w_c (others) + cell (if required) + distortion parameters Cycle 2: As for cycle 1. b) Polynomial based distortion correction. Cycle 1: Phis, ctof, x_c, y_c (key plate), or ctof, x_c, y_c, w_c (others) + cell (if reqyired) + distortion parameters Cycle 2: Phis (key plate) or w_c (other plates) + cell (if required) + polynomial based spatial distortion parmeters. Cycle 3: As for cycle 1. Cycle 4: As for cycle 2. If a plate has already been refined the final refinement phase will be entered immediately provided that the rms is <= .075 mm. When a pack is being refined, the key plate will be refined first. The user specifies whether or not cell parameters are to be refined (applies to key plate of key pack only); the default is defined by the program e.g. refine cell. The spot positions determination differs in a number of details from that used in the manual refinement modes. The following points may be noted: * In the initial refinement phase, the box size is determined as described in the flowchart illustrating that phase. * In the main and final refinement stages, the box size is calculated from the spot_length, spot_width spot_border and spot_delta parameters. For circular spots (with spot_width = 0) The box size is set to 2*spot_delta - spot_length with a minimum value of spot_length used. For elliptical spots (with spot_width > 0) The box size is set to spot_length + (2.0 + spot_border)/mm_rast_x where mm_rsst_x is the conversion factor from mm to rasters. The radial masking option for spot position determination is used (see also Appendix 14 ) * The background value for each spot individually by taking a box surrounding the spot and averaging the lowest 50% of the pixels. The background box size is taken as three times the spot search box size except in the case of the initial refinement phase where the box size exceeds 1.5 mm; in such as case the background determining box size is also set to 1.5 mm. * An expansion factor of 1.5 is normally used during the spot position determination procedure if the spot box position needs to be adjusted. This is also normally done in the automatic procedure unless the box size has been reset to 1.5 in the initial refinement phase in which case no box expansion will be done. Figure 12.1 Outline of Automatic Refinement Protocol Figure 12.2 Flowchart of Initial Refinement Phase APPENDIX 13: OPENING IMAGE FILES ================================ 13.1 INTRODUCTION When the program requires data to be read from a film or image-plate image file, the following procedure is carried out: A check is made to see whether the flag is set which indicates that the current image file has already been opened; if so, no further action is needed at this stage. If this flag is not set, then a check is made to see if the image file is named 'missing' (case insensitive). If it is, an error flag is set and the program will abandon the current option. Otherwise the program will then attempt to open the file; if this is successful, the 'current film/image-plate open' flag will be set and the program will continue normally. If not, an error message is output indicating that the file cannot be opened (this includes the name of the file that it is trying to open). Unless the program is in its non-interactive mode (in which case it will stop), the following prompt is output: Input a new file name [y]: If the reply is 'yes' then the new file name will be requested and an attempt will be made to open this file; if successful the program will then continue normally; if not, the error message and above prompt will be repeated. Note that when the input of a new file name is requested, the user may reply with an exclamation mark '!' to declare the film/plate missing; in this case an error flag will be returned to the program and the current option will be abandoned. If the reply is 'no' then an error flag will be returned to the program and the current option will be abandoned. APPENDIX 14: RADIAL MASKING OPTION ================================== 14.1 INTRODUCTION The use of variable or constant radial elliptical masks has been developed by T.J. Greenhough and A.K. Shrive for use in their integration program INTLAUE. The masking may also be used when spot positions are used for the refinement of the orientation and in predicting which spots are to be regarded as overlapped. The user supplies the full length of the elliptical spot in the radial (major axis) direction in mm. (spot_length). For the Andrews et al (1987) formulation this should be set to the mosaic spread times the crystal to film distance with the spot factor set to 1.0. The spot factor (spot_factor) is supplied by the user and allows for radial spot lengths varying as a function of radius. The spot length specified is that for the centre of the image. The corrected spot length for any given spot is then given by the expression: length = spot_length*(1.0+spot_factor*radius/c_to_f) where 'radius' is the distance of the spot from the film/plate centre and where c_to_f is the crystal to film/plate distance; all lengths in this expression are in mm. If the streak factor is zero, then constant streak lengths are used. A positive value gives increasing lengths as a function of radius with, in particular, a value of 1.0 for the Andrews formulation. A negative value would give streak lengths decreasing as a function of radius. The user also supplies the spot width (spot_width) in mm; this is kept constant throughout the image. The pixels in a border 1 pixel wide round the ellipse are not used but a further border whose width in pixels is specified (spot_border) is for use in the background determination. Note that the formulations are only appropriate for a flat plate detector normal to the beam; it is probably best to trea the spots as round when using a cylindrical camera or a tilted detector. APPENDIX 15: INTEGRATION STATUS WARNINGS ======================================== 15.1 INTRODUCTION When integration is carried out, the integrated intensities are stored internally in a Laue Integrated Reflections List (LIRL). When such a list is present, the program may output integration status warnings at certain stages to ensure that the user is aware of the implications of what is being done, for example attempting to exit the process mode or the program with intensities which have been integrated but not written to an output file. If no intensities have been integrated or all integrated intensities have been cleared, no integration status warnings are output. If the program is in batch mode, then it will continue with the request but an appropriate message will be written to the log file (if present). List of sections: Integration Status Check Points Exit From Processing Mode Quit The Program Reset the Program Defaults Read a New Parameters File Enter the Processing Mode 15.2 INTEGRATION STATUS CHECK POINTS The integration status is checked at the following points in the program: 1) Exit from processing mode. 2) Quit the program. 3) Reset the program defaults. 4) Read a new parameters file. 5) Enter the processing mode. The treatments at the five stages are described in the sections below. 15.3 EXIT FROM PROCESSING MODE If intensities have been integrated but not all written to an output file, then, in interactive mode, a warning notice is output with the messages: *Not all integrated intensities written to file* Exit from process mode anyway? or in terminal mode, a warning message and prompt are output as follows: *Warning* Not all intensities written to file* Exit from process mode anyway (y/n) [n]: The user may choose to abandon the current request or continue in spite of the warning. In this case it is just a warning as following the normal processing procedure, all integrated intensities should be written to file before exiting the process mode. However, in some cases, the user might wish to access some function or change some parameter not available or allowed in process mode followed by a subsequent re-entry to the process mode. If the user chooses to continue with the request or the program is in batch mode, the following message will be written to the log file: *Warning* Exiting process mode with unwritten intensities 15.4 QUIT THE PROGRAM If intensities have been integrated but not all written to an output file, then, in interactive mode, a warning notice is output with the messages: *Not all integrated intensities written to file* Quit program anyway? or in terminal mode, a warning message and prompt are output as follows: *Warning* Not all intensities written to file* Quit program anyway (y/n) [n]: The user may choose to abandon the current request or continue in spite of the warning. If the user chooses to continue with the request or the program is in batch mode, the following message will be written to the log file: *Warning* Quitting program with unwritten intensities and the un-written intensities will be lost. 15.5 RESET THE PROGRAM DEFAULTS If intensities have been integrated but not all written to an output file, then, in interactive mode, a warning notice is output with the messages: *Not all integrated intensities written to file* Reset program defaults anyway? or in terminal mode, a warning message and prompt are output as follows: *Warning* Not all intensities written to file* Reset program defaults anyway (y/n) [n]: The user may choose to abandon the current request or continue in spite of the warning. If the user decides to continue with the request, then in interactive a second warning notice is output: **All current intensities will be cleared** Continue with request? or, in terminal mode, a second warning message and prompt are output: **All current intensities will be cleared** Continue with request (y/n) [n]: If the user still chooses to continue with the request or the program is in batch mode, any un-written intensities will be lostand the following messages will be written to the log file, the first only if there are any unwritten intensities present: *Warning* Unwritten intensities deleted *Warning* Current intensities cleared 15.6 READ A NEW PARAMETERS FILE If intensities have been integrated but not all written to an output file, then, in interactive mode, a warning notice is output with the messages: *Not all integrated intensities written to file* Read new parameters file anyway? or in terminal mode, a warning message and prompt are output as follows: *Warning* Not all intensities written to file* Read new parameters file anyway (y/n) [n]: The user may choose to abandon the current request or continue in spite of the warning. If the user decides to continue with the request, then in interactive a second warning notice is output: **All current intensities will be cleared** Continue with request? or, in terminal mode, a second warning message and prompt are output: **All current intensities will be cleared** Continue with request (y/n) [n]: If the user still chooses to continue with the request or the program is in batch mode, any un-written intensities will be lostand the following messages will be written to the log file, the first only if there are any unwritten intensities present: *Warning* Unwritten intensities deleted *Warning* Current intensities cleared 15.7 ENTER THE PROCESSING MODE If any intensities are present then in interactive mode, a warning notice is output with the messages: *Intensities present* Keep intensities?? or in terminal mode, a warning message and prompt are output as follows: *Intensities present* Keep intensities (y/n) [y]: The user may choose to keep or delete the current intensities. If the user chooses to delete the current intensities, then any un-written intensities will be lostand the following message will be written to the log file (if present): *Warning* Current intensities cleared The program will then enter the process mode as requested. In batch mode, the current intensities will be kept and the program will enter the process mode without any warning. DEMONSTRATION 1: DEMONSTRATION FOR FIRST TIME USERS =================================================== 1.1 INTRODUCTION This demonstration is designed to show the first time user how the LAUEGEN program operates. It is divided into five sections which follow the logical order of the functions available in the program. Details of how to manipulate the X-windows based XDL_VIEW objects are given the first time any particular object is described. The sections can be carried out independently of each other so that the complete demonstration need not be carried out in one session. They should, in the first instance, be carried out in the order they are given as knowledge acquired in an earlier section may be assumed in the description of a later section. It would be wise to read Chapter 1 of the documentation before carrying out the demonstration. Each section of the demonstration contains a set of specific actions to be carried out followed some suggestions of further things you may wish to try out. List of sections: Preparation Section 1: Setting Up (/Saving) Parameters Section 2: Laue Simulations Section 3: Displaying/Measuring an Image Section 4: Find the Crystal Orientation (Auto-indexing) Section 5: Refining the Crystal Orientation Other Program Options 1.2 PREPARATION The demonstration makes use of some standard test data files distributed with the Daresbury Laboratory Laue Software Suite. Assuming that the program has been set up as part of that suite the following files should be copied to the directory from which you are running the demonstration using the 'lget' command set up when the suite was installed. lget lys_lg.ldm lys_lg.spots lys_lg_auto.ldm(Unix) lget lys_lg_vax.ldm lys_lg.spots lys_lg_auto_vax.ldm (VMS) On a Unix system you should also make 'soft links' to the test image files using the command: linkimages The program is then run by typing the following command: laue lauegen The basic layout of the screen is described in section 1.3 of the documentation. Note that the 'active' strips indicate that the program is able to receive input from four of the XDL_VIEW objects; these are the Menu Area, Parameter table 1, Parameter table 2 and the command window. 1.3 SECTION 1: SETTING UP (/SAVING) PARAMETERS 1.3.1 Introduction Entryconditions: either: Program startup or: Basically anywhere when the main menu is displayed. List of subsections in this section: Changing Values in Parameter Table 1 Reading in a Parameters File Writing a Parameters File Resetting the Defaults Other Suggestions 1.3.2 Changing Values in Parameter Table 1 a) This illustrates how to input a new parameter value. Point to the first item in column 2 of the parameter table, the cell 'a' parameter - the item will be highlighted; Click Button1; type in the new value of the cell parameter e.g. 93.4; Press the 'Return' key to enter the value. The new value will now be displayed. Note:When inputting a new parameter value, the parameter table window must have the keyboard focus. It will automatically gain the keyboard focus when the mouse Button1 is clicked to change a parameter value. If required, the keyboard focus may be restored to the window by pointing to the window and clicking Button1 of the mouse. When the parameter table has the keyboard focus, the message in the active strip is displayed in bold print and, when it has lost the keyboard focus, the message in the active strip is displayed in normal print. b) This illustrates how errors in input values are handled. Point to the first item in column 2 of the parameter table, the cell 'a' parameter - the item will be highlighted; Click button1; type in an invalid value of the cell parameter e.g. -12.0; Press the 'Return' key to enter the value. A pop-up error notice will now be displayed with a message, in this case, informing the user that the value must be greater than zero. When such a pop-up notice is displayed, the user must deal with it as the other windows on the terminal are effectively frozen. Point to the 'Continue' button in the notice and click Button1. As indicated in the pop-up notice, the old value will be replaced. A new corrected value may be input as in the first example. c) Parameter items with drop down menus Some items in the parameter table may have drop down menus associated with them. These have a menu button at the right hand side of the parameter value field. An example of this is the 'system' parameter. An option is selected from the drop down menu in one of two ways as follows: as follows: Either: Point to the menu button; Hold down Button3 of the mouse; Move the pointer to the required option on the menu; Release Button3 of the mouse to select the option. Or: Point to the menu button; Click Button3 of the mouse; Move the pointer to the required option on the menu; Click Button1 or Button3 of the mouse to select the option. If Button1 or Button3 of the mouse is clicked with the pointer off the menu then the option selection will be abandoned and the drop down menu will disappear. Try the first of these methods to set the crystal system to monoclinic (item 'Mon.' in the menu). Note how the value of the 'beta' parameter is displayed in this case. Try the second method to set the crystal system to cubic (item 'Cub'). Only a single cell parameter is now displayed. Items with drop down menus may also be changed as normal values as already described. Use this method to set the crystal system back to orthorhombic by typing in a value of Ort. 1.3.3 Reading in a Parameters File This, followed by the modification of some individual values, is the most common way of setting up the parameters. Read in the parameters for the Lysozyme image-plate standard test data set as follows: Select the option from the 'Main Menu'. A prompt will now be displayed in the main text input/output window as follows (note the change in status of the 'active strip' and its 'Input Reply' message): File name (default ext=.ldm): Type in the name of the file i.e. lys_lg(or lys_lg_vax for a VMS system) and press the 'Return' key. (the delete key may be used if incorrect characters are typed). Similar comments to those made in the section above apply to the question of keyboard focus. 1.3.4 Writing a Parameters File To write the current values of the parameters to a file, select the option from the 'Main Menu'. Enter a file name of your choice in response to the prompt: File name (default ext=.ldm): You may examine this file at a later stage. 1.3.5 Resetting the Defaults Provided that the main menu is displayed and the command window at the bottom of the LAUEGEN screen is active, the program default flags and parameter values may be reset by typing in the command defaultsand pressing the 'Return' key. Similar comments to those made previously apply to the question of keyboard focus. 1.3.6 Other Suggestions Repeat any of the above with any parameters of your choice. You may try reading in the parameters file you have created. Note the various parameters which are set. 1.4 SECTION 2: LAUE SIMULATIONS 1.4.1 Introduction Entry conditions: either: Program startup or: Reset the default parameters by typing in the command defaults when the command window is active and the main menu is displayed (see above for details). List of subsections in this section: Colour Coded Display Interactive Display Other Suggestions 1.4.2 Colour Coded Display To display a colour coded simulation of a Laue pattern based on the default (or current) parameters do the following: Select the option from the 'Main Menu'. Select the option from the 'Simulations Menu'. A Laue simulation view-object will be displayed with a colour coded Laue pattern. Try pointing to a spot and click Button1; Details of the reflection will be listed in the box at the top left hand side of the Laue simulation view-object. The selected spot will be surrounded by a white circle on the plot. Select the option from the 'Simulations Menu'. 1.4.3 Interactive Display To display an 'interactive' simulation of a Laue pattern based on the default (or current) parameters do the following: Select the option from the 'Main Menu'. Select the option from the 'Simulations Menu'. A Laue simulation view-object will be displayed with a Laue pattern in black and white. Try pointing to a spot and click Button1; Details of the reflection will be listed in the box at the top left hand side of the Laue simulation view-object. The selected spot will be surrounded by a red circle on the plot. Try the effect on the Laue pattern of varying the Lambda-min value. This can be done by pointing to the 'grip' box on Lambda-min slider bar in the control area of the view-object; Hold down Button1; move the pointer to the right or left and release it when the grip box is in the required position (the lambda-min value is shown just to the right of the slider bar). Repeat this for several positions of the Lambda-min slider and note the effect on the Laue pattern. Select the option from the 'Simulations Menu'. 1.4.4 Other Suggestions Experiment as much as you wish with both the colour coded and interactive options. Note that you can move from one of the types to the other without returning to the main menu. For the colour coded display, try the various options which may be selected via the drop down menus in the control area. You may also try simulations after setting different values for various parameters in parameter table 1 e.g. change of Missetting angles (phix, phiy, phiz), different cell size etc. Note that it is possible to change such parameters without dismissing the simulation display and returning to the main menu; to do this it is necessary to move the Laue simulation view-object so that the required part of the parameter table can be accessed. For the interactive display you may examine, in particular, the effect of each of the three 'soft limit' sliders. You may try highlighting different classes of spot via the 'Highlight' drop down menu. Such things as getting hard copies or labelling spots may be considered at a later stage and reference needs to be made to the main text of the LAUEGEN documentation for details of these. 1.5 SECTION 3: DISPLAYING/MEASURING AN IMAGE 1.5.1 Introduction Entry Conditions: either: Program startup or: Anywhere when main menu is displayed List of subsections in this section: Inputting Parameters and Displaying the Image Manipulating the Image Measuring the Image Showing a Predicted Pattern Other Suggestions 1.5.2 Inputting Parameters and Displaying the Image Before a film/image-plate image can be displayed, it is necessary to set up an appropriate set of parameters. This may be done by reading in the parameters file lys_lg.ldm(or lys_lg_vax.ldmfor a VMS system) via the option of the 'Main Menu' (see above for details) Select the option from the 'Main Menu' At this stage a 'Progress bar' appear on the display as the image file is read. The length of the blue bar indicates how much of the file has currently been read. When the reading is complete, a image view-object will display the image. 1.5.3 Manipulating the Image a) Modify the maximum intensity threshold by pointing to the Maxpanel item (the value will be highlighted), clicking Button1 and entering a value of 1500 (this is similar to modifying an entry in a parameter table). b) See the effect of moving the contrast slider. c) Note how the current pixel position is indicated at the top right hand side of the control panel as the pointer (cursor) is moved over the image display. d) The magnifying window area (top left below the active strip) shows an enlarged section from a small part of the image in the main display area. When the cursor (pointer) is within the main image display area, clicking on the mouse Button2 will alternately freeze and free the magnifying window display. In the 'free' state (the default), the magnifying window will show a magnified image of an area around the current cursor position and the display will change as the cursor is moved. In the 'frozen' state the magnifying window will display a magnified image of the area around the position of the cursor when Button2 was clicked to freeze the magnifying window. A light blue square on the main image display shows the position and approximate size of the frozen area displayed in the magnifying window. In the 'free' state, the display in the magnifying window merely enlarges the image in the main display with each pixel being reproduced a number of times depending on the magnification. In many cases the displayed image will have been compressed from the original image with loss of detail; for this reason, when an area is frozen, the magnified will display increased detail. When the cursor is on the magnifying window, clicking Button2 will alternately cause the magnifying window to be doubled and halved in size; try this. 1.5.4 Measuring the Image Now select the option from the 'Display/Measure Menu'. At this stage you may take note of the options in the 'Measure Image Menu' and then try inputting a few spot positions as follows: Select the option from the 'Measure Image Menu'. By default the option is already selected; Note how the active strip indicates that the program is ready to receive input spot positions. Point to a spot and click Button1; the selected spot should then be marked by a red cross. Repeat this for two or three other spots. Try deleting a spot by selecting the option from the 'Input Spots' menu, pointing to the red cross indicating an already selected spot and clicking Button1. The symbol should disappear and the spot will be removed from the current spots list. Select if you wish to input one or two more spots and then select the option. Note that you may freeze an area of the image in the magnifying window and measure the spot position from within that window. This enables gives easier and more accurate control over the cursor positioning; try this. Now select the option from the 'Measure Image Menu' 1.5.5 Showing a Predicted Pattern Select the option from the 'Display/Measure Menu'. The predicted and observed patterns will not match well at this stage as the crystal orientation has not yet been determined. Select the option from the 'Prediction Menu' and then the option from the 'Display/Measure Menu'. 1.5.6 Other Suggestions Try the other options available on the image display e.g. colour menu, background included/excluded/only menu, magnification menu. Show a pixel intensity by pointing to a spot and holding down Button3; the intensity will be listed at the top right hand side of the control panel and will remain displayed until Button3 is released or until the cursor is moved. Show the predicted pattern and try out the Overlay on/off/offset menu. Also, in this option, you can try displaying selected nodals only. In the Measure Image mode, you can try a centre determination. 1.6 SECTION 4: FIND THE CRYSTAL ORIENTATION (AUTO-INDEXING) 1.6.1 Introduction Entry Conditions: either: Program startup or: Anywhere when main menu is displayed or: Continue from previous section of the demonstration List of subsections in this section: Preparation The Auto-indexing Other Suggestions 1.6.2 Preparation If you are not continuing directly from the previous section of the demonstration, read in the parameters file lys_lg.ldm(or lys_lg_vax.ldmon a VMS system). 1.6.3 The Auto-indexing Select the option from the 'Main Menu' Note that the spots file lys_lg.spotscould be read in now via the option of the 'Autoindexing Spots Menu' but, for the purpose of this demonstration, we will proceed through the option which should now be selected. Normally at this stage nodal spot positions would be selected by the user via the option after determining a centre position if necessary (see Demonstration 1 section 5.4 for details of how to input spot positions); however in this case you should select the option from the 'Measure Image Menu'. The name of the input spots file is lys_lg.spots. Note that if spots have already been measured for the current film/plate (as may well be the case if you have continued the demonstration from the previous section) additional prompts to that requesting the file name will be output; you should reply 'no' to the prompt 'Add to existing spots list (y/n) [n]:' and 'yes' to the prompt 'Overwrite existing spots (y/n) [n]:'. The spot positions read in will now be marked by red crosses on the image display; the situation is now the same as if such spots had been selected by the user. Select the option from the 'Measure Image Menu' in case the centre position was changed in the previous section of the demonstration; the situation is now the same as if such spots had been selected by the user. Now select the option. The following prompt/reply sequence is entered: Limit of h**2+k**2+l**2 (max=100) [10]: Reply with the value 15 Error in spot positions (mm) [0.50]: Reply with the value 0.75 The auto-indexing frame should now be displayed. The 'Autoindexing Results' area should show two (related) solutions. All solutions are given some preliminary refinement and the the best are displayed in increasing order of rms deviation. To show a prediction based on the first solution carry out the following: Select the option from the 'Autoindexing Solutions' menu. Select the option from the 'Solution Number Menu'. The image is now displayed with the predicted pattern superimposed on it. After examining it, select the option from the 'Prediction Menu'. You may examine the second solution in a similar manner if you wish. Now accept the first solution as follows: Select the and then the options from the 'Integration Options' menu in order to integrate the second plate in the pack. Set an appropriate integrated intensities file names template via parameter table 3 and then select the option. 2.4 LYSOZYME TEST 2.4.1 Introduction The protein Hen Egg White Lysozyme crystallizes in the tetragonal space group P43212. A single diffraction image was recorded by Dr S. McSweeney using the MAR image plate system on the SRS station 9.5 at the Daresbury Laboratory. List of subsections in this section: Setting/Saving the Parameters Laue Simulations Display/Measure Image Find the Crystal Orientation Refine the Crystal Orientation Writing the '.ge' Files Improving the Soft Limits Integrate Spots 2.4.2 Setting/Saving the Parameters First reset the program defaults (type defaultsin the command window) and then set the following parameters manually: Set up the appropriate parameters in parameter table one using the following crystal data: system Tetragonallattice primitive rotation axis +a*and beam axis +b* Cell a = 79.19c = 38.02 soft limits: lmin = 0.4lmax = 2.2dmin = 2.4 Now set up other non-default parameters as follows: numpack 1 spot thresh 200.0 distortion type r/toff raster 150.0 rmax 90.0 Set up further parameters in parameter table 2 as follows: filename ./lys.i2(Unix) lfilm:lys.i2(VMS) crystal to film distance 199.6mm x_cen_f, y_cen_f to 585.0and 588.0 spot length 0.75spot delta 0.75 Write parameters file to a file name of your choice (the contents of this file should be similar to those of the standard test data file lys_lg.ldm). If you need to restart the test, then you may use the option from the 'Main Menu' to read in the parameters from your saved file or from this supplied file. 2.4.3 Laue Simulations Try the Laue simulations at this stage. Both colour and interactive simulations may be tried. See the effect of changing the setting parameters (phix, phiy, phiz and spindle). Examine the indices of some of the reflections. In the 'Interactive Display' mode, use the soft limits sliders to examine the effects of changing these limits. 2.4.4 Display/Measure Image Try the Display/Measure image option; change some of the options available via the film image view-object control panel. Show a predicted pattern; it will not at this stage fit the observed pattern as the orientation of the crystal has not yet been determined. 2.4.5 Find the Crystal Orientation The crystal orientation is determined using the option from the 'Main Menu'. You should attempt to find the orientation using the option from the 'Autoindexing Spots Menu'. Measure the positions of 5 to 8 nodal reflections; you may save the positions of these spots to a file of your choice. Initially try the index limit (h**2+k**2+l**2) of 15and the spot positions error of .75mm. This may well give the required solution. Examine ('Show') the best solution(s) and 'Select' the best solution if it looks correct. If you do not get any solution, try increasing either or both of these limits. If you have problems with the auto-indexing and the selection of suitable spots, you may read in a set of spots from the file lys_lg.spotsinstead of using your own measured spot positions. When the auto-indexing procedure has been satisfactorily completed you may wish to write a parameters file containing the determined missetting angles to a file of your choice. 2.4.6 Refine the Crystal Orientation Having determined an approximate orientation of the crystal using the auto-indexing procedure, this orientation needs to be refined. To do this select the option from the 'Main Menu' and then the option from the 'Processing Menu'. In the case of the Lysozyme example, the solution obtained from auto-indexing should be sufficiently accurate to enable the option to be used without requiring any manual matching of predicted and observed spot positions. Use the default nodal index and the default box size. Refine the six parameters phix, phix, phix, c_to_f, x_c and y_c with the all the spots found from the nodal spots search. Repeat the nodals search and refine step, this time including the cell parameters in the refinement (note one cell parameter must remain fixed); repeat again and include the distortion parameters in the refinement; refine all parameters once more. The rms deviation should now be down to somewhere as low as 0.025 mm and certainly no greater than 0.04 mm. If you cannot get this low, check that you are refining the correct distortion parameters; if you do not refine 'roff' and 'toff' your rms deviation will not get much below 0.12 mm 2.4.7 Writing the '.ge' Files Now that the refinement has been completed, use the option from the 'Refinement Options Menu' to write out a set of .gen/.ge1/.ge2 files for the integration program. Select a name of your own choice. Use default replies to the remaining prompts. 2.4.8 Improving the Soft Limits After the refinement has been completed, return to the previous menu and select the option. Then from the 'Soft Limits Options Menu' select the option. When the new soft limit has been determined, look at the normalised histogram ( option) and accept the new soft limit ( option) using the 'Soft Limits Results Menu' and then return to the previous menu . The equivalent procedure may be carried out for lambda-min if desired. When the soft limit determinations have been completed return to the previous ('PROCESSING') menu. 2.4.9 Integrate Spots After the refinement has been completed (and any soft limits re-determined if desired) select the option from the 'PROCESSING MENU'. Then select the option from the 'Integration Options' Menu. When the integration has been completed, select the option. From the 'Integration Results Menu' select the <Examine Profiles&g;t; option, examine the spot profiles using the 'Show Profiles Menu' options and then return to the 'Integration Results Menu'. Select the option to display a summary of the integration results and return to the 'Integration Results Menu' and then to the Previous menu. Set an appropriate integrated intensities file names template via parameter table 3 and then select the option. Figure 2.1 Plot of the Proflavin film image Figure 2.2 Plot of the Lysozyme image-plate image