# Module XAID_CALIB

## Module characteristics

- Goal: to calibrate a XAFS spectrum Mu(x). Calibration is done by calculating Mu(Energy), where the energy is calculated as a second degree polynomial in x. In other words, this module helps in finding the a,b,c coefficients in:
  Energy_eV[i] = a+b*(x[i]-x[0])+c*(x[i]-x[0])^2
  being i the index of the i-th point. (The substraction of x[0] is essential for TurboXAS experiments performed in ESRF/ID24 beamline).
- Input: Two files:
  1. A 2 column file with calibrated spectrum (reference file) Mu(Energy_in_eV).
  2. A 2 column file with spectrum to calibrate Mu(x).
- Output: The a,b,c coefficients (displayed in main window).
- Tricks:
  - Remember you always move the dashed (calibrated) plot, and the continous (reference) remains fixed.

## Follow the steps

1. From the main window (see Example window 1), Load two files, the first one with the reference spectrum and the second other with the spectrum to calibrate. As examples, use the files Ge_calib.chi and Ge_calib.chi, respectively. Once both spectra are loaded, an auxiliar XPLOT window (see Example window 2) appears. An estimated a value appears automatically.
2. Change b manually with the expansion compression value. In the example, I estimate that the dashed spectrum must compress at least 20 times to fit the solid one, so I put .05 in b and then I do not forget to press ENTER for refreshig the plot.
3. Change a manually to a better estimation. You can estimate the value that the edge of the dashed (calibrated) spectrum must move to align to the continuous (reference) spectrum by using the (x,y) cursor position in the XPLOT window. In the example, I estimate that it should be moved 200 units (11100-10900) to the right, so I changed a from 10800 (initial guess) to 11000. And then I do not forget to press ENTER for refreshig the plot.
4. Then I click on the a button, and fine tunning the a value using the "<<" and ">>" buttons. You may change the step of the movement.
5. Then I click on the b button, and do the fine tunning. I may neede iterating a and b tunning. It may also be necessary to use the non-linear term c.
6. Occasionaly, the heigth of the twe spectra is different avoiding a good overlapping. For that you can expand the Y axis using the value "Expansion ratio of Y axis". This helps in the fine tunning but does not affect the resulting coefficients.
7. A calibration (not exceptional) is shown in example window 3.

## Window example

Window 1: Main window after loading the two example files.

Window 2: XPlot auxiliar window after loading the two example files.
(click on the images for full resolution)

Window 3: XPlot auxiliar window with a result of calibration process.

## FAQs

- May I zoom the image and fix the limits to the zoomed area?
  Yes. Just select the wanted area to zoom, click the Zoom button and go to Edit->Limits->Set Limits as Selection Area. The next plots will be displayed in the selected area. To go back to the defaults, go to

[Back]