next up previous contents index
Next:   PAGE POSITION Up: The KEYBOARD INTERFACE: Command Previous:   OPEN LOG

Subsections



  OUTPUT DATA

Output data in ROI to named data file in one of a choice of data formats. More output formats will be added as is appropriate. At present the following output formats or commands are available:

3CAM 1-D powder diffraction format for input to CERIUS
4-BYTE INTEGERS Binary integer*4 output of active data region
BINARY (UNFORMATTED) Simple dump of active data region
BSL FORMAT Daresbury SAXS format, based on Hamburg OTOKO format
CBF Prototype output of the proposed IUCr ``Crystallographic Binary File'' Format
CHIPLOT 1-D row or column output for X/Y graph plotting
COMPRESSED DIFFRACTION DATA Compacted diffraction data format
DENZO MAR FORMAT Experimental output format for input to DENZO
DUMP (Same as "BINARY (UNFORMATTED)"; backwards compatibility)
FIT2D STANDARD FORMAT Self describing readable binary
GSAS GSAS powder diffraction format
HEADER FILES ASCII header files are created describing information contained in the BINARY (UNFORMATTED) output files (this is the default behaviour)
MCA FORMAT ASCII 8 columns per line g10.3 data only
NO HEADER FILES Do not create ASCII header files when the BINARY (UNFORMATTED) format is used
SPREAD SHEET ASCII, one line of ROI in one record
TIFF INTEGERS Simple 1 or 2-byte output (no compression)

Each output option is described more fully in the following sub-sections.


 3CAM

This is simple ASCII text format for the output of 1-D data. It is the recommended input format for inputing data into the Cerius$^{TM}$ software suite.

The user is asked for the name of the output file, and whether to output rows, or columns, and which row or column to output. This allows a single line from a 2-D image to be output. e.g.

Enter name of output file
FILE NAME [cerius.3cam]:
OUTPUT ROWS [YES]:
NUMBER OF ROW TO OUTPUT (Range: 1 to 1) [1]:


 BINARY (UNFORMATTED)

This is an unformatted binary ``dump'' of the ROI of the current data. At present only 2-byte per pixel unsigned integers are available. This can be used to output data in a suitable format for input to MOSFLM , DENZO [26], INTLAUE, IDL, or many other programs25. The format can be read into FIT2D using the BINARY (UNFORMATTED) choice from the INPUT DATA command. Whilst flexible this format has the disadvantage that the output file does not contain the information as to the size of the image. To help FIT2D can output a separate ``header information'' file, and the number of pixels in the X and the Y-directions is output to the user.

The data is output in a 2-D raster starting from the bottom left-hand pixel. X (horizontal) is the fastest changing pixel index. Going from left to right. Y (vertical) changes more slowly. After all the pixel on one row have been output, the row number is incremented and pixels on the next row are output. The rows are output from bottom to top. The top right-hand pixel is the last to be output.

By default FIT2D will create a ``header'' with the same base name as the binary output file, but with .info appended to the base name. This file is human ``readable'' and contains various information telling not only the size of the data, but also information on the manner in which the data has been output. If header files are not wanted this facility may be disabled by typing NO HEADER FILES to the FILE FORMAT prompt. It may be re-enabled by typing HEADER FILES to the FILE FORMAT prompt.

The user is prompted with various questions by this option. The explanation of the questions is best demonstrated by an example.

The following text is the program input/output sequence generated by FIT2D when the current active data region contains 20 by 20 pixels.

Main menu: ENTER COMMAND [INPUT DATA]:output
FILE FORMAT [FIT2D STANDARD FORMAT]:binary
BINARY FILE NAME [fit2d.bin]:
INFO: Data region is     20 *     20 pixels
RECORD LENGTH (BYTES) (Range: 1 to 6000) [40]:?
Length of fixed length records in file in bytes
RECORD LENGTH (BYTES) (Range: 1 to 6000) [40]:
FIRST RECORD FOR OUTPUT (Range: 1 to 100000) [1]:?
Number of first record to write data from array
FIRST RECORD FOR OUTPUT (Range: 1 to 100000) [1]:
BIG ENDIAN FORMAT INTEGERS [NO]:?
YES for big endian integer (Sun/HP/SG), NO for little endian (VAX, PC, MAR)
BIG ENDIAN FORMAT INTEGERS [NO]:yes
INFO: Data minimum value =    16.43577
INFO: Data maximum value =    991.7908
LOWER LIMIT OF RANGE (Range: -1.700E+38 to 991.791) [0.0]:?
Enter lowest value to be scaled to output range
LOWER LIMIT OF RANGE (Range: -1.700E+38 to 991.791) [0.0]:
UPPER LIMIT OF RANGE (Range: 0.0 to 1.700E+38) [65535.0]:?
Enter Highest value to be scaled to output range
UPPER LIMIT OF RANGE (Range: 0.0 to 1.700E+38) [65535.0]:

Note: The entry ? has been used to show on-line prompt information.

