Difference between two sets of data points

454 Views Asked by At

I'm making a simple calibration of a z-stage, by measuring a number of points in one direction with a constant $\Delta$Z between each sample. Then I reverse the direction and measure the same number of points with the same $\Delta$Z. If the z-stage did not need any calibration, I should end up at the same point as I started, but I doesn't.

My data could look like this: enter image description here

Download the data points from here: XLSX OR CSV.

In the plot, I have reversed the first direction data points, in order to get the position where the two directions match the best in the beginning of the plot.

As we can see on the plot, the 2. direction is lacking behind in comparison with the 1. direction (this could be the other way around too).

So, my question is how I can find out how much I need the scale the z-positions of one of the directions, in order to get the two graphs to match as closely as possible. I do not need a single solution for the data I have provided, but rather pointers to how I can solve this kind of problem. I am not as good at math as I would like to be, so please bear with me.

enter image description here