X-Axis Calibration Tool

Two new custom parameters have been added to the header: X gain and X offset. Since these are custom parameters, they are not displayed by default when you look at the header. To see them, right click in the header area and select X-Axis Gain and X-Axis Offset. By default, the gain value will be 1 and the offset will be 0, so that there is no change in the default X-axis. You can edit either of these parameters by clicking into the text field and changing the value. After you do this, you will see the X-axis change accordingly. The x-axis values are computed using (x - offset) * gain, so if you only have a single calibration point you can force it to fit using only the offset. If you have 2 points to fit, you can use both the gain and offset term.

Notice that the X Gain and X Offset labels in the header display are actually buttons. If you press either of these, the new Calibrate X-Axis widget will pop up. This lets you map any 2 points on the original x-axis to 2 new points on a scaled x-axis. Edgar will then calculate the required X Gain and X Offset, and apply this to the entire x-axis when you press the Apply button. For example, if you look at some spectra and decide that current x-axis value of 2000 cm-1 should really be 2005 cm-1, and 2025 cm-1 should be 2029 cm-1, you would enter 2000 and 2025 for the original X values, and 2005 and 2029 for the scaled X values. Edgar then automatically calculates the required x-axis gain (0.96) and offset (85). Also, the x-axis sample spacing for the new calculated gain is displayed. If you want to apply this mapping to your data, press Apply. If not, you can press Cancel and the x-axis will stay as is. By default, the two specified points are wavenumber for the first sample in the spectrum, and wavenumber for the last sample in the spectrum. However, in using the tool you can enter any two points anywhere in the spectrum.

The new parameters (x-axis gain and offset) are placed at the end of the header as single precision 32-bit floating point values. These are at the end of a 187-byte block marked Reserved in the official Grams/SPC spec. The X Gain is at offset 504 (bytes 504, 505, 506, & 507). The X Offset is at offset 508 (bytes 508, 509, 510, & 511, the last 4 bytes in the header).