EXCHGE - EXCHANGE .GE1/.GE2 FILES ================================= INTRODUCTION The program EXCHGE is used to enable the transfer of Laue .ge1/.ge2 files data between their binary form (as used by the Laue programs) and an ascii text format. The ascii format file may be transferred between machines of different types. The program may also be used to produce a listing of the contents of a binary .ge1 file header. The program was written by J.W. Campbell, Daresbury Laboratory. List of sections: Data Control Cards Input and Output Files Running the Program Notes Printer Output Error Messages Program Function References Examples DATA CONTROL CARDS The program is run in an interactive manner. The first question is as follows and its reply determines the basic option to be used: Translate to ascii (t), from ascii (f) or print header (p) [t]: If a reply of 't' is given then a .ge1 and a .ge2 pair of binary files will be translated to a single ascii exchange format file. If a reply of 'f' is given then an ascii exchange format .ge1/.ge2 file will be converted to a pair of binary .ge1 and .ge2 files. If a reply of 'p' is given then the header of a binary .ge1 file will be read and output in readable ascii form to a listing file. The sequence of questions continues as follows for the option selected: Translate to ascii (t) Use compact form of output (y/n) [y]: If a reply of 'y' is made then the reflection data will be output in a compact form with the minimum of spaces between items. This will normally be used if the file is to be used purely for transfer (or editing header data) and re-translating. If a reply of 'n' is given then the reflection data will be output with the reflection data in columns (with four lines per reflection). This is more useful if the reflection data are to be inspected. Root name for input .ge1/.ge2 files: This is the name without extension of the .ge1 and .ge2 binary files to be translated. This means that they must both have the same root name and have file extensions of .ge1 and .ge2. Name of output ascii file (default ext=.geasc): The reply is the name of the output ascii exchange format .ge1/.ge2 file. If the file name contains an extension then this will override the default. Translate from ascii (f) Name of input ascii file (default ext=.geasc): The reply is the name of the input ascii exchange format .ge1/.ge2 file. If the file name contains an extension then this will override the default. Root name for output .ge1/.ge2 files: This is the name without extension of the .ge1 and .ge2 output binary files. The extensions .ge1 and .ge2 will be added to the respective file names. Print header (p) Root name for input .ge1/.ge2 files: This is the name without extension of the .ge1 binary file whose header is to be translated. The .ge2 file will not be accessed. Name of output listing file (default ext=.lis): The reply is the name of the output listing file. If the file name contains an extension then this will override the default. INPUT AND OUTPUT FILES Translate to ascii The input files are: a) A pair of binary Laue .ge1/.ge2 files The output file is: a) An ascii format Laue exchange .ge1/ge2 format file. The format is described later in the documentation. Translate from ascii The input file is: a) An ascii format Laue exchange .ge1/ge2 format file. The format is described later in the documentation. The output files are: a) Pair of binary Laue .ge1/.ge2 files Print header The input file is: a) A binary Laue .ge1 file. The output file is: a) An ascii format listing file. The header data has the same format as that in the Laue .ge1/ge2 ascii exchange format file. The format is described later in the documentation. RUNNING THE PROGRAM Use the command 'laue exchge' NOTES None. PRINTER OUTPUT None. ERROR MESSAGES a) Invalid replies to questions and file opening errors **Error** Invalid option **Error** .ge1 file does not exist **Error** .ge2 file does not exist **Error** Unable to open output file **Error** File does not exist **Error** Unable to open input file **Error** Unable to open output .ge1 file **Error** Unable to open output .ge2 file b) Errors in format of ascii exchange .ge1/.ge2 file **Error** 6 values expected after FIDX keyword **Error** 6 values expected after FIDY keyword **Error** 6 values expected after OMEG keyword **Error** 6 values expected after CELL keyword **Error** 4 values expected after SYST keyword **Error** 1 value expected after RAST keyword **Error** 5 values expected after IBOX keyword **Error** 3 values expected after PHIS keyword **Error** 3 values expected after LAMS keyword **Error** 1 value expected after DMIN keyword **Error** 1 value expected after RADI keyword **Error** 1 value expected after SPIN keyword **Error** 6 values expected after XC_S keyword **Error** 6 values expected after YC_S keyword **Error** 6 values expected after WC_S keyword **Error** 1 value expected after DELT keyword **Error** 6 values expected after TWIS keyword **Error** 6 values expected after TILT keyword **Error** 6 values expected after BULG keyword **Error** 1 value expected after CTOF keyword **Error** 6 values expected after YSCA keyword **Error** 6 values expected after CRAT keyword **Error** 1 value expected after MINI keyword **Error** 21 values expected in multiplicity histogram **Error** 16 values expected in wavelength histogram **Error** 1 value expected after VERS keyword **Error** 1 value expected after PACK keyword **Error** 5 values expected after NSPT keyword **Error** 12 values expected in nodals histogram **Error** 1 value expected after INTF keyword **Error** REFLECTION DATA heading expected **Error** Count expected after REFLECTION DATA **Error** Invalid syntax for reflection count **Error** Reflection count inconsistent with NSPT **Error** Reflection separator * expected **Error** END-OF-REFLECTION-DATA marker expected **Error** HARMONICS DATA heading expected **Error** Count expected after HARMONICS DATA **Error** Invalid syntax for harmonics count **Error** Harmonics separator * expected **Error** END-OF-FILE marker expected **Error** Premature end of file reading ascii file **Error** Keyword 'name' expected where 'name' is the name of the keyword expected **Error** Premature end of file reading ascii data **Error** Syntax error in reflection data **Error** Syntax error in harmonics data PROGRAM FUNCTION The program EXCHGE is used to convert the binary .ge1/.ge2 files used in the Laue data processing suite to and from an ascii format file which may then, for example be transported from one type of computer to another. It also provides a means for inspecting the data in the file and has an option for listing only the header information from the binary .ge1 file in a readable form. It also provides a mechanism for editing data in a .ge1 file as it can be translated to an ascii file, edited using any text editor, and translated back again. The data are read from the ascii file in free format. The basic format is as follows (an example is given in the next section): (a) Header data These items must all be present in the order shown and with the correct number of data items. Each item is intoduced with a keyword. TITL Title: the title data 'title' follows on the next record. 'title' CRYS Crystal: followed by a 6 character crystal name. CELL Reciprocal cell parameters: followed by 6 values in reciprocal Angstroms and degrees. SYST Crystal system etc: followed by 4 numbers, System (1 to 7), Centering (1 to 7), Axis close to 'x' (-3 to 3), Axis close to 'z' (-3 to 3). RAST Raster size: followed by 1 value, the raster size in mm. IBOX Integration box: followed by 5 values (as used in INTLAUE). PHIS Missetting angles: followed by 3 values, phix, phiy, phiz. LAMS Wavelength: followed by 3 values, standard, mimimum and maximum wavelengths. DMIN Dmin: followed by 1 value, dmin. RADI Film radius: followed by 1 value, film radius in mm. SPIN Spindle setting: followed by 1 value, spindle angle in degrees. XC_S x_c's: followed by 6 values, x_c's for each film. YC_S y_c's: followed by 6 values, y_c's for each film. WC_S z_c's: followed by 6 values, z_c's for each film. DELT Delta: followed by 1 value, delta in mm. TWIS Twists: followed by 6 values, twists for 6 films. TILT Tilts: followed by 6 values, tilts for 6 films. BULG Bulges: followed by 6 values, bulges for 6 films. CTOF Crystal to film distance: followed by 1 value in mm. YSCA yscale's: followed by 6 values, yscales for 6 films. CRAT ctof ratios: followed by 6 values, ratios of crystal to film distances wrt CTOF for 6 films. MINI Minimum I: followed by 1 value, minimum I for integration on next film. MULT Multiplicity histogram: followed by 21 values on subsequent records. mult values LAMH Wavelength histogram: followed by 16 values on subsequent records. lamb hist values VERS File version number: followed by 1 value, the version number. PACK Pack number: followed by 1 number, the pack number. NSPT Numbers of spots etc: followed by 5 numbers, Number of spots Number of multiples Number of spatials Number of overlapped & multiple spots Number of nodal spots NODH Nodal histogram: followed by 12 values on subsequent records. nodal hist values INTF Integration flag: followed by 1 value, flag indicating integrated films. (b) Reflection data This starts with following line showing the number of reflections 'n': REFLECTION DATA n REFLECTIONS and ends with the code: END-OF-REFLECTION-DATA The data for each reflection may be laid out in columns or compressed as desired. Each item must be separated from the previous one by a new line or one or more spaces. The reflection items are: h, k, l The reflection indices xf, yf Spot position on 'film' (mm from centre) lambda Wavelength (Angstroms) mult Multiplicity nodal Nodal flag (1=yes, 0=no) ovlp Overlap flag (1=yes, 0=no) close Close reflection flag (1=yes, 0=no) h2, k2, l2 Nodal indices (for multiple reflection) nidx Nodal spot selection index lambda2 Second lambda for a double (otherwise 0.0) ipoint Pointer to .ge2 file for a multiple (>2) dminth Dmin threshold squared for next harmonic intb(6) Box integrated itensities for 6 films isigb(6) Sigmas for the above intp(6) Profile fitted integrated intensities for 6 films isigp(6) Sigmas for the above * An asterisk indicates the end of the reflection (c) Harmonics data This starts with following line showing the number of harmonics 'n': HARMONICS DATA n REFLECTIONS and ends with the code: END-OF-FILE The data for each harmonic may be laid out in columns or compressed as desired. Each item must be separated from the previous one by a new line or one or more spaces. The harmonic data items are: h, k, l The reflection indices lambda The wavelength * An asterisk indicates the end of the harmonic REFERENCES None. EXAMPLES The following is an example of an ascii exchange format .ge1/.ge2 file with the reflection data in columns: Notes: 1) Some spaces have been removed to reduce the maximum line length to 75 characters for this example; the data are still however valid as they will be read in free format. 2) Only a small portion of the reflection data and harmonics data are shown. TITL proflavin CRYS pf1 CELL 0.0788 0.0502 0.0465 90.0000 87.8160 90.0000 SYST 2 1 2 1 RAST 0.050 IBOX 13 13 5 1 1 PHIS 178.587 0.675 44.947 LAMS 1.000 0.250 2.500 DMIN 1.130 RADI 59.000 SPIN 0.000 XC_S 0.23000 0.23000 0.24000 0.26000 0.26000 0.22000 YC_S 0.09000 0.11000 0.09000 0.11000 0.11000 0.09000 WC_S 3.79368 3.80879 3.78424 3.80775 3.80466 3.82321 DELT 0.4000 TWIS -2.33700 -4.30406 -5.62749 -0.10663 -0.99198 3.61740 TILT -4.79623 0.37310 -3.58647 0.53322 -1.06657 -3.66751 BULG 45.40230 56.51379 34.71940 31.53628 36.29953 42.53154 CTOF 61.067 YSCA 0.99748 0.99738 0.99696 0.99726 0.99758 0.99716 CRAT 0.99494 0.99720 1.00672 1.01395 1.01970 1.02644 MINI 100 MULT 1670 175 40 12 8 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 LAMH 401 383 389 391 282 158 89 53 38 21 19 11 11 6 6 0 VERS 2 PACK 0 NSPT 1910 240 0 0 1605 NODH 6 23 63 124 243 356 571 775 1076 1312 1499 1605 INTF 0 REFLECTION DATA 1910 REFLECTIONS 0 4 -5 8.944 0.2241E-01 0.4731 1 1 0 0 0 0 0 5 0. 0 0.9435E-01 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 9999 9999 9999 9999 9999 9999 -9999 -9999 -9999 -9999 -9999 -9999 * 0 4 -9 48.88 0.3653 1.427 1 1 0 0 0 0 0 9 0. 0 0.2155 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 9999 9999 1289 221 20 -9999 -9999 -9999 25 14 11 -9999 * 0 5 -6 6.433 0.1378E-01 0.2796 1 1 0 0 0 0 0 6 0. 0 0.1408 ....... -5 -4 0 -15.29 46.03 1.490 2 1 0 0 -10 -8 0 5 0.7452 0 0.2954E-01 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 9999 9999 794 104 31 -9999 -9999 -9999 21 13 12 -9999 * END-OF-REFLECTION-DATA HARMONICS DATA 173 REFLECTIONS -6 -6 -6 0.9496 * -9 -9 -9 0.6331 * 6 0 0 0.5374 * 9 0 0 0.3583 * ...... -9 -6 -6 0.7400 * -6 -6 -6 0.5022 * -9 -9 -9 0.3348 * END-OF-FILE Example of part of the reflection data and harmonics data from a compressed form of the ascii file (again reduced to a maximum width of 75 characters for this example): REFLECTION DATA 1910 REFLECTIONS 0 4 -5 8.944 0.2241E-01 0.4731 1 1 0 0 0 0 0 5 0.0000E+00 0 0.9435E-01 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 9999 9999 9999 9999 9999 9999 -9999 -9999 -9999 -9999 -9999 -9999 * 0 4 -9 48.88 0.3653 1.427 1 1 0 0 0 0 0 9 0.0000E+00 0 0.2155 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 9999 9999 1289 221 20 -9999 -9999 -9999 25 14 11 -9999 * 0 5 -6 6.433 0.1378E-01 0.2796 1 1 0 0 0 0 0 6 0.0000E+00 0 0.1408 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 9999 9999 903 1039 965 982 -9999 -9999 22 24 23 23 * 0 5 -8 24.60 0.1148 0.8481 1 1 0 0 0 0 0 8 0.0000E+00 0 0.2014 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 9999 9999 9999 9999 1727 900 -9999 -9999 -9999 -9999 28 22 * 0 ...... 49.23 1.577 2 1 0 0 -10 -6 -2 5 0.7885 0 0.2954E-01 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 9999 9999 1241 518 214 81 -9999 -9999 25 18 14 13 * -5 -4 0 -15.29 46.03 1.490 2 1 0 0 -10 -8 0 5 0.7452 0 0.2954E-01 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 9999 9999 794 104 31 -9999 -9999 -9999 21 13 12 -9999 * END-OF-REFLECTION-DATA HARMONICS DATA 173 REFLECTIONS -6 -6 -6 0.9496 * -9 -9 -9 0.6331 * 6 0 0 0.5374 * 9 0 0 0.3583 * -6 2 2 0.8120 * -9 3 3 0.5413 * -6 2 2 0.4713 * -9 3 3 0.3142 * 6 -2 -2 0.5717 * 9 -3 -3 0.3811 * 6 -2 -2 1.110 * 9 -3 -3 0.7398 * -4 -8 -8 0.5410 * -6 -12 -12 0.3607 * -4 -4 -4 1.084 * -6 -6 -6 0.7230 * -8 -8 -8 0.5422 * 4 4 4 0.4966 * 6 6 6 0.3311 ...... 0 0 0.5950 * -9 0 0 0.3967 * -6 0 0 1.026 * -9 0 0 0.6839 * 6 2 2 0.8092 * 9 3 3 0.5395 * 6 2 2 0.4299 * 9 3 3 0.2866 * -6 -2 -2 0.6452 * -9 -3 -3 0.4301 * -6 -2 -2 1.149 * -9 -3 -3 0.7662 * -6 -4 -4 0.5992 * -9 -6 -6 0.3995 * -6 -4 -4 1.110 * -9 -6 -6 0.7400 * -6 -6 -6 0.5022 * -9 -9 -9 0.3348 * END-OF-FILE