The Main menu: ENTER COMMAND [INPUT DATA]:output selects the OUTPUT DATA command.
FILE FORMAT [FIT2D STANDARD FORMAT]:binary selects the BINARY (UNFORMATTED) format for file output. BINARY FILE NAME [fit2d.bin]: will create an output file called fit2d.bin, as the default is accepted.

INFO: Data region is 20 * 20 pixels is information showing how many pixels are output in each direction in the data file. This information will be useful when inputing the data into another program.

RECORD LENGTH (BYTES) (Range: 1 to 6000) [40]: asks the length of (Fortran)
records to be created. Generally the default value is just accepted, however a larger value may be used, and the user is given the choice to pad out records with blanks. This can be useful for creating a pseudo-MarResearch format file .

FIRST RECORD FOR OUTPUT (Range: 1 to 100000) [1]: allows blank records to be created at the beginning of the file. Again, generally this can be ignored (default is no blank records), but for pseudo-Mar-Research output this may be used.

BIG ENDIAN FORMAT INTEGERS [NO]:yes determines the byte order which is used to output the integer pixel values. Different computers write out several byte integers numbers (2-byte, 4-byte integers) in one of two different orders. ``Big endian'' means that the first byte of the integer number is the most significant byte, whereas ``little endian'' means that the first byte is the least significant and the most significant is the last byte26. DEC-Vax's, IBM-PC's and compatibles use little endian format integers, whereas Hewlett Packard 700 series, Sun-4, and Silicon Graphics use big endian integers. (FIT2D converts integers into the required byte ordering prior to output so can create data suitable for either format regardless of the type of computer which is being used.)

INFO: Data minimum value =    16.43577
INFO: Data maximum value =    991.7908
LOWER LIMIT OF RANGE (Range: -1.700E+38 to 991.791) [0.0]:
UPPER LIMIT OF RANGE (Range: 0.0 to 1.700E+38) [65535.0]:

This final section shows the range of data values present in the ROI, and allows the user to set the range of data values which will be scaled to the 2-byte unsigned integer output range (0: 65535). The reason for this complication is simple: within FIT2D the data values may range from approximately $-1.7^{38}$ to $+1.7^{38}$, and values may be as small as $1.0^{-38}$. Such a large range cannot be scaled into 65536 intensity levels without enormous discretisation. Since, in general not all the range is used, the problem is usually not too severe. By asking for the LOWER LIMIT OF RANGE and the UPPER LIMIT OF RANGE FIT2D allows the user to control any truncation of the data range, and the level of discretisation of the range.

If the data range falls within 0.0 to 65535.0, these values will be offered as the default values. If this is the case data values will be rounded to their nearest integer value prior to being output (any fractional intensity information is lost in the output file). Apart from this rounding, values in the output file will have the same intensity as within FIT2D.

If there are values above 65535.0, then the maximum value will be offered as top of the range. If this is accepted, then there will be no thresholding truncation of data values, but all values will be scaled down proportionally to fit into the range 0.0 to 65355.0.

Values of LOWER LIMIT OF RANGE apart from 0.0 should be considered very carefully. If this is not zero then the output data has this value as an off-set and is no longer linear, unless this off-set is re-applied.

Here is an example of a ``header'' file which was created from an ROI from (120, 130) to (400, 350). From this information it is possible to know the ROI which was used to produce the data. This is not possible from the binary data file alone. Pixel sizes and the byte order in which the integers are output are recorded.

Name of binary file containing image data = fit2d.bin
Number of pixels (horizontal/vertical) =        281       221
Integer data: Number of bytes per pixel =  2 (signed)
The data has been written in "little endian" format. (Normal for VAX/PCs)
Nominal horizontal pixel size =      100.000 (microns)
Nominal vertical pixel size   =      100.000 (microns)
Pixel number of first output pixel (pixel offsets) =        120       130
Title = fit2d.bin
X-axis label = Columns
Y-axis label = Rows
Z-axis label = Intensity
Input data value scaled to lowest file value  =   .0000000E+00
Input data value scaled to highest file value =  6.5535000E+04
Record length =      562 (bytes); First output record =        1

 BSL FORMAT

The BSL format is essentially the same as the OTOKO format developed at Hamburg. It consists of an ASCII header file and a number of binary image data files. The images are stored in floating point reals. (This may cause problems when files are moved between non-IEEE and IEEE float point reals systems.)

This may also cause problems between little-endian and big-endian systems since the endianess of the stored data is not recorded.

FIT2D outputs one image in the file.

 CBF

``CBF'' is the ``Crystallographic Binary File'' which is analogous to the ``Crystallographic Information File'' (CIF). CIF is the standard for transporting and archiving ASCII data within the international crystallographic community. ``CBF'' is a related format which is as close to CIF as possible, whilst allowing large dat-sets to be stored in efficient binary forms.

This option is presently only for development and testing purposes since the data names are not completely fixed, and may change.

 CHIPLOT

Single rows or columns of the data may be output as 1-D series of X/Y coordinates for plotting with CHIPLOT. The values are output in a simple ASCII format together with title and axis label information.

As well as the name of the output file, the user is prompted for output of rows of data, or columns of data, and which row or column to output e.g.

Main menu: ENTER COMMAND [GAUSSIAN]:output
FILE FORMAT [FIT2D STANDARD FORMAT]:chiplot
Enter name of output file
FILE NAME [chiplot.dat]:
OUTPUT ROWS [YES]:
NUMBER OF ROW TO OUTPUT (Range: 1 to 20) [1]:10

The first line of the file contains the title of the data, the second line the X-axis label, and the third line the Z-axis (intensity) label. The fourth line indicates the number of following data points, and whether or not error values are given.

e.g. Here is the start of such a data file:

Simulated Data
Columns
Intensity
         20
 5.0000000E-01   .0000000E+00
 1.5000000E+00  1.0000000E+00
 2.5000000E+00  6.5600000E+00

   ...


 COMPRESSED DIFFRACTION DATA

This format allows typical diffraction data to be stored in an efficient 2-byte integer format.


 DENZO MAR FORMAT

This is a temporary manner in which to output data corrected for detector distortions in a format suitable for processing with DENZO and certain other programs. The format is very similar to the BINARY (UNFORMATTED) output (see Section 15.64.2, Page [*]), but the data is transposed prior to output, and an extra blank record is output before the start of the image data.

This is not a true Mar format file, as the header record is left blank, but at present this appears to be good enough for inputting data to DENZO.

 DUMP

This is exactly the same as BINARY (UNFORMATTED) format (see Section 15.64.2, Page [*]). (The option was previously called DUMP but BINARY (UNFORMATTED) is preferable as this is the option for input of the same data type. The DUMP option is conserved for backwards compatibility.)

 FIT2D STANDARD FORMAT

This flexible format saves the ROI of the current data together with any variances, axis data, and text labels. Data may be saved and input into FIT2D using the INPUT DATA command with no loss of information (within the ROI).

You are recommended NOT to use this format for taking data away from the ESRF, unless you have FIT2D or equivalent input routines.

 GSAS

This format is for input to the GSAS (General Structural Analysis System) program [15] of 1-D 2-$\theta$ scans such as are created by integrating 2-D powder rings to 1-D scans.

 MCA FORMAT

An ASCII dump of data values in 8 columns per line Fortran g10.3 format.

 SPREAD SHEET

This is an ASCII format, where each line of the ROI is output as one line of the file. Each value is output in an adaptable format (Fortran 1pe12.5 format27) separated by a space. A header line is output first which contains the size of the data (number of X-axis elements and number of Y-axis elements) followed by the starting pixel of the output region.

If the ROI is small enough this may be convenient for outputting values to examine of the the terminal. e.g. Here a 5 by 8 region has been output which contains a diffraction spot.

       5       8 Start pixel = (     530     708)
8.10267E+02  7.32946E+02  7.37758E+02  7.88272E+02  7.65070E+02
8.83738E+02  8.23922E+02  8.39668E+02  8.63968E+02  8.12600E+02
9.62089E+02  1.31421E+03  1.51055E+03  1.18729E+03  8.35718E+02
2.01099E+03  1.08955E+04  2.80248E+04  4.63233E+03  1.03409E+03
2.80316E+03  1.52684E+04  2.86683E+04  4.57030E+03  1.19153E+03
1.12099E+03  1.75127E+03  2.34980E+03  1.70756E+03  1.04862E+03
8.16105E+02  8.79685E+02  9.20219E+02  9.37691E+02  8.76449E+02
7.77960E+02  8.14157E+02  8.16885E+02  8.20791E+02  7.79102E+02

 TIFF INTEGERS

This allows the current ROI to be stored in a TIFF file, in either 1 or 2-bytes per pixel format. The user is prompted for the name of the output file, and whether 1 or 2-byte per pixel output is required. The minimum and maximum values encountered within the ROI are output and the user is asked for the minimum and maximum data values to be scaled to the (limited dynamic range) output values. With 1-byte output only 256 output levels are available, and with 2-byte output 65536 levels are available. For more details on this scaling see the BINARY (UNFORMATED) documentation, Section 15.64.2, Page [*].

This is an example of the program output:

FILE FORMAT [FIT2D STANDARD FORMAT]:tiff
NAME OF TIFF OUTPUT FILE [fit2d.tif]:
DATA TYPE FOR PIXEL VALUES [1 BYTE UNSIGNED INTEGERS]:
INFO: Data minimum value =    .0000000E+00
INFO: Data maximum value =    999.7000
LOWER LIMIT OF RANGE (Range: -1.700E+38 to 999.700) [0.0]:
UPPER LIMIT OF RANGE (Range: 0.0 to 1.700E+38) [999.700]:

Note: For input into xv only 1-byte per pixel files should be created. 2-byte per pixel files will cause xv to crash. (This is a limitation of xv). Many other image treatment programs do not deal properly with 2-byte per pixel TIFF files.


next up previous contents index
Next:   PAGE POSITION Up: The KEYBOARD INTERFACE: Command Previous:   OPEN LOG
Andrew Hammersley
2004-01-09