Datasqueeze Help Topics

General Information


Welcome to Datasqueeze, a graphical interface for analyzing data from 2D x-ray detectors. Version 3.0.4, released February 2015, is designed for analysis of data collected by several different types of detector. It implements facilities for changing the color scale of a false color image, drawing constant-intensity contours, recentering the image, correcting for a tilt of the detector with respect to the beam normal, changing the q-scale of the entire image, producing x-y plots versus q, 2-theta, qx, qy, or chi, saving the image in multiple graphics formats, saving the x-y data as an ascii file, and adding or subtracting multiple data files. The data extracted for the x-y plot can be least-squares fit to a variety of commonly used functions. A graphical indexing tool assists in the determination of the lattice parameters of a powder diffraction pattern. A summary page can be printed containing most useful information about the dataset including the false color image and a line plot. The recentering and rescaling can be done using a point-and-click graphical interface, by putting in previously calculated numbers, via least-squares fit to a Bragg ring of known d-spacing, or by using a Bruker calibration file (*.std). The program normally operates using a graphical user interface (GUI), but can also be operated in a "batch" mode for automated processing of multiple files.

This program may not be copied or redistributed in any form without the express permission of Datasqueeze Software.

Getting Started


The program is started in slightly different ways depending on the platform you are running. On Macintosh or Windows, double-click on the "datasqueeze" icon (two hands squeezing an orange) if it is visible on your desktop. If the icon is not visible, you should be able to find it in the Start/Programs menu (Windows) or the Applications folder (Macintosh). On Linux, type datasqueeze at a shell prompt.
If you have not previously run the program, you will see a window that requests an access key. If you do not have a valid key, click on "Choose Trial Mode " to run the Trial version. You will then be asked to agree to various legal statements, the most important of which is that you will not redistribute the program without permission. You will then be asked a variety of questions about your system: your preferred number format, the typical configuration of your instrument, the wavelength expected for your incident beam, the detector pixel size in microns, the detector width or diagonal span centimeters, and the sample-detector distance. If you don't know some of these parameters do not worry; except for the wavelength they are not necessary for the calibration.
You should now see an abstract spiral image on the left side of the screen, a window with some buttons and slide bars on the right side of the screen, and a white panel with some writing at the bottom. The red-yellow spiral is where the false color image will appear. The button window is a tabbed panel that allows you to manipulate the data and make plots. The white panel at the bottom is where x-y plots will appear.
Note that many program components have an individual help message associated with them. If you don't know what a component does, right click on the component (control-click on Macintosh). In many cases, selecting the box with the word Info will bring up more information on that component.
Before doing anything else, you have to read in data. The program deals with multiple file formats, and more will be added in the future. You read in a file or multiple files using the File panel as described in more detail below.

Features

  • Command Log

    Immediately above the tabs labeled Image, Plot, etc., there is a small window which often reports the current status of the program, such as the name of the last data file opened. Look here for error messages if things seem not to be working as you expect. If the window turns red then there has been some kind of error.
  • Image Window

    This is where the false-color image of the data appears. The color scale ranges from black (least intense) to white (most intense). An X marks the believed position of the center of the image. (In the less-commonly-used Wide Angle Mode this X is replaced by an arrow pointing in the direction of increasing 2theta). Almost all features of the image are actually controlled from other panels, although occasionally circles and drag buttons will appear on the false color image window as described in the other sections. The image created can be saved in a graphics file.
    Note that some commands cause the false color image window to be recalculated and redrawn, and that this can be a fairly time-consuming process on slower machines. The program has to look at between one and seventy megabytes (depending on the file format) of data, do some kind of calculation on each data point, and convert this information to a 512 x 512 array of colors.
    A small window just below the image window tracks the current cursor position in several sets of units: the (x,y) coordinates of the data array, the q-value ((4 pi / lambda) sin theta), 2theta, and chi. Nothing is shown if no data have been read in. The angular and q values are meaningless if the image has not been calibrated. Note also that, depending on the operating system and hardware used, the tip of the cursor may not lie exactly over the pixel reported.
  • File Panel

    This panel allows you to open one or more data files.
    To rapidly open just one file with the default options, use the Open item in the File menu.
    For a quick open using the File Panel, leave the number of files at the default of 1. Click on the Browse button to select the file to be opened. Once the file has been selected, Click the Open Files button to actually open the file. After a pause, a false color image should appear to the left.
    A detailed description of each component of this window follows.
    • Number of Files to Read In: This drop-down menu allows you choose the number of files to be summed, from 1 to 13 (default 1). If the number is changed, the number of enabled "open file" dialog boxes changes. If you want to sum even more than 13 files, use the "Append" box (see below).
    • Calibration Parameter Source: To properly interperet a diffraction image, you need to know the instrument parameters, for example wavelength and sample to detector distance. In some cases these are contained as metadata within the data file, but in most cases they must be determined by the user (using methods in the Calibrate window). The "File" and "User" radio buttons allow you to decide whether you want to use user-determined values (the default) or metadata from the file. The User button will be enabled automatically during the calibration process.
    • Open File Dialog Boxes: There is one of these for each file to be opened. The text box should contain the full path name of the data file to be opened. You can type this in, paste it in, or most commonly use the Browse button to the right. "Add" is the number of counts to be added to each pixel (default zero). Most commonly for background subtraction it is likely to be a small negative integer. "Mult" is the value by which each pixel will be multiplied after being read in. "Mult" can be negative, for example if this is a background file. "Im #" is the index of the image within the file. Some data file formats allow multiple images within one file. If "Im #" = -1 (the default) then all images within the file are summed, and "bad" data points ("zingers") are thrown out. If "Im #" is greater than or equal to zero, then just one image is opened. It is assumed that the numbering of the images always starts with zero, no matter what the convention might be for a particular file format.
      Use the Browse button to select the individual file. In addition to a listing of files in the current folder, you will get a drop-down menu with different detector types. Select the one appropriate for the kind of file you are looking at. If you have no idea what type of detector your data came from, select "Unknown." The program will try each in turn until it finds one that works (this is somewhat slow).
    • Open Files: Click this after all the open file dialog boxes are set correctly. Nothing will be read in until you do this. If everything goes well, you will see a message in the command log, and a new false color image will appear. If there was a problem, the offending dialog box will be highlighted in red and an error message will appear in the command log.
    • Order of Operations: First, the contents of the Add box are added to each pixel in a given file. Then, each pixel is multiplied by the Mult box contents. Finally, the pixels in all the files are added together. Thus, if you had a data file A.raw which was counted for half as long as a background file B.raw, you might set the Add values for both files to be zero, the Mult value for A.raw to be 2, and the Mult value for B.raw to -1.
    • Append Box: Normally, each time new data are read in, the data already in memory are overwritten. Checking this box adds the new data on top of the existing data. This allows, in principle, an arbitrary number of files to be added together. Do not forget to uncheck when you want to start analyzing a completely new data set. In Batch mode see the APPENDTOFILE option.
    • Cancel: If you realize that you made a mistake in selecting files you want to open, cancel the opening process by clicking this button.
    In Batch mode see the READIN option.
  • Image Panel

    This panel is selected by clicking on the Image tab in the left-hand window. It contains sliders, buttons, and windows for changing features of the false-color image. Most of these will only work after a data file has been opened.
    • Color Value and Contrast: "Black" corresponds pixels with a small number of counts and "White" to pixels with a large number of counts, with a range of hues in between. You can change the maximum and minimum values (white and black) in two ways: two ways: by dragging the two sliders to the right or left, or by entering in the desired values in the boxes to the left of the sliders. The boxes are probably preferred to the slider unless you have a very fast computer, since the program recalculates the image every time one of these values changed, and things can be jerky with the slider. You can also change the contrast using the contrast box or slider. In Batch mode see the MINVALUE, MAXVALUE, and CONTRAST options.
    • Buttons just below the slider allows you to change the nature of the color scale. If is set to Linear (default), the color scale is linear with the counts/pixel from the smallest to the largest. If is changed to Logarithmic, the color is proportional to the logarithm of the intensity. In Batch mode see the LINEARSCALE and LOGSCALE options.
    • Color Scheme: The "Color Scheme" drop-down menu allows you to specify the rainbow of colors on going from black to white--more red, more green, etc. Each number corresponds to a different color. The last two options are black-and-white only, which may be useful if the image will ultimately output to a black/white printer. "White/Black" produces an image similar to the previous ones, with whiter pixels corresponding to more intensity. "Black/White" produces an inverted image, with blacker pixels corresponding to more intensity-this one looks very much like old- fashioned photographic film. In Batch mode see the SETCOLOR option.
    • Contour: This is an alternate way of displaying the data, replacing the false color display controlled by the color scale and color scheme. Constant intensity contours are drawn at selected intensity levels. The resulting image can be zoomed or written to a file in the normal way.
      Clicking on the Contour button switches from Linear or Logarithmic mode to contour mode. The default is a set of logarithmically spaced contour lines. The number of contours, intensity value for each contour, and color of each contour line can be altered in a new window that is opened using the Levels button. The contours will be immediately redrawn if you click the Apply button, assuming that you have already clicked the Contour button--otherwise, the changes will take effect the next time you go into contour mode. If you decide to play with the contour levels and/or colors, keep the following in mind:
      • The program assumes that the intensity levels are in increasing order. Arranging them any other way may lead to unpredictable results.
      • The time to draw the image is approximately proportional to the number of contour lines chosen. You will see a real decrease in performance if you select too many contour lines.
      • Too many contour lines can also make an image too busy.
      • Adjacent contour lines should have very different colors, otherwise you will not be able to determine where the changes happen.
      • You cannot change the parameters of a contour line whose index is greater than the maximum number of lines to be drawn.
      • The ultimate information of the data is limited by the pixelation. Things may look a little odd at extreme magnification.
      • Low-statistics data will result in very noisy, fractal-looking contour lines, because the contour lines faithfully follow the contours of the data including statistical fluctuations. If you are looking at broad features (which is typically the case if you are using contours at all) consider using the Condense option to bin together pixels, resulting in better statistics but poorer resolution.
      In Batch mode, see the CONTOURSCALE, NCONTOUR, and SETCONTOUR options.
    • Zoom: Selecting this button brings up a new window that provides further control of the magnification of the image.
      • Image Zoom: This drop-down menu changes the magnification of the false color image, in factors of 2, from 0.5 to 32. If Zoom=1 is set, the entire data set appears in the image; if Zoom=2 then only the center data pixels are shown, etc. If Zoom=0.5 the image is demagnified 50 percent.
      • Image Centering: There are three options provided.
        1. Beam (Q=0) Center: If this option is selected, the image will always be magnified in such a way that the center of the false color image is the place where the direct beam hits the detector (usually covered by a beam stop). This is probably the most useful choice under normal operating conditions. However, it fails when the beam zero does not lie on the detector, which may happen when operating in wide-angle mode. Setting this center is most often accomplished using the tools in the Calibrate panel, but can also be done manually in this window. Click "Enable Center Changed", drag the blue cursor or type in the boxes labeled "Zoom X Center" and "Zoom Y Center" until the desired position is selected. Then click "Apply".
        2. Data Center: If this option is selected, the image is magnified in such a way that the image of the false color image is the geometrical center of the data set. This is most useful when the beam zero is near the edge of the detector or completely off the detector.
        3. User Defined: If this option is defined, the user can choose an arbitrary spot on the image to use as the magnification center. Click "Enable Center Changed", drag the blue cursor or type in the boxes labeled "Zoom X Center" and "Zoom Y Center" until the desired position is selected. Then click "Apply".
      • Apply: None of these changes will take effect until you click the Apply Button.
      • Close: Click the Close button to close the Zoom window without making further changes.
    • Show Grid This drop-down menu allows you you to superimpose a grid on the false color image, for better locating the positions of features of interest. Possibilities are: No Grid (default); Q-Chi Grid (circles are in equal increments of momentum transfer, radial lines every ten degrees of azimuth), 2-Theta-Chi Grid (circles are in equal increments of scattering angle), or Qx-Qy Grid (square or rectangular grid). Notice that the grid is meaningless unless the calibration constants are set correctly (range, center, tilt, etc.). In Batch mode see the SETGRID option.
    • Fix Grid Intervals This checkbox affects the operation of the Show Grid command. If it is is unchecked, then the program will calculate for you the positions of the grid circles and lines. If it is checked, then a new window appears which allows you to set these values yourself. In Batch mode see the FORCEGRID and GRIDINCREMENTS options.
    • Set Intervals This button brings back the window that was opened by the Fix Grid Intervals box, so that you can once again set the values of the grid overlay. Note that these values will have no effect unless the Fix Grid Intervals box is checked.
    • Save Overlay If this box is checked, then any "overlays" on the false color image (grid, the X at the center, region selected for plotting) will be copied onto an image copied into the clipboard or saved as a graphics image. In Batch mode see the SAVEOVERLAY option.
    • File Name on Image If this box is checked, then the name of the currently open file will be displayed on the false color image. This might be useful if you were pasting the images into another document and wanted to keep track of which was which. In Batch mode see the WRITEFILENAME option.
    • Show Movie Controls This option allows you to make a movie (or a fast slideshow) of false color images. It is suggested that you begin by opening an image, setting the color scale the way you want it, and clicking on "Disable Automatic Image Rescale". This will ensure that all frames show with the same maximum/minimum. Click on "Show Movie Controls" to bring up a new window. "New Movie" initializes the sequence. Each time you have a false-color image that has been read in and optimized the way you like it, click on "Add Frame" to add that image to the buffer. When you have all images you want, click "Play" to show the sequence and "Stop" to stop showing the sequence. Click on "Save" to save the final result as a .avi file. An avi file can be read by most movie players, and can also be imported into an application such as Powerpoint for presentation purposes.

      The drop-down menu shows the nominal delay between frames, in milliseconds. The actual time may vary depending on the speed of your computer and how many other processes are running.

      The movie option can also be accessed programmatically in the Batch mode using the INITIALIZEMOVIE, ADDMOVIEFRAME, PLAYMOVIE, and SAVEMOVIE options. You can also add frames as one of the options under Process Multiple Files, and you can save a movie using the File->Save Movie menu item.

    • 3D Display Instead of the standard false color image or contour image, it is possible to make a pseudo-three-dimensional image of the raw data. After some binning, a series of line plots are superimposed to make "mountains" and "valleys" in a separate window. You must first read in data and if desired set the hue, value, and zoom in the top part of the Image panel. Then select the image size (in pixels) using the appropriate button next to "3D Image Size". Finally, click "Make/Refresh Display". You will need to click again each time you wish to refresh this image.
      Note that the peaks are truncated at the value set by "Max", so the image will have a different appearance depending on the Max/Min/Color Scale settings.
      The generated image can be saved using
      File -> Save 3D Image
      In batch mode see MAKE3DIMAGE and SAVE3DIMAGE.
    • Disable Image Display Normally, the false color image is displayed and updated every time an important change is made (new data, change in color scale, change in center, etc.) The false color image can be disabled by checking the "Disable Display" box. This is normally used only if data are being analyzed in batch mode, in which case the operator does not plan to actually look at the images but speed is important. Accessed programatically using IMAGEDISPLAYENABLE.
    • Show Powder Rings If this box is checked, then when powder diffraction lines are displayed on the plot image (using the "Show Powder Diffraction Line Positions" option in the Plot panel) the corresponding Bragg diffraction rings will also show up on the false color image.
    • Disable Automatic Image Rescale Normally, Datsqueeze resets the color scale (maximum-minimum) of the false color image each time a new file is opened, attempting to choose a sensible scale that will highlight the features of interest. If the "Disable Automatic Image Rescale" box is checked, this feature is disabled, and the same color scale is used. This might be useful, for example, when comparing a series of similar files or when making a "movie"; in this case the user might wish to use the same scale throughout the series. No matter how the check box is set, the first image opened in a session is always autoscaled. This feature is accessed programatically using IMAGEAUTORECALCENABLE.
    • Restore Defaults Restore most features of the false color image to their default values. This feature is accessed programatically using RESTOREDEFAULTIMAGEVALUES.
    • Saved Image Resolution This radio button sets the resolution of a false-color image saved with the File-Save False Color Image or Process Multiple Files options. "Low" resolution corresponds to a 512x512 image, identical to that displayed on the screen. "Medium" resolution corresponds to a 1024x1024 image. A "High" resolution image is saved with the same number of pixels per side as the larger dimension of pixels in the original data set--i.e., a 1024x2048 data image would be saved as a 2048x2048 square pixel array.
      Note that higher resolution images take longer to save and may consume substantially more disk space.
  • Manipulate Panel

    This panel is selected by clicking on the Manipulate tab in the left-hand window. It has buttons that allow you to modify or smooth the data in various ways. Note that most of these options actually change the data in memory, and there is no "undo" feature--if you are not happy with the results you will need to read the data in again. (However, your original data file is never modified). Also, it is important to calibrate the pattern (by setting the range, center, tilt, etc.) before modifying the data by condensing, etc. This is because most of the "Manipulate" features also result in changes to the calibration parameters that are not retained when the next file is opened, or saved for future use.
    • De-Zing This button, if clicked, will remove "zingers" from the image. These are pixels that have substantially (and astatistically) more intensity than all of their neighbors. (Specifically, pixels that deviate by more than five standard deviations from all four of their nearest neighbors). This can be a problem particularly with some CCD detectors. The pixel is replaced with the average of the surrounding nearest-neighbor pixels. Note that this process is irreversible, although the original data file is untouched. If you are unhappy with the results, you will have to read in the data again. Note also that the algorithm may falsely identify pixels as "zingers" if you have very sharp Bragg peaks, with widths on the order of several pixels. The dezing-ing process can take several seconds; a progress bar lets you know how far you have gotten. In Batch mode see the DEZING option.
    • Smooth This button, if clicked, will locally smooth the image, by replacing each pixel with an average including that pixel and the surrounding pixels. This may help in identifying interesting features in a noisy image. It should not ordinarily have a big effect on line plots, but the process does actually throw away some information, so you should probably not do it before making publication-quality plots. Note that this process is irreversible, although the original data file is untouched. If you are unhappy with the results, you will have to read in the data again. For most applications the Condense option may in many cases be closer to what you want. The smoothing process can take several seconds; a progress bar lets you know how far you have gotten. In Batch mode see the SMOOTH option.
    • Condense This button, if clicked, condenses the image by summing together multiple pixels. The drop-down menu above it specifies how many pixels are to be combined--for example, if 3x3 is selected then each region of 3x3=9 pixels is summed into one pixel, resulting in a dataset that is 1/9 the size of the original with each pixel containing on the order of 9 times the original value. Like the Smooth option, this may help in identifying interesting features in a noisy image. However, it does a better job than Smooth on low statistics data, since the data are summed rather than averaged so that no counts are thrown away. It also has the effect of speeding up subsequent calculations, since the size of the dataset over which calculations are done is substantially reduced. The net effect is as if you had a detector with lower spatial resolution (larger pixels). If you are unhappy with the results, you will have to read in the data again. The condensing process can take several seconds; a progress bar lets you know how far you have gotten. In Batch mode see the CONDENSE option.
    • Rotate This button, if clicked, will rotate the image 90 degrees counterclockwise. The rotation process can take several seconds; a progress bar lets you know how far you have gotten. In Batch mode see the ROTATE option.
    • Flip Horiz This button, if clicked, will reflect the image about a vertical axis. The reflection process can take several seconds; a progress bar lets you know how far you have gotten. In Batch mode see the FLIPHORIZONTAL option.
    • Flip Vertical This button, if clicked, will reflect the image about a horizontal axis. The reflection process can take several seconds; a progress bar lets you know how far you have gotten. In Batch mode see the FLIPVERTICAL option.
    • Symmetrize Horizontally This button, if clicked, will "fold" the data about a vertical axis passing through the center position so that the right and left sides are symmetric. Note that it is important to carefully set the beam center before doing this. Note also that data size usually increases somewhat, with the new center forced to be in the x-pixel at the center of the image and a concomitant adjustment of the qrange calibration parameter. In Batch mode see the HORIZSYM option.
    • Symmetrize Vertically This button, if clicked, will "fold" the data about a horizontal axis passing through the center position so that the top and bottom sides are symmetric. Note that it is important to carefully set the beam center before doing this. Note also that data size usually increases somewhat, with the new center forced to be in the y-pixel at the center of the image and a concomitant adjustment of the qrange calibration parameter. In Batch mode see the VERTSYM option.
    • Impose Inversion SymmetryThis button, if clicked, will "fold" the data about the center position so that the image has inversion symmetry. Note that it is important to carefully set the beam center before doing this. Note also that data size usually increases somewhat, with the new center forced to be in the center of the image and a concomitant adjustment of the qrange calibration parameter. In Batch mode see the INVERTSYM option.
    • Fourier Transform The "Fourier Transform" option allows the user to make a direct Fourier transform of the data and visualize the result in a false color image. In Batch mode see the 2DFFT option. This is intended as a qualitative, rather than quantitative, tool that may give the user some insights into the physical origin of unexpected scattering patterns.
      It is well understood that, in principle, the Fourier transform of the scattered intensity yields the charge density autocorrelation function, sometimes known as the Patterson function. [See, e.g., J. Als-Nielson and D. McMorrow, Elements of Modern X-ray Physics (Wiley, 2001).] The reality is usually more complicated. Background scattering and spurious effects from the optics and instrumentation produce artefacts in the FT image, the Patterson function is only produced if the FT extends out to very large scattering angle and the data are properly normalized, etc.
      Datasqueeze uses the Fast Fourier Transform (FFT) algorithm to convert the 2D array of xray intensities measured in the 2D detector to a Fourier transform spectrum. [See J. S. Walker, Fast Fourier Transforms, Second Edition , CRC Press (1996); for a typical implementation of the FFT in the C programming language see http://local.wasp.uwa.edu.au/~pbourke/other/dft/]. In the FFT algorithm, an array of N real elements is replaced by a new array of N complex elements. The smallest element corresponds to a periodicity of 2 Pi over the largest element in the original array. Specifically, in the Datasqueeze implementation the following operations are performed:
      1. If needed, the data are padded with zeros to create a square array whose dimensions are an integer power of 2 (1024, 2048, etc.).
      2. Data excluded by the user-defined Mask are replaced with zeros.
      3. The data are multiplied by a filtering function whose function is to minimize ringing and aliasing effects.
      4. Each row of the array is subjected to the FFT algorithm, replacing the original numbers with new complex numbers.
      5. Each column of the array is subjected to the FFT algorithm.
      6. The power spectrum is calculated as the sum of the squares of the real and imaginary parts.
      7. The array is folded onto itself so that the zero (corresponding to the summed values of the original array) is at the center, rather than the corners, of the array.
      8. This new power spectrum is displayed in a false color image similar to that originally used to display the data.
      To execute the FFT, after reading in the data the user selects the desired Zoom and Filter, then clicks on the "Perform FT" button in the Manipulate panel.
      Magnification: This drop-down menu selects which part of the calculated spectrum will be viewed. Keep in mind that the outer part of the FT image reflects frequencies corrresponding to length scales of one pixel, and are probably uninteresting. For a typical diffraction pattern, which fills much of the detector, the user will want to zoom in to near the center of the FT image.
      Filter: As discussed above, spurious "ringing" effects are minimized by filtering the data using a smooth function that goes to zero at the boundaries. At present, there are four possibilities for the prefilter; the addition of more will be driven by user input:
      1. "Hamming": This is probably the most commonly used filter in discrete Fourier transforms. Starting with an array of N intensities, z[i], the data are multiplied by a sine function that goes to zero at the end points:
        z'[i] = z[i] * sin2(i * Pi / (N-1))
        The same filter is applied in both the horizontal and vertical directions.
      2. "Pseudo-Lorentzian": There does not seem to be a good name for this function, which is nevertheless commonly used in the numerical analysis community. The data are multiplied by the function:
        z'[i] = z[i] / (1 + (4 * (i - N/2)/N)^6)
        This function does not quite go to zero at i=0 or i=N, but it is small. Compared to the Hamming function, it remains relatively large far from the center of the array.
      3. "Gaussian": The data are multiplied by the function:
        z'[i] = z[i] exp(-(4 * (i - N/2)/N)^2)
      4. "None": Not recommended, this option leaves the data untouched.
      Advice: The best results will be obtained for data that have relatively low background (or at least, very good signal:background) and for which both the data and the background are close to zero near the edges of the detector. To improve the quality of the FT image:
      1. If possible, subtract any background while reading in the data.
      2. Use the Mask feature to mask out any features not believed to arise from sample scattering. These might include parasitic scattering near beam zero, scattering at wide angles not believed to arise from the sample, etc.
      3. Consider using the Vertical, Horizontal, or Inversion symmetrizing features.
      4. Unless the interesting features in the data alternate from pixel to pixel, you will probably want to zoom in by a factor of 4 or more. To put it differently, if the instrumental resolution is N pixels wide, you will want to zoom in by at least a factor of N.
  • Calibrate Panel

    This panel allows you to set the center and scale of the image. There are multiple ways to do this:
    • Autocalibration

      If you know the d-spacing, q-value, or 2theta of one or more Bragg rings from your calibration sample, then the autocalibration wizard can automatically find the detector parameters (with a little help).
      • To start, click on "Start" underneath "Run Least-Squares Calibration Wizard". This brings up the calibration wizard, which will lead you through a sequence of steps. At each point you can back up using the "Previous" button.
      • The first box asks you to select your instrumental mode by checking the appropriate button.
        1. In Small-Angle (SAXS) mode, the more commonly-used of the two, the primary beam is on or close to the detector (generally with a beamstop between the beam and the detector), and the face of the detector is approximately normal to the beam. If the detector is relatively close to the sample, the angular range spanned by the detector will be large, while if it is farther away the range will be small, but in either case the widest angle obtainable is generally determined by the size of the detector and the smallest angle by the size of the beamstop. Bragg rings will look approximately circular on the detector in this case. In Datasqueeze, the relationship between momentum transfer q and pixel number (x,y) can be determined if the instrumental configuration is characterized in terms of the wavelength lambda, the q-range (span of the detector in momentum), the coordinates of the pixel where the primary beam hits, and the amount and direction by which the detector is tilted relative to the primary beam (Detector Tilt and Tilt Azimuth).
        2. In the less commonly used Wide Angle (WAXS) mode, the detector is mounted on a 2theta arm which may be rotated by a wide angle (often 90 degrees or more) from the primary beam. In Datasqueeze, the instrumental configuration is now characterized by the wavelength lambda, the q-range (the span in momentum transfer that the detector would have if the beam center were at the center of the detector), the amount and direction by which the detector 2theta arm was rotated relative to the primary beam (Detector 2Theta and Detector Azimuth), and the coordinates of the pixel where the primary beam would hit if Detector 2Theta = 0.
      • The next step asks you to verify the wavelength used (in Angtroms). If necessary, retype into the box labeled "Lambda". A box below reminds you of useful wavelengths for commonly used x-ray targets.
      • Next, you are asked to enter in either the pixel size or the detector dimensions. The pixel size is the span of one detector pixel, in micrometers. (The pixels are assumed to be square, which seems to be true for all currently marketed detectors). The detector width is the width or height of the entire pixel array, in centimeters (if the array is non-square, the larger of the two dimensions is chosen). This is the quantity that is referred to as the "diameter" in Batch mode. The detector diagonal is the diagonal span of the pixel array, equal to sqrt(2) times the detector width, and often quoted by detector manufacturers as the "diameter". If you do not know these numbers it is not a problem, leave them as they are and the calibration wizard will still function properly.
      • Now enter the number of Bragg rings that you will use to calibrate the instrument parameters. In SAXS mode the minimum is one ring, but if you do not have an entire circle showing, you will need to use at least two. In WAXS mode, the minimum is two rings. In general, the more rings you use, the better the fit, but also the longer it takes.
      • Next, you are asked if you already have the Bragg ring positions in a standard Bruker calibration file. If you answer "Yes" to the query in this box then you will navigate to the file you want. These files are quite simple, and you can create one yourself using most standard text editors with the provided file (agbe.std) as a template. The first line is a title, and the each remaining line consists of a d-spacing (in Angstroms) and an intensity (which is not used). Note however that this is one place where the number format is not locale-dependent; the d-spacings should all use the American format. That is, a d-spacing that is a little over 45 Angstroms should be written as 45.3 rather than 45,3. If you check the "Yes" button then in the next step you will navigate to the calibration file.
      • For the next step in the calibration process, enter the values of momentum transfer q, Bragg angle 2-theta, or d-spacing d for each of the rings that you will use for calibration. If you have read in a calibration file, they will already be entered in editable boxes; if not, default values will be entered. For the calibration to work properly you need rings, not sharp peaks from single crystals or fiber diffraction patterns, so your calibration material should be a powder. Type the parameter appropriate for each ring into one of the boxes labeled Q, 2Theta, or D.
      • The next few steps in the wizard depend on whether you selected SAXS or WAXS Mode. For SAXS mode:
        • Set the approximate position of the beam center. (This is the position where the direct beam would hit the detector; it is usually hidden by a beam stop so you have to make an estimate). You can do this by dragging the beam center position on the false color image, or by typing in the "X-Center" and "Y-Center" boxes.
        • For each ring, you will now identify the feature in the data corresponding to the ring that will be analyzed. Drag the blue dots on the false color image so that the inner and outer rings span the Bragg ring of interest, just as if you were going to make a q-chi plot of that ring. This will tell Datasqueeze over what region it should do the least-squares fit. You want to make sure that the inner ring is everywhere at smaller radius, and the outer ring everywhere at larger radius, than the feature of interest, and also that no other strong features are included within that region.
      • For WAXS Mode:
        • Datasqueeze first attempts to establish the general orientation of the detector relative to the beam zero. For a laboratory apparatus, the detector has quite likely been rotated to the right or left in a horizontal plane (so that the beam zero is to the left or right of the detector). For a synchrotron facility, the detector has likely been rotated in a vertical direction. Check the box that best corresponds to the direction the 2theta arm has moved.
        • In the next step, Datasqueeze uses the curvature of one of the Bragg rings to determine the approximate position of the beam center position (which may or may not be on the detector). Four blue control dots are shown. Drag them so that they all lie on top of one of the Bragg rings in the image, as widely spaced as possible. In the wizard box, be sure to correctly identify which ring you used.
        • In wide angle mode we assume that the detector is mounted on a 2theta arm which has been rotated away from the primary beam. You are asked to enter the angle in degrees by which the detector has been rotated away from the beam zero. This will probably be the "2-theta" value in whatever software you are using to control the sample goniometer.
        • Before optimizing parameters, we need a good estimate for the angular width of the detector. This is accomplished by marking the positions of two of the Bragg rings that you will use for calibration. You should see on the false color image two blue cursor dots. Drag one of these cursors to the lowest-angle ring that you will use for calibration and the other to the highest-angle ring. Important: These must be the lowest- and highest-angle rings that you are actually going to use for calibration, not other rings that might be on the image and not intermediate-angle rings. If this step is not done correctly, it is unlikely that the rest of the calibration process will be successful.
        • For each ring, you will now identify the feature in the data corresponding to the ring that will be analyzed. Drag the blue dots on the false color image so that the inner and outer rings span the Bragg ring of interest, just as if you were going to make a q-chi plot of that ring. This will tell Datasqueeze over what region it should do the least-squares fit. You want to make sure that the inner ring is everywhere at smaller radius, and the outer ring everywhere at larger radius, than the feature of interest, and also that no other strong features are included within that region.
      • In this step you are asked to confirm the starting values of the calibration parameters before Datasqueeze enters the least-squares-fit phase of the optimization. The box displays the starting values of the parameters that will be used in optimizing the detector calibration. In most cases, the user will probably wish to leave them untouched and proceed to the next step. However, if you feel that you have a better idea of what a particular parameter should be, you can enter that value in the appropriate box. You can also decide not to optimize a particular parameter by checking the box next to that parameter. This is indicated if you are certain that you already know the best value for that parameter, or if you find that in the next step Datasqueeze is unable to accurately optimize that parameter, or if you want to hold that parameter fixed to maintain consistency with some previous data analysis.
      • Datasqueeze will now attempt to refine the detector parameters. Depending on the size of your image, and the reflection chosen, this may take some time. After the calibration process is finished, the optimized parameters will be printed in the box and also the calculated ring positions will be displayed in the false color image. If they look reasonable to you, and the rings on the false color image look centered, click "Next". If you wish you can cut-and-paste the information to another document. If the parameters appear to be physically unreasonable, or if the calculated rings are visibly inconsistent with the measured rings, you will wish to redo the calculation (click "Back"). It is possible that you made a mistake in one of the earlier steps (for example, in WAXS mode, incorrectly identifying the ring that you used for estimating the beam center position). It is also possible that one or more of the fitting parameters need to be checked (or unchecked) in the previous step to change which parameters are allowed to vary.
      • You are given the opportunity to save the d-spacing(s) you used in a calibration file. If you already got the parameters out of a *.std file there is probably no point to this, but if you typed them in by hand then it may be convenient to save them for future use.
      • After the best calibration parameters (wavelength, q-range, tilt, etc.) have been determined, they can be saved in a file for subsequent use. Previously saved parameters can be retrieved in Batch mode using the "RETRIEVEINSTRUMENTPARAMETERS" command or in user mode using the Retrieve Parameters button in the Calibration window.
    • Show Bragg Rings from File

      You can visually verify your alignment by comparing the positions and radii of measured Bragg rings with those calculated using a standard Bruker calibration file. These files are quite simple, and you can create one yourself using most standard text editors with the provided file (agbe.std) as a template. The first line is a title, and the each remaining line consists of a d-spacing (in Angstroms) and an intensity (which is not used). Note however that this is one place where the number format is not locale-dependent; the d-spacings should all use the American format. That is, a d-spacing that is a little over 45 Angstroms should be written as 45.3 rather than 45,3. This is often performed in conjunction with the "Enter Instrument Parameters by Hand" option (see below).
      • To begin, click on "Start" under "Show Bragg Positions from File". This will open a dialog box which will allow you to navigate through the file system and find the calibration file you want. It should have a .std extension, although this may be invisible under Windows. Select the file you want to use and click Open. A set of circles should appear on the data image.
      • Now click "Enter" under Enter Instrument Parameters by Hand, and adjust the center, range, and other parameters until the calculated rings lie on top of the measured rings and the Bragg rings are as circular as possible.
        Note: This can fail if you are not using a calibration file appropriate for the data set you are using. For example, if the largest d-spacing of the calibration sample chosen is still smaller than the minimum d-spacing accessible for the camera length of your apparatus, no rings will appear on your image. Likewise, if the d-spacings are too small, you will get a large number of useless rings at very small radius. Also, you want to make sure that you have set the color scale such that the diffraction rings of interest are actually visible before starting the calibration process.
      • Adust the center positions, detector tilt, azimuth, and Q-range until the calculated circles lie on top of the measured Bragg rings and the Bragg rings are as circular as possible
        Important: Remember to click on the Done button when finished. Otherwise, if you click on the image again (even by accident) you may mess up your plot or cause confusion in other parts of the program.
    • Save or Retrieve Instrument Parameters

      If you have determined the best calibration parameters for a particular data collection, you can save them for subsequent use by using the Save Parameters button to save and the Retrieve Parameters button to retrieve; when running the Least-Squares Calibration Wizard the user is also given the opportunity to save the obtained parameters. Previously saved parameters can be retrieved in Batch mode using the "RETRIEVEINSTRUMENTPARAMETERS" command.
    • Enter Instrument Parameters by Hand

      If you have previously established the center positions, detector tilt, azimuth, and Q-range, you can also just enter these manually. Click the Enter button to bring up the window for manual calibration parameter entry.
      • Centering This feature allows you to change the center of the image. In SAXS mode this is the position where the direct beam would have hit if there were no beamstop, and it is indicated by an X on the false color image. In WAXS mode it is the position where the beam would hit if Detector 2Theta were zero, and it is indicated by an arrow pointing in the direction of increasing 2theta. For a detector with N x N pixels, the X-Center and Y-Center values are often somewhere close to (N/2, N/2), although sometimes data are taken in a mode where the beam zero is close to the edge of the detector, and sometimes the beam zero is completely off the detector. In Batch mode see the CEN command. To start recentering, click on "Enable Center Change" (nothing will happen until you do this). The X-Center and Y-Center boxes in the right should change from italic to roman font. At this point, you can change the center either by retyping the desired values in the two boxes, or by dragging the X in the image to the new position.
        Very important: you must click the "Disable Center Change" button when you are done. Otherwise, mouse clicks to center may still be enabled and you may get confusing results in other parts of the program.
        The windows will change back to italic when you have done this, and the image will be recalculated so that the center of the diffraction pattern is at the center of the image (depending on the Zoom option you have chosen).
      • Detector Tilt, Tilt Azimuth It commonly happens that the detector is not quite perpendicular to the beam normal. In that case, what should be a circular pattern is elongated perpendicular to the tilt axis. The combination of Det-Tilt and Azimuth correct for this. (These options are only used in SAXS mode.) Det-Tilt is the amount that the detector is tilted (in degrees) and Azimuth is the angle with which the pattern is tilted. For a pattern that appears to be stretched along the x-axis, you should set Azimuth=0 and play with Det-Tilt until the pattern is circular. For a pattern that appears to be stretched along the y-axis, Azimuth should be 90. In fact, any value of Azimuth between -360 and 360 is allowed.
      • Wavelength This is the wavelength of the radiation used, in Angstroms. The default is the wavelength for Cu-Ka radiation, as is used in most tabletop diffraction units. In Batch mode see the LAMBDA option.
      • Maximum Q The "Q-range" corresponds to the maximum momentum transfer at one edge (not corner) of the image, assuming that the beam zero is in the center of the image. It is one way of characterizing the angular range of the instrument, the others being "2theta max" and the ratio of "Detector Width" and "Sample-Detector Distance". For small- angle scattering the Q-range will be small while for wide-angle scattering it will be large. 2-theta max and the Sample-Detector are automatically updated every time the Q-range is changed, and vice versa. In Batch mode see the QRANGE option.
      • 2theta-max 2theta-max is the scattering angle corresponding to the Q-range; it is the 2-theta at one edge (not corner) of the image assuming that the beam center is in the center of the image. It depends on the camera length. For small- angle scattering 2theta-max will be small while for wide-angle scattering it will be large. The Q-range and Sample-Detector Distance are automatically updated every time 2theta-max is changed, and vice versa. In Batch mode see the TWOTHETARANGE option.
      • Sample-Det Sample-Detector Distance is the distance from the sample to the camera, in centimeters. 2-theta max is the arctangent of this distance divided by the Detector Width. The Q-range and 2-theta max are automatically updated every time Sample-Det is changed, and vice versa. In Batch mode see the LENGTH option.
      • Detector Width The detector width is the width or height of the entire pixel array, in centimeters (if the array is non-square, the larger of the two dimensions is chosen). This is the quantity that is referred to as the "diameter" in Batch mode. 2-theta max is the arctangent of the sample-detector distance divided by the radius (half the diameter). The Q-range and 2-theta max are automatically updated every time the detector diameter is changed. In Batch mode see the DIAMETER option.
      • Pixel size The pixel size is the span of one detector pixel, in micrometers. The horizontal and vertical dimensions are assumed to be the same. The detector diameter, and from that the q-range and 2-theta max are automatically updated every time the pixel size is changed.
      • Detector Diagonal The detector diagonal is the diagonal span of the pixel array, equal to sqrt(2) times the detector width, and often quoted by detector manufacturers as the "diameter".
      • Detector Azimuth, Detector 2Theta: These options are only used in Wide Angle mode. We assume that the detector is mounted on a 2theta arm which has been rotated away from the primary beam. The Detector Azimuth establishes the direction that the 2theta arm has been rotated; an azimuth of 0 or 180 corresponds to a rotation in the horizontal plane (common to laboratory tabletop units) and an azimuth of 90 or 270 corresponds to a rotation in the vertical plan (often used in synchrotron diffraction systems). The Detector 2Theta is the amount by which the detector has been rotated away from the beam center.
      • Chi Offset Chi is the azimuthal angle angle that defines the orientation of a feature in an image. By default, chi=0 is defined to be in the usual place, at the bottom of the first quadrant. This is fine for powder diffraction patterns or other cases where the orientation does not matter. However, suppose you have a fiber that is almost but not quite aligned with the horizontal or vertical axis. In that case you might want to make qx-qy plots, or to define chi=0 to be along the fiber axis. Datasqueeze deals with this by redefining the meaning of "chi=0". The "chi offset" is the amount in degrees by which the experimental equator differs from the nominal horizontal direction. To set it:
        1. Click on Set Chi Offset. A crosshair pattern should appear in the false color image. (This might fail if you are operating in wide angle mode with a very small angular range).
        2. You can either type your best estimate for the chi offset into the box, or drag the control points on the cross hair until a horizontal or vertical line is aligned with an interesting feature in your data.
        3. Click on Done.
        In Batch mode see the CHIOFFSET option.
    • SAXS Mode/WAXS Mode:

      A pair of radio buttons at the bottom of the Calibrate panel allow you to choose between two calculation modes. X-ray data using area detectors are commonly collected in one of two ways:
      • In Small-Angle (SAXS) mode, the more commonly used of the two, the primary beam is on or close to the detector (generally with a beamstop between the beam and the detector), and the face of the detector is approximately normal to the beam. If the detector is relatively close to the sample, the angular range spanned by the detector will be large, while if it is farther away the range will be small, but in either case the widest angle obtainable is generally determined by the size of the detector and the smallest angle by the size of the beamstop. Bragg rings will look approximately circular on the detector in this case. In Datasqueeze, the relationship between momentum transfer q and pixel number (x,y) can be determined if the instrumental configuration is characterized in terms of the wavelength lambda, the q-range (span of the detector in momentum units), the coordinates of the pixel where the primary beam hits, and the amount and direction by which the detector is tilted relative to the primary beam (Detector Tilt and Tilt Azimuth).
      • In the less commonly used Wide Angle (WAXS) mode, the detector is mounted on a 2theta arm which may be rotated by a wide angle (often 90 degrees or more) from the primary beam. In Datasqueeze, the instrumental configuration is now characterized by the wavelength lambda, the q-range (the span in momentum transfer that the detector would have if the beam center were at the center of the detector), the amount and direction by which the detector 2theta arm was rotated relative to the primary beam (Detector 2Theta and Detector Azimuth), and the coordinates of the pixel where the primary beam would hit if Detector 2Theta = 0.
      In Batch mode see the WAXSMODE option.
  • Plot Panel

    This panel allows you to change decide how a linear (x-y) plot will be made, and to launch the plot. The x-y data generated can be saved in ascii form; see FILE Menu. To use these features in Batch mode see the PLOT, AXISRANGE, CHIOFFSET, SELECTREGION, SETANTIALIAS, SETINTENSITYEXPONENT, and SETMARKERINDEX options.
    • Independent/Dependent Variable Since we are converting a two-dimensional data array into a one-dimensional plot, the data have to be collapsed in some way. The possible variables are Q (the magnitude of the momentum transfer), Q2 (the momentum transfer squared), 2-theta (the scattering angle, in degrees), Chi (the azimuthal angle, in degrees), Qx (the horizontal component of the momentum transfer), Qy (the vertical component of the momentum transfer), Ellipse (used for azimuthal plots, the integration is done going around an elliptical rather than circular path), or the fraction of the distance along an arbitrarily chosen line segment. A drop-down menu allows you to choose which will be the plotting parameter and which will be the parameter over which we sum or average. For example, selecting "Plot versus Q / Sum or average over Chi" causes the data to be plotted versus Q (a radial plot) while integrating over the azimuthal angle. Selecting "Plot versus Q^2 / Sum or average over Chi" together with a logarithmic y axis (described below) produces a Guinier plot of log(intensity) versus Q^2. Selecting "Plot versus Chi / Sum" or "average over Q" gives a polar plot of intensity versus azimuth at constant radius, while selecting "Plot versus Chi / Sum" or "average over Q-Ellipse" produces a plot of the azimuthal intensity traced along an elliptical path. (Normally you probably want a circular path; the elliptical path might be useful in cases of a distorted scattering pattern resulting from strained samples). Note that the scales of Q and 2-theta depend on having first properly calibrated both the center and the scale of the image, using for example the Calibrate panel.
      For most variables, when the plot is made the independent variable will be the actual value of Q, Chi, or whatever. For Line plots, there does not seem to be an obvious choice for what we mean by the independent variable, so the intensity is plotted versus fraction of distance along the chosen line segment (0 to 1).
    • Set Plot Limits This portion of the panel allows you to select the region over which you will make the plot. First note that you need to have opened a data file for anything in this section to work. Click on Start to begin; nothing will happen until you do this. Once you have "started" some curves should appear on the image to the left and some new text boxes should appear below the Start button. If you selected your independent/dependent variables to be Qx/Qy or Qy/Qx you will get a rectangle. If you chose Line you will get a line segment. If the dependent variable is Ellipse you will get an elllipse. Otherwise you will get a pie-shaped wedge. At this point, you can change the region of integration either by typing in the appropriate boxes or by dragging on the corners of the box or pie shape in the image. To drag on the corner, click on the large dot at one of the corners, wait until the color changes from blue to red, and then drag to the new position.
      If all of the limits are outside of the range of the image, you might not see any lines or corners at all. In that case you should type values in the appropriate boxes until you get the region of interest visible on the false color image.
      The limits for the Line and Ellipse options behave somewhat differently from the others. For the Line option, the "Low" and "High" X- and Y-Pixel values are the coordinates of the two ends of the line segment. "Fract" is the equivalent of "Delta" for the other plots--the number of points will be 1 + 1/Fract. Pixels are included in the plot if they are within Width/2 of the line segment itself. So a Width of zero will in general not include any pixels at all. (The default is 3). It is suggested that for this kind of plot you will almost certainly want to Average rather than Sum the data. For the Ellipse option, the independent variable is always Chi and always goes from zero to 360; the dependent variables are the lengths of the semimajor and semiminor axes a and b (with however b being allowed to be greater than, equal to, or less than a).
      You also need to set the "delta"--the increment over which the independent variable is plotted. If you make it too large you will have a plot with poor resolution. If you make it too small you will end up with a noisy plot. (If you make it smaller than one pixel you will get a very strange-looking plot.) Also, there is a defined limit on the maximum number of data points, currently set at 2000. Note that if you are going make plots of a number of related data sets, you probably want to set the integration region and the delta to be the same for each data set.
    • Reset Button: if you have somehow set parameters to values that are so inconsistent with the data set that no control buttons appear on the screen, hitting the Reset button will restore the starting parameters to something sensible.
    • Make/Update Plot When you have chosen the type of plot and the plot limits, click this button to actually generate the x-y plot. This may take several seconds if you have selected anew data region, but will go very fast if you have just changed a parameter such as linear vs. logarithmic axes.
    • Integrate/Average You have two choices here. If you choose "Sum" then Datasqueeze will integrate over the dependent variable . That is, for each value of the independent variable (say, Q) it will add up the values of all pixels between Q and Q + delta Q and inside the range of the dependent variable (say, Chi) chosen. If you choose "Average " then the program will plot the average counts/pixel over the same data range. This gives something more closely resembling the results of a measurement with a one-dimensional detector (e.g., a triple-axis diffractometer) in which a sin(theta) sin(2 theta) Lorentz factor is often applied to the data, as described in Advanced Plot Options. In most cases the Average option is probably preferred, since it tends to reduce the non-statistical noise due to pixelation errors.
    • Linear/Logarithmic Axes For both the x (independent variable) and y (intensity) axes in the plot you can choose a linear or logarithmic scale.
    • Summed Counts The "Sum in Range" displays the total number of counts in the selected region. It is only updated when the "Make Plot" button is clicked. Editing this box has no effect; it is purely informative.
    • Presets Datasqueeze provides a number of pre-defined settings for making plots. If you click on one of these buttons everything is done for you, with (almost) no decisions to make. Most of these settings, except for the Custom Presets, are useful only in SAXS mode.
      • Powder Plot This makes a plot similar to what you could get in a traditional theta-2theta powder diffraction scan. It is equivalent to setting the Independent/Dependent variables to Q/Chi, so that we plot versus Q=2 pi / d and integrate over the azimuthal angle. The scale is set to run from 0.05 to 0.95 of the Q-range. The increment is set to a round number such that there are something close to 500 points in the plot.
      • Pole Figure Plot This plots the intensity versus azimuth angle (chi). It is equivalent to setting the Independent/Dependent variables to Chi/Q, so that we plot the azimuthal angle and integrate over Q=2 pi / d. Q is set to average from 0.05 to 0.95 of the Q-range. Chi runs from 0 to 360 degrees in steps of 2 degrees.
      • Guinier Plot The Guinier law states that in the limit as q goes to zero the scattered intensity is proportional to exp(-q2 Rg2/3) where Rg is the radius of gyration of the scattering object. Accordingly, if we plot log10(I) versus q2 the slope can be be related to the radius of gyration. Clicking the Guinier button is equivalent to setting the Independent/Dependent variables to Q^2/Chi, so that we plot versus Q^2 and integrate over the azimuthal angle. The scale is set to run from Q2= (0.05 * qrange)2 to Q2= (0.95 * qrange)2. The increment is set to a round number such that there are something close to 500 points in the plot. A logarithmic scale is used for the Y-Axis.
      • Porod Plot The Porod law states that, for small-angle scattering from isolated objects (spheres, rods, sheets, etc.), as q becomes large the scattering is proportional to 1/q4. Accordingly, a plot of q4 I(q) should approach a constant. Clicking the Porod Plot button is similar to clicking the Powder Plot button except that n is set to 4 in the Multiply by X^n box so that we plot q4 I(q).

        Note that for most real data this plot will not approach a constant. This can happen for two reasons. First, there may be real wide-angle scattering due to interparticle correlations. For example, in a polymer melt there will be wide-angle scattering due to chain-chain correlations. Second, there may be a background signal due to air scattering, scattering from widows, etc. If this background is constant it will lead to a rising curve in a Porod plot. If you believe that this is happening you may wish to play with subtracting a constant number of counts per pixel in the File Panel .

      • Custom Presets You can save two different settings for user-defined plot parameters. This is useful if you want to plot a number of different data sets in exactly the same way, even in different multiple analysis sessions. Suppose, for example, that you want to define "Custom Preset 1." You do this in the following way:
        • Using the other plot controls, set up a plot exactly the way you want it (correct Dependent/Independent variables, right choice of axis log/linear buttons, right choice of plot range and increment, etc.).
        • Click the "Set C1" button. Datasqueeze will now remember these settings. If you answer affirmatively to the "save current settings" query when you exit, it will even remember these settings from one session to the next.
        • Now when you click "Custom1 " you will get the same kind of plot even if you have done other plots in the interim.
    • Show Powder Diffraction Lines. This feature can be helpful in indexing powder diffraction patterns of unknown symmetry. It will not replace a full Rietveld structural refinement, but it can be used to get a preliminary idea of the symmetry of the underlying lattice. After doing a radial plot of some sort (plotting versus Q, 2-theta, or Q2), set the drop-down menu under "Show Powder Diffraction Line Positions" to select the symmetry of a lattice to test. (Possibilities are a lamellar structure, which is one-dimensional, 6 two-dimensional nets, or the 14 three-dimensional Bravais lattices). A new window will appear. At the top of the window is some basic information and a simple schematic relating to the lattice selected. Below this are text windows and sliders for the parameters that can be varied for this lattice. This will include some or all of the lattice parameters, a, b, and c, and the lattice angles alpha, beta, and gamma. In general, only some of these parameters can be varied. For example, in a rhombohedral lattice, b=a, so b cannot be varied, and there is one lattice angle gamma that can be varied.
      • Click "Refresh" to show the indexed diffraction line positions on your plot.
      • Type into the boxes or drag the sliders to change the variables.
      • Click "Reset Limits" to reset the range of the sliders from the plots--Datasqueeze does its best to guess a reasonable range for each parameter given the limits of the plot and the symmetry of the lattice.
      • Click "Clear" to remove the diffraction lines from the plot.
      • Click "Change Limits" to pull up yet another window for manually setting the range of each slider.
      Note that if the "Show Powder Rings" check box has been set in the Image panel then rings for the region of interest will also appear on the false color image.
    • Advanced Plot Features. Clicking the "Advanced Features" button brings up a new window with less-often-used plot features. For most of these, it is necessary to click Apply after selecting the desired option. In detail, the options available in the Advanced Features window include:
      • Antialiasing When making a plot where there are a relatively small number of pixels per data point, "pixelation" noise can be significant. By checking the "Antialias" box, you can correct for this to some extent. The program breaks each pixel up into 4 sub-pixels, each with 25% of the intensity, and apportions the intensity accordingly. This results in cleaner looking plots, but also takes approximately 4 times as long to calculate, so it should only be turned on when you are satisfied that you have the plot range, etc., set the way you want.
      • Show Cursor : By default, the plot display contains a cursor which, when dragged, allows the user to obtain a text reading of the independent and dependent values corresponding to the cursor position. This cursor, and the corresponding text in the upper right hand corner of the plot, can be disabled by unchecking the "Show Cursor" box. Implemented in Batch mode using SETANTIALIAS.
      • Show Text : The upper right hand corner of a plot normally shows information on how the plot was constructed, as well as dynamically updated information on the current cursor position. This text display can be disabled by unchecking the "ShowText" box.
      • Show Error Bars : If the "Show Error Bars" box is checked then error bars are shown on the plot. This is only recommended if a relatively small number of data points are displayed. Implemented in Batch mode with the SHOWEB command.
      • Multiply by x^n Normally one wishes to plot the intensity versus the independent variable. But one can also multiple by a power of the independent variable. For example, to make a plot of Q2 I versus Q, select Q/Chi button and set n=2 in the Multiply by X^n box.
      • Divide by A + B cos^2(2 theta) For an initially unpolarized beam, the scattered beam intensity is reduced by a factor
        I' = I(1 + cos2 (2 theta))/2 .
        For a beam that is initially polarized (for example, due to a monochromator crystal between the source and sample, or because the source is synchrotron radiation), the polarization correction becomes
        I' = I(A + Bcos2 (2 theta))
        where the coefficients A and B depend on the initial polarization of the beam and the azimuthal direction (chi) of the scattered beam relative to the initial polarization. (See, e.g., B. E. Warren, X-ray Diffraction, Addison-Wesley, 1969, or other elementary texts on x-ray diffraction). The user can correct for this effect by dividing the measured intensity by the correction factor. Note that the polarization effect is very small for a typical small-angle geometry, in which case one can safely leave A and B at their default values of 1.0 and 0.0; for other geometries the user should think carefully about exactly how to apply this correction since it does in principle depend on chi. Implemented in Batch mode using SETCOSINEAB.
      • Line Width: The line width is the width of any of the lines in the plot image, in pixels. It can be set to any value between 0.1 and 10.0. The default is 1.0. If larger plots are created (by dragging the corners) or if the image will be cut-and-pasted in another document, a somewhat larger value may be more attractive.
      • Multiply by sin(theta), Multiply by sin(2theta): Depending on the scattering geometry, the scattered intensity may be modified by a factor
        I' = I/sin(theta)
        and/or a factor
        I' = I/sin(2 theta)
        For example, when a small single crystal is rotated through the Bragg condition, the correction factor is 1/sin(2 theta), whereas the intensity from a powder sample is 1/sin( theta)sin(2 theta), and there is no correction term at all for solution scattering from isolated isotropic particles. A term of the form 1/sin( theta)sin(2 theta) is sometimes known as a "Lorentz factor". (See, e.g., B. E. Warren, X-ray Diffraction, Addison-Wesley, 1969, or other elementary texts on x-ray diffraction). The user can correct for this effect by checking one or both of the "Multiply by sin(theta)" and "Multiply by sin(2 theta)" boxes in the Advanced Features panel. Implemented in Batch mode using the MULTIPLYSINTHETA and MULTIPLYSINTTHETA options.
      • Marker Size A drop-down box allows you to specify the radius of the solid circle that is placed at each data point on the plot. If "Auto" is selected, then the program chooses a radius according to the number of points in the plot. If "Line Only" is selected, then no circles are ever drawn. Otherwise, the user can select any radius from 1.0 to 5.0 pixels in steps of 0.5 pixel. Implemented in Batch mode using SETLINEWIDTH.
        Click the Apply button to implement the change.
        This option is non-volatile, in that it is saved with other preferences and restored the next time the program is restarted by the same user.
      • Marker Type A drop-down box allows you to specify the type of symbol used at each data point (filled circle, open circle, etc.). Click the Apply button to implement the change.
        This option is non-volatile, in that it is saved with other preferences and restored the next time the program is restarted by the same user.
      • Plot Font and Font Size A drop-down menu and a text box allow you to change the font and size of labels in the plot. The default size is 12-point. The default font is system-dependent, but is usually Arial. Note that not all fonts will have a pleasing appearance, or even be properly rendered. Implemented in Batch mode using SETPLOTFONT.
      • Plot Grid Two drop down menus allow you to overlay a grid on the plot. The first specifies the type of grid: None (default), Coarse (grid lines placed at tick positions), or Fine (grid lines placed at smaller intervals than tick positions). The second specifies the color of the grid (default is black). These are implemented in Batch mode using SETPLOTGRID and SETPLOTGRIDCOLOR.
      • X and Y Axis Options After changing the overall plot features and updating the plot with the Apply button, you can change the scale of either the independent or dependent variable, as well as the axis titles. For example, suppose that the plot as generated had the x-axis running from 0.01 to 0.08 in steps of 0.01. Text boxes allow you to reset these values--you could set the lower end of the range to 0.02, the upper end of the range to 0.07, and have a tick mark every 0.005. Note that this does not change how the data are calculated, just how they are plotted. Every time the plot is recalculated, the axes, and their titles, are set back to default values.
  • Fit Panel

    This panel allows you to set up the model for least-squares fits and then bring up the Fit Parameter Panel from which you control the actual fitting process. A general fitting function, or "model" is the sum of up to 22 sub-functions, each with 3 or 4 independent fitting parameters. Although you will certainly want to play around with least-squares fits on your own, it is strongly suggested that you read the Fit Help documentation (under the Help Menu) before doing anything that you plan to show to others! In Batch mode see the CONSTRUCTMODEL, NMODELS, and SETMODEL options.
    • Number of Functions: This drop-down menu allows you to select how many sub-models you will use, from 1 to 22.
    • Function Selection: Each menu below the top one allows you to select a particular sub-function.
    • Construct Button: When you have your model set up the way you want it, click on this button to bring up the Fit Parameter Panel.
    • Save Environment: This option allows you to save everything about your current fit model environment, including the models used and the values of the parameters, in a file for subsequent use. This can be useful if you are fitting many data files to the same model (perhaps quite complicated with many parameters) and you want to start the same place every time. Clicking this button brings up a dialog box that allows you to select a name and location from the file.
    • Restore Environment: This option restores the previously saved fit environment. Clicking the button brings up a dialog box that allows you to select the file you want.

  • Fit Parameter Panel

    This panel pops up once you have constructed a model and clicked on the Construct button in the Fit Panel. It has the following components components (in Batch mode see the SETFITPARAMETER option):
    • Parameter entry: Each fitting parameter is given a line with some boxes. Next to the name of the parameter is a check box. Check this if you want this parameter varied during the fit; otherwise leave it unchecked. (Notice that "Area" type parameters cannot be varied as they are not truly independent--they are calculated from the amlitude and the width). Next is the "Value" of the parameter. Enter an initial guess for the parameter; the final value after the least-squares minimization will also appear here. Next is the one-parameter error bar. This is an estimate of the one-standard-deviation uncertainty in this parameter, assuming that no other parameters were varied. Finally, there are low and high values for the "Multi-parameter error bar." These are one-standard deviation limits on this parameter assuming that all other variable parameters (those which you have allowed to vary) are adjusted simultaneously.
    • Apply Button: Click here to calculate the model with these starting parameters, not allowing anything to vary. The results of your fit will appear together with the original data in the Line Plot Image Window. In Batch mode see the APPLYFIT option.
    • Fit Button: Click here to perform a least-squares fit, using the starting parameters you entered in the Value box for each parameter, and varying only the checked parameters. The results of your fit will appear together with the original data in the Line Plot Image Window. The new values of the fitting parameters will appear in the Value boxes, and the estimated uncertainties will appear in the boxes to the right of these. In Batch mode see the DOFIT option.
    • Correlations Button: Click here to bring up a new window showing the correlations between different parameters. A correlation coeficient of 0 means that two parameters are "orthogonal"--they have totally different effects on the shape of the curve. A correlation coefficient of 1 means that the two parameters are totally correlated, and do exactly the same thing to the model--this is a bad thing. Similarly, a correlation of -1 is bad. You generally bring up this window if a fit fails due to strongly correlated parameters and you want to figure out which ones.
    • Revert Button: Click here to set all parameters back to the values they had before the last time you performed a fit.
    • Cancel Button: If a fit is taking a very long time, and you realize that you want to change starting values of parameters or the parameters varied, click here to cancel the fit. Warning: parameters may be left in an indeterminate state at this point.
    • Reset Button: Set all parameters back to reasonable values such that the function is at least likely to display properly on the plot.
    • Calculate MPEB Box : Check this box to calculate multi-parameter error bars after doing the fit. This slows things down a bit, so you may want to only do this part for the very last fit.
    • Display Submodels Box: Check this box to plot all the individual submodels in addition to the total model.
    • Display Fit Cursors: Most fit models come equipped with cursors, which allow you to graphically change some or all of the fit parameters. If this box is unchecked, the fit cursors are not shown. (The default is to show all cursors).
    The general procedure for performing a least-squares fit is as follows:
    1. Open a data file in the usual way. Make a line plot. The data in the line plot will be what you are fitting to.
    2. Use the Fit Panel to construct a model function by specifying the number of sub-functions and the type for each, and click on Construct to bring up the Fit Parameter Panel.
    3. Set each parameter to a reasonable starting value.
    4. Click the Apply Button and see whether your model with these parameters agrees approximately with the data. If it does not, go back to step 3.
    5. Check off the parameters you want to vary, and click on the Fit Button. If you get unexpected results, you may want to uncheck a few parameters, click on the Revert Button, and try again.
    6. Check in the message area to see how well the fit worked, and whether there were any errors.
    7. If you are happy with the results, you may want to print the plot showing the agreement between model and data, or save the fitting parameters.

  • Examine Panel

    This panel allows pixel-by-pixel examination of the current image. An 11 x 11 pixel blowup of a selected region appears with the same false color scaling as is set in the Image Panel. To start, click the START button. A cursor will appear in the upper-left-hand region of the Image Panel. Drag the cursor to the desired position. The boxes below the DONE button will show the current X and Y of the selected pixel, which is also the center pixel (outlined in a blue box) in the smaller image to the right. The box at the top right continuously updates the current values of Q, Qx, Qy, 2- Theta, and Chi for the center pixel.
    For more accurate positioning, you can type the coordinates of the desired pixel position into the X-pixel and Y-pixel boxes.
    Don't forget to click DONE when you are done, otherwise, future centering or plot selection operations may fail.
  • Line Plot Image Window

    This is not the tabbed Plot Panel, but the white window near the bottom where the plot actually appears. Although considerable control is provided over the appearance of the plot, if you want to manipulate the data in other was you can save the data in ASCII formrm using the FILE Menu and import the data into the graphing application of your choice.
    The top part of the plot shows the x-ray data generated from the full data set. If you have done a least-squares fit to the data, it also shows the function calculated with minimized parameters.
    If you have done a least-squares fit, the bottom portion of the plot shows the residual [(model - data) * weight] for each point.
    The line plot is generated by setting all the desired parameters in the Plot Panel and then clicking on the Make/Update Plot button. In addition to the line plot, you will also get a cursor consisting of a horizontal and vertical line with a large dot in the center. You can drag this cursor wherever you want in the window. (Click on the dot, wait until the cursor changes from blue to red, and drag to the chosen position). For further control, click the Advanced Plot Features button in the Plot Panel to bring up a window with more options.
    In the upper right corner you will see three dynamically updated values: the value of the independent variable corresponding to the current horizontal position of the cursor, the value of the intensity that would correspond to the current vertical position of the cursor, and the actual value of the intensity on the curve above or below the cursor. (Linear interpolation is done between adjacent data points). The current values of the independent variable and intensity appear in the upper right hand corner of the window.
    In some previous versions of Datasqueeze, clicking on the x-axis or y-axis legend allowed the user to change the axis scale. This capability has now been moved to the Advanced Plot Features window.
    Drag the lower right corner of the plot panel to resize the plot. You may need to re-generate the plot by clicking on the Make/Update Plot button after resizing.
  • File Menu

    The File Menu is located in the upper-left-hand corner of the screen (Macintosh and Windows standard). There are presently 17 options:
    1. Open Single File: Opens a single file, with no additive constant, a multiplicative constant of 1, and assuming that you want to add all images in the file if there is more than one. The shortcut key is (ctrl)-O (or Apple-O on Macintosh). If you want to do something more complicated (such as add up multiple files) you should use the File Panel instead. In Batch mode see the READIN option.
    2. Open Recent Files: Allows you to re-access a recently opened file, obtained from a lis in a drop-down menu. This is opened as a "single file" in the same manner as the previous item.
    3. Import 1D Data: This bypasses the false color screen, and imports a one-dimensional (x-y) data set, which is then plotted. This data set can then be analyzed via least-squares fits or powder indexing. The input file format is that created by the "Save Plot" command, so a common usage would be:
      • Open a 2D data file, and create an x-y plot as a 1D cut through the data. (But you might also have used some other application to create x-y data).
      • Save the data (Save Plot) in a text file
      • Open the text file with an external editor or spread sheet and modify it. For example, you might want to remove "bad points" or stitch together multiple plots from different angular ranges.
      • Import the modified file using Import 1D Data for further analysis in Datasqueeze.
      • Your data file should be in ascii format. Each line should minimally consist of an independent variable (e.g., Q) and the measured intensity, with an optional third column for uncertainty in the intensity, all separated by spaces, commas, or tabs. When the menu item is activated, you get a new window. Buttons in the top row select the column delimiters. The second row of buttons allows you to state whether there is a third column for uncertainties. The drop-down "Independent Variable" box allows you to choose the name of the independent variable. If you have some header information at the top of your file, select an appropriate number under "Lines to Skip" so that the first line read in is actual data. You can choose whether the X and Y axes should be plotted on linear or log scales. (The data in the file itself should always be on a linear, or absolute scale). You can also redefine the wavelength that was used for this data set. Start by clicking on Browse to choose an input file. When this is done, you will either get an error message or the first few lines of the file in white box. After looking at the file, you may wish to adjust the Column Delimiter and other settings above. You can also change the number of lines to read in (box next to Lines to Skip)—the default is the total number of lines in the file minus the number of lines to skip, but if desired you can read in a smaller number of lines. (The lines to read can only be changed after hitting the Browse button). Then click on Read. If the file was correctly read in, you should be able to click on Apply, at which point your data will be plotted. To change the details of the plot, click the Advanced Features button which brings up the same Advanced Plot Features window which is described in more detail in the Plot Panel section. Click on Cancel/.Done to close the window. The shortcut key is (ctrl)-Shift-I (or Apple-Shift-I on Macintosh). In Batch mode see the IMPORT1D option.
    4. Save False Color Image: After you have got the color scale, etc., set the way you want on the false color image, you can save the image in one of two standard graphics formats (PNG, JPEG, or TIFF). You will be prompted for the name (and location) of the file. A popup menu to the right or left gives you a choice of graphics formats. It is up to you to give your file name an appropriate extension (*.jpg, *.png, etc.); many programs, particularly in Windows, will not properly recognize a file with an incorrect extension. The jpeg format is suggested for most usages. However, some other applications may be happier reading in different format file. The program warns you if you are about to overwrite a previously existing file. The shortcut key is (ctrl)-S (or Apple-S on Macintosh).
    5. Save 3D Image: Saves the image created by the "3D Display" option in the plot image panel as a graphics file.
    6. Save 2D Data as Ascii File: Most data files consist of binary data, possibly with an ascii header or overflow buffer. This option allows you to save your data in ascii format. This results in a file that can be more easily read by a user-written program (written, e.g., in C, Fortran, or a similar language) or by a text or spreadsheet program such as Word or Excel (if you have enough memory to read in the entire file). Keep in mind that the ascii file will probably be about 10 times as large as the original data file, and it may take a while to write it out, depending on the size of the file and the speed of your machine. You can navigate through the file system to save the file where you want. You need to enter the name of the file in the box at the bottom-- it is suggested that you choose .txt as an extension if you will be looking at the file on a Windows system. (On Linux this does not matter). On the right- or left -hand side there is a set of 3 buttons that allow you to choose the delimiter between data columns: tab, comma, or space. In Batch mode see the SAVEIMAGE option.
    7. Save 2D Data as Tiff File: This option saves the raw data as a Tiff file. Since many data analysis programs, and even some manufacturer-supplied detector support programs, can read tiff files, this can be a useful option for those who want to export data saved in a manufacturer-defined format into a more commonly readable format. The data are saved in square, 16-bit tiff format. This is appropriate for most data formats, but does have some possibly unexpected consequences:
      • If the data were originally saved in a floating point format, some information may be lost.
      • Any negative data points (which can arise during post-processing by either the data-taking software or Datasqueeze) are replaced by zeroes.
      • If the original bit depth is greater than 16 (i.e., if the largest data point is greater than 32767) then all data points are divided by 2N such that the bit depth is reduced to 16.
      • If the original data were in a compressed format, the final file size may be substantially larger.
      In Batch mode see the SAVEDATAASTIFF option.
    8. Save Plot Image: After you have created a linear plot you can save an image of this plot in the same graphic image formats that are available for Save False Color Image.
    9. Save Plot Data as Ascii File: If you have already created an x-y plot of the data, you can save the x-y data for subsequent manipulation by a plotting program such as Excel, You can navigate through the file system to save the file where you want. You need to enter the name of the file in the box at the bottom-- it is suggested that you choose .txt as an extension if you will be looking at the file on a Windows system. (On Linux this does not matter; on Macintosh it usually does not matter). On the right- or left -hand side there is a set of 3 buttons that allow you to choose the delimiter between data columns: tab, comma, or space. This matters to some plotting programs. The shortcut key is (ctrl)-Shift-S (or Apple-Shift-S on Macintosh).

      Note that the data are saved exactly as plotted--if you did a log-log or semi-log plot then it is the logarithm of the data point that is saved, not the raw value. The first three columns are always the independent variable, the plotted intensity, and the uncertainty. Origin, Kaleidagraph, etc. If you have done a least-squares fit to this data set then the function value and residual are plotted as well. In Batch mode see the SAVEPLOT option.

    10. Export Plot Data: Save plot data in one of several standard formats (cpi, csv, gsas, plv, dbws, ascii profile, ascii 2-column profile). In Batch mode see the EXPORTPLOT option.
    11. Save Calculated Diffraction Lines:If you have used the Show Powder Diffraction Lines feature in the plot window, you can save the calculated values of q and 2-theta for each peak in a file.
    12. Save Dataset Statistics as Ascii File: If you have already calculated statistics for the current data set (using the Statistics window) you can save this information in an ascii file. Summary information is printed at the top, followed by tab-separated columns with bin statistics. As with the plot save option, it is suggested that you choose .txt as an extension. Note that the statistics are only refreshed when the Statistics window is opened (or, if it is open, if the Recalc or Autocalc button is clicked), so if you have changed files or binning options you will need to manually force a recalculation before saving the information to a file. In Batch mode see the SAVESTATISTICS option.
    13. Save Fitting Parameters: If you have done a least-squares fit, you can save the values of the fitted parameters in an ascii file. As with the plot save option, it is suggested that you choose .txt as an extension. A button allows you to choose between two types of file layout. I f"Row" is selected, each fitting parameter will be on a different line in the file, with the error bars on the same line. If "Column" is selected, the fitting parameters are arranged by columns; the first line has the values, the next has the standard error, and the next two have the lower and upper limits (if calculated). There is also a checkbox for you to indicate whether or not you want to be able to append to an existing file; it is suggested for "safety" (to prevent damaging an existing file) you leave this unchecked unless you know for a fact that you want to append to a file. In Batch mode see the SAVEFITPARAMETERS option.
    14. Save Movie: This option allows you to save a movie created with the Movie Controls option as a .avi file. You will be prompted for the file name.
    15. Page Setup: Acts like a normal Page Setup menu item, allowing the user to choose paper size, orientation, etc. It is suggested that more attractive results will be achieved in Portrait orientation than in Landscape orientation. Use in conjunction with the Print command (below).
    16. Print: The user has the choice of printing out a single summary page containing the false color image plus the line plot plus descriptive text, or the image only, or the plot only. It is obviously necessary to have an open data file for this to work and, if you want a plot, you should previously have generated the line plot from the Plot Panel . You first get a dialog box which allows you to change the title that appears on the top of the page, and also modify the text that will be printed, which is automatically generated by the program. You can edit this text (Datasqueeze Software carries no liability if you lie about your data!) or add more descriptive text if you wish. A drop-down menu at the bottom allows you to choose between printing the entire summary page (the only case in which the text that you edited is actually used), just the image, or just the plot. When you are done, click the Done button. A normal Print Dialog window will then come up on Macintosh and Windows machines.
      The shortcut key is (ctrl)-P (or Apple-P on Macintosh).
      Results may vary on Linux or Unix machines--it appears that Java does not have very good support for printing on Linux, and whether printing works at all may depend on which flavor of Linux you are running (Red Had, Debian, etc.). We hope to provide better Linux printing support in future versions. In Batch mode see the PRINT option.
    17. Save Current Settings: Save information on your current settings for working folder, detector type, q-range, etc., for a future session. Note that this information is only saved if you click on this menu item. Note also that parameters such as q-range are only retained in the next session if you set the "retain" button in the File panel.
    18. Restore Default Settings: Should rarely be necessary. If you have gotten the system into some kind of unfixable state using the Save Current Settings menu item, this gets you back to where you started. Also, if you want to change the way you are formatting numbers (for example, from the American style to the German or French style) this will bring up a dialog box that will allow you to set your preferred style. After this, the program exits, and you will need to restart it.
    19. Exit: Exit the program (does not appear in Macintosh). The shortcut key is (ctrl)-Q (or Apple-Q on Macintosh).
  • Edit Menu

    The Edit menu serves the normal functions of copying and pasting. For copying from or pasting to text boxes (i.e., numerical values), use the normal (cmd)C and (cmd)V commands (what cmd character to use depends on the operating system, but is the standard for that system). There are four special-purpose commands:
    1. Copy False Color Image: Copy the false color image into the system clipboard, so that it can subsequently be pasted into another document. (PC and Linux only, deprecated on Mac OSX 9 and above).
    2. Copy Plot Image: Copy an image of the plot panel into the system clipboard, so that it can subsequently be pasted into another document. (PC and Linux only, deprecated on Mac OSX 9 and above).
    3. Copy Fit Parameters: Copy a a text version of the fitting parameters into the system clipboard. They are tab delimited, so they are compatible with spreadsheet programs like Excel.
    4. Copy Fourier Transform Image: If a Fourier Transform has been performed, copy the FT image into the system clipboard, so that it can subsequently be pasted into another document. (PC and Linux only, deprecated on Mac OSX 9 and above).
  • Batch Menu

    Datasqueeze provides an interface for running in a "batch" mode, otherwise known as "scripting" or "running from a file". The scripting file is a simple ascii file that can be created with any text editor. It should be raw text--that is, it should not contain any formatting commands (bold, etc.) such as those produced by Word or most other text editors. It is suggested that the file have a suffix .txt, since this will indicate to Windows and Macintosh systems that this is a plain text file, but in fact Datasqueeze itself does not care.

    This feature is primarily useful if you want to process a number of data files in the same way, without visually examining each one. For example, you might want to read in a set of files, and for each one save a false-color image and an ascii version of the plot.

    There are presently five options under the Batch menu:

    1. Enable Logging Commands: This enables output to a text file of the commands you have entered from the graphical interface. A window opens which prompts you for the name of the file. It is suggested that you give it a .txt suffix. The shortcut key is (ctrl)-L (or Apple-L on Macintosh).
    2. Disable Logging Commands: This turns off command logging if it has been previously turned on. The shortcut key is (ctrl)-Shift-L (or Apple-Shift-L on Macintosh).
    3. Read from Command File: This causes the program to take its input from a command file that you specify. Note that the syntax of these command files is identical to that of the log files that you create with Enable Logging Commands, so a convenient way to create a command file is to enable logging, perform a set of typical commands, and then use any standard text editor to modify the log file and create the commands that you want. The shortcut key is (ctrl)-B (or Apple-B on Macintosh).
    4. Process Multiple Files This is an alternate approach to file processing, in which multiple files (anywhere from one to thousands) are treated in exactly the same way. When this menu item is selected, a dialog box is opened which allows you to select one or multiple files to process, and to check off various options. For most of these, default parameters are chosen based on your most recent actions. If data are saved, a default file name is chosen based on the name of the data file. In the following description, we assume that your data file name is FILENAME. The possible options are:
      • Movie Frame: If selected, will add the current false color image to the buffer of frames to show in a movie
      • Plot: If selected, will make a linear plot of the last type done (e.g., Q/Chi) with the ranges and options previously selected. You need to make a plot if you plan to do a least-squares fit to the data.
      • Fit : If selected, will do a least-squares fit to the data using a previously initialized fit model, starting parameters, and selection of which parameters to fit.
      • Propagate Parms : This affects how the parameters are chosen for the least-squares fit. If checked, each fit will use the as its starting point the fitted parameters from the last data set. This is useful, for example, if you are analyzing a temperature series where there is some kind of slow variation (e.g., a peak moving) but each data set resembles the previous one. However, if a fit fails for some reason then all subsequent fits will probably start with nonsense parameters. If this box is not set, then each data set is analyzed with the same starting parameters--"safer," but not as good if there is some kind of slow variation in peak position, width, or other parameters.
      • Save Image: If selected, the false color image will be saved as a graphics file in whatever format (JPEG, etc.) you last used. The filename will be FILENAME_img.jpg, FILENAME_img.png, or FILENAME_img.tif. The image resolution will be set by the "Saved Image Resolution" radio button in the Image panel.
      • Save Plot Data: If selected, and if you have done a linear plot, the plot data will be saved as a text file called FILENAME_plot.txt.
      • Save Plot Image: If selected, and if you have done a linear plot, an image of your plot will be saved as a graphics file, in whichever format (JPEG, PNG, TIFF) you last used, called FILENAME_plot_img.xxx, where xxx is one of jpg, png, or jpg.
      • Save Fit Parms: If selected, and if you have done a least-squares fit, fit parameters will be saved as a text file called FILENAME_fitp.txt.
      • All Same File: If you are saving fit parameters, and this box is checked, all the parameters will be saved in the same, initial file. Otherwise, the parameters for each data file will be saved in a different file.
      • Save Statistics: If selected, data set statistics will be saved in a file called FILENAME_stat.txt.
      • Print : If selected, a summary fit page will be printed. Note that on most operating systems this brings up a dialog page whether you want to or not, so some user intervention is required.
      As most of these commands take their parameters from previous operations, it is important that you have previously opened a data file similar to the ones you will be reading in, done a plot, and done a least-squares fit with final parameters similar to those you will use. You will probably want to set the "Retain" option in the File panel. A good way to accomplish all of this is to have a batch file set up that processes just one file in the way you want to do the rest.

      Any saved files will appear in the same directory (folder) as the original data files. If a file with the same name already exists, the procedure comes to a halt. So, if you run Process Multiple Files twice in the same directory, you may need to remove some files in between. Also, the procedure clearly will not work if the files sit in a write-only directory (for example, on a CD).

      One good way to set up for processing files would be to copy all of the data files you want to file into a new folder. Then you could select all of the files in that folder to be processed, use the check boxes to select what you want to do, and then process all the files--in principle a very large number.

  • View Menu

    There are presently six options under this menu:
    1. File Info: This opens a screen providing possibly useful information about the current data file. Note that the information provided does not reflect any changes made in the image center, counts added or subtracted when read in, etc.--it is the "as-read" information from the first file in the list. There is currently no way of displaying information about multiple files that have been added--you would have to open each file individually. The shortcut key is (ctrl)-I (or Apple-I on Macintosh).
    2. Format Info: This opens a screen providing information on the available file formats--what hardware probably created it, what is inside, and what kind of processing Datasqueeze does.
    3. Statistics: This opens a screen with information on pixel statistics. The shortcut key is (ctrl)-T (or Apple-T on Macintosh). In the default configuration, the program calculates the number of pixels with total counts in each of 20 bins, ranging from the least intense to the most intense. Both the total number of pixels, and the percentage of pixels, in each bin are calculated. This is done both for the entire data set, and for the region selected in the Plot Panel. This allows the user, for example, to exclude strong scattering near the beam stop from the statistics.
      If desired, new bin ranges can be entered by editing the low and high ranges for each bin. The bins do not have to be in order, and they can even overlap. To recalculcate the statistics using your new, edited ranges, click on the Recalculate button. To restore the default binning ranges, click on the Autocalc button.
      Boxes at the bottom show the minimum, maximum, and average counts per pixel in the entire data set, and for the region selected in the Plot Panel. These are straightforward. There is also a box labeled "Dispersion". This is more complicated. It calculates
      D = AVERAGE [ (yi - Ei) 2 / Ei ]
      where yi is the actual counts in pixel i, Ei is the average of the counts in the four surrounding pixels (i.e., a measure of the "expected" counts), and the average is done over pixels with 50 or more counts. This parameter has various interpretations:
      1. Suppose first that the data are fairly flat and featureless (for example, produced by a "flood field" calibration source) and that the counts in each pixel are actually equal to the number of photons that hit that part of the detector. In that case, Ei should actually be the expected number of counts in the pixel in question, and if Poisson statistics hold then D should be equal to 1.
      2. Suppose instead that the signal is still featureless, as above, but the counts reported for each pixel are only proportional to the number of photons that hit that pixel, yi = a Ni. In that case you can show that the parameter D is actually a measurement of the proportionality constant "a".
      3. On the other hand, if there is curvature to the data (for example, if the data set contains Bragg peaks, not unknown for x-ray data sets!) then D will be greater than 1 even if Poisson statistics hold. In this case the significance of D is somewhat less clear--it is a measure of the curvature, or second derivative, of the data set.

      In Batch mode, see the CALCSTATISTICS, NUMSTATBINS, SETSTATBIN, and SAVESTATISTICS commands.
    4. Show Access Key: This menu item opens a small window showing your access key to Datasqueeze. This is useful if you have forgotten to write it down and want to enable Datasqueeze on a different computer.
    5. Zoom Out: Demagnify the false color image by a factor of 2. Also accomplished (with more options on centering) via the Zoom button in the Image panel. The shortcut key is (ctrl)- (or Apple- on Macintosh). See ZOOM command in batch mode.
    6. Zoom In: Magnify the false color image by a factor of 2. Also accomplished (with more options on centering) via the Zoom button in the Image panel. The shortcut key is (ctrl)+ (or Apple= on Macintosh). See ZOOM command in batch mode.
  • Mask Menu

    A "mask" allows the user to exclude certain pixels from plots and calculations. These might be known "bad" pixels, scattering near the beamstop, scattering near known spurious features, etc. By default, pixels outside the data collection area are excluded, but these boundaries can be moved in. The user has the option of adding additional masks to exclude data inside specified rows or columns, individual pixels, inside a user-defined box or circle, or outside a user-defined circle. There are presently four items under this menu:
    1. Show/Hide Masks: If "Show Masks" is checked, the excluded areas are shown in a different false color palette (which is more or less the complement of the original palette). If the masked regions are shown, then checking "Hide Masks" will remove the highlighting.
    2. Edit Masks: Checking this item brings up a new window with controls for editing current masks or creating new masks.
      • To edit a current mask, either type the new desired value(s) in the box, or drag the blue cursor dot corresponding to that mask. For example, the first mask always excludes points outside the left-hand side of the image, and the default setting is to exclude pixels with -1 >= x.
      • To create a new mask, select the desired mask type from the drop-down menu and then click Apply. Currently available options are: "Exclude Points In Row", "Exclude Points In Column", "Exclude Points In One Pixel", "Exclude Points Inside Box", "Exclude Points Inside Circle", "Exclude Points Outside Circle".
      • To use the new masks, click Done.
      • To revert to previously used masks, click Cancel.
    3. Save Masks: A set of defined masks can be saved in a file for subsequent use. This is most useful if the same masks will be used over and over for many data files. Selecting Save Masks brings up a dialog that allows the user to select the name of the file where the mask information will be saved. We suggest that the file be given a suffix of .txt or something similar since it is a text file. The format of the created files is quite straightforward, and the user could also create them himself/herself using a text editor. If this is done, keep in mind that the "pixel" mask is relatively inefficient. Any time an data-intensive operation such as making a plot is performed, Datasqueeze must query each mask, so having a large number of individual masks can result in a substantial degradation of performance.
    4. Import Masks: This option retrieves a previously saved mask.
    To use these features in Batch mode see the MASK, APPLYMASK, and NMASK options. Note that the user always starts off with four masks that should not be changed, which tell Datasqueeze not to use data outside the active area of the detector. So, for example, for a 1024 x 1024 file, the first 4 masks would be specified as
    >MASK MINXMASK 0 -1.0000000
    >MASK MINYMASK 1 -1.0000000
    >MASK MAXXMASK 2 1.0240000E3
    >MASK MAXYMASK 3 1.0240000E3
    This indicates that no pixels should be considered with x or y less than 0 or greater than 1023. Other user-defined masks would then start with mask number 4, e.g. something like
    >MASK PIXELMASK 4 247.00 825.00
  • Tools Menu

    There is presently only one item under this menu:
    1. Q-S-D-Theta Calc: This convenient tool allows the user to quickly convert between different units for describing diffraction data.
      • Wavelength: the is the wavelength (lambda) of the incident radiation. Although it is initialized to the wavelength associated with the current data set, it can be set to any physically meaningful value desired. Changing the wavelength in this window will not change it elsewhere in the program.
      • Q: This is the moemntum transfer, in the units most often used by physicists:
        Q = 2 pi / D = (4 pi / lambda) sin (theta)
      • S: This is also the momentum transfer, in the units often used by crystallographers:
        S = Q / 2 pi = 1 / D = (2 / lambda) sin(theta)
      • D: This is the d-spacing associated with a particular momentum transfer (not necessarily a actual plane spacing in any crystal):
        D = (2 pi / Q) = 1 / S
      • Theta: this is the angle between the incident beam and the scattering plane, in degrees.
      • 2-Theta: this is the angle between the incident and outgoing rays, in degrees.
  • Help Menu

    There are presently seven items under this menu:
    1. General Information: This menu item opens a window showing the help file (you may be looking at it right now). The shortcut key is (ctrl)-H (or Apple-H on Macintosh).
    2. Batch Help: This opens a separate help window with detailed instructions on the command file syntax, as well as a brief description on how to use batch command files, with a simple example.
    3. Fit Help: Provides more detailed information and advice on least-squares fitting, including a sample session
    4. Sample Session: A tutorial introduction to the program, with a sample session.
    5. FAQ: Answers to frequently asked questions.
    6. Version History: Provides a summary of changes made in each version of Datasqueeze.
    7. Check for Updates: Checks online to see if a newer version of Datasqueeze is available.

  • Windows Menu

    This menu provides a list of current open Datasqueeze windows. You can use it to navigate to a different window (for example, going from the Fit window to the false color image). You can also move from one window to another by using ctrl-~ (Apple-~ on Macintosh).

Known Bugs

  • Dialog windows get hidden: If you open a dialog window (for example, to open a data file or save a graphics image), the main program waits until this window has completed its operations and been closed. This can cause a problem if you temporarily switch to a different application and then switch back--you may find that the window is now hidden behind the main application but the main interface window does not respond. If this happens, first try dragging the offending window to one side--the dialog box may reappear from underneath it. If this does not work, your only option is to forcibly kill the Datasqueeze application (for example, with Force Quit on Mac, or kill -9 on Linux, or Alt+F4 on Windows). To avoid this situation, before switching to a different application if a Dialog is open try to drag it so that at least part of the Dialog overlaps with the main desktop.
  • Funny Plots: Again, not really a bug. If you get an extremely noisy plot, or if only some of the data are plotted, check the "Delta" box in the plot parameters. For example, suppose you are doing a Q/Chi plot, and the full range in your detector is 0 to 0.2 inverse angstroms. You had Qmin set to 0.01, Qmax set to 0.18, and Delta set to 0.0001. This would imply 1700 data points, which is probably more data points than there are pixels in that range. Similarly, if you set Delta to 0.3 there will be only two points in the plot. Typically you want to set Delta to something like the greater of (a) the total range divided by 100 or (b) the estimated number of pixels along a line connecting the start and end points of the independent variable.
  • Zoom/Examine: The Examine panel behaves confusingly if the zoom is changed while the data are being examined. For consistency, choose the desired Zoom value in the Image Panel before doing the pixel-by-pixel examination.
  • "Corrupted" File Sometimes the file opening panel will claim that a file is corrupted. There are actually two possibilities here. One is that you really have a bad data file. The other (more likely) is that you are trying to use the wrong file format. Remember to check the "file format" drop-down menu next to the file navigation widow and make sure that the format is appropriate for your data file type. If you are not sure, try "unknown"--this is slow but usually gets the right answer.
  • Macintosh Print problems: On OS-X, Datasqueeze responds badly if something goes wrong when printing. In particular, when printing multiple pages, it is important to make sure that one page has completely finished printing before initiating another print job. Not doing so seems to put the program into a funny mode from which it is may be necessarily to forcibly kill the application using Force Quit. We are working to locate the origin of this bug.

Feedback


Please report any bugs, anomalies, or requests for features to support@datasqueezesoftware.com. If you are reporting a bug, please provide as much information as possible on exactly what you were doing when the bug surfaced, what platform you were using (e.g., PC running Windows ME), and the extent to which it is reproducible.

Note on Copyrights and Trademarks

  • Bruker is a trademark of Bruker AXS.
  • ADSC is a trademark of Area Detector Systems Corporation.
  • MAR is a trademark of X-ray Research GmbH.
  • Fuji is a trademark of Fuji Photographic Film Inc.
  • Molecular Metrology, Rigaku and R-Axis are trademarks of Rigaku/MSC.
  • Ditabis is a trademark of DITABIS Digital Biomedical Imaging Systems AG.
  • Gatan is a trademark of Gatan, Inc.
  • Java is a trademark of Oracle.
  • Datasqueeze is a copyright of Paul A. Heiney. This program may not be copied or redistributed in any form without the express permission of Datasqueeze Software.

Last modified February 6, 2015
email: support@datasqueezesoftware.com