FIT2D Page

    Some useful hints for Fit2d

After trying to analyze X-ray data for a long time mainly with Origin, but also with MatLab and Fit2d, I get the impression that the most useful program might be Fit2d. However, here the time limiting factor is: finding the button for your specific application, but if you found it out, everything seems to be pretty easy and straightforward, and most important, really fast!

So I sat down and made a small manual of how I am treating X-ray data at the moment as a small notebook for me, but also to anybody else who might make use of it. I know that I am starting maybe with rather obvious points and maybe the tricky things are still missing or poor, but be aware that this page is under construction and developing this page will be a dynamic project! If there is something missing, try again later, maybe I have done it until then or feel free to contact me by email.

This page deals with the general data treatment like importing and scaling images. These issues will apply to all experiments done usually at G1. There are also two specific pages which will explain the special tools for:


SAXS and 


Importing images:

  • To import a single image -> INPUT from the SAXS/GISAXS menu.
  • To get an overview over the data-> select FILE SERIES -> COMPOSITE (works only for files with a fixed prefix and an incremental numbering).
  • Sometimes there is also the option to work in the ON-LINE CRYSTALLOGRAPHY menu with either AUTO INPUT or NEXT/PREV FILE to scroll through the images. But this is also sometimes not working, even if it should.
  • If you have done e.g. five images with a 20 seconds exposure and want them sum up: FILE SERIES-> SUMMATION.


  • For calibration with the silver behenate go to the SAXS/GISAXS homepage and chose BEAM CENTRE and then CIRCLE COORDINATES. Now click onto several different points on the ring and finally on the yellow box at the bottom. In the other window from Fit2d you can read off now the values for the centre and the radius of the ring. For calibrations in general see also here.


  • Macros for single file use can be created by selecting the CREATE MACRO from the MACROS/LOG FILE menu and then EXIT, now perform all actions you woud like to do with the file, then go back to the MACROS/LOG FILE and select STOP MACRO. After that you are able to run the macro with RUN MACRO.
  • Alternatively you can run the macro with RUN SEQUENCE on more then one file. One limitation here is that the files need a constant prefix and end with numbers. The sequence of the end numbers must increase by a constant interval (1 or 2 or something).
  • For RUN SEQUENCE the #IN and #OUT macros must be used. This menas after creating the macros themselves you need to exchange the detailed file location for loading or saving by #IN and #OUT, respectively. There is only one output opportunity for one macro. So if you want to print one image as eps and a slice from the same image saved as a chiplot, you need two macros.
  • An example for a macro can be found here.














Graphics Design:

  • If you load a 2D-map and want to present it in your group meeting, a talk or in a journal, the first thing to do is to give the x- and y-axis some numbers. To do so, go in the main menu to KEYBOARD INTERFACE. There you use the command AXES SCALES, and then you will be prompted to give the q_|| and q_z value of the bottom left corner (pixel 1,1) as well as the distance between pixels (this is in most setups on the order of 1e-3 to 5e-4 -1/pixel). After that return the controls to the graphics window by typing exit. You can now do the ZOOM IN from the SAXS/GISAXS menu by typing q-values instead of pixels! The z-scale is in the SAXS/GISAXS menu under Z-SCALING.
  • During scaling the x- and y coordinates some problems might appear: the increment has to be positive. If the images are stored in a way, that images are read in upside down (the direct beam is above the image instead of below), you would need a negative increment for q_z, which will terminate fit2d. To correct for this issue, go to IMAGE PROCESSING (GENERAL) -> GEOMETRIC and FLIP top/bottom. If q_z is the horizontal axis and q_|| the vertical (the direct beam is to the left or to the right of the image), you can correct for this by combining the FLIP and TRANSPOSE functions.
  • The number of small ticks can be changed by going to the KEYBOARD INTERFACE and executing the command SET AXES STYLE.
  • The x- and y- Labels as well as the title bar and the color scale can be designed in the OPTIONS menu in the SAXS/GISAXS menu.
  • You can SAVE this configuration under OUTPUT -> TIFF 16 BIT.
  • If you just want to have the 2d-image (e.g. for a cover page or a TOC-graphic), delete the labels and the Title under the SAXS/GISAXS menu, OPTIONS, X,Y,Z LABELS, TITLE and select NO LUT. You can get rid of the ticks and tick labels under the KEYBOARD INTERFACE. Select SET ENUMERATION STYLE and deselect the x- and y-numbering. The tick labels? Well, one way is to make them white under SET AXES STYLE.
  • SET TICK POSITIONS lets you define the tick positions. Select NO at TICK POSITIONS AUTOMATIC



Some other useful stuff in Fit2d:

  • For one dimensional plots sometimes scatter graphs are more convenient then line plots. To change to scatter graphs, follow the following. Go to OPTIONS -> CURVE STYLES. I will only mention some functions which appear necessary to me.
  • MARKER TYPE...: 2 (well... Geschmackssache, but I do it this way)