int magic_i = 6; /* pick one that looks pretty ;) */
real gain = 20; /* piezo volt per DAC volt */
real sens = 7.57; /* piezo sensitivity nm per piezo volt */
+Label[] labels = {
+ Label("a", align=E),
+ Label("b", align=E),
+ Label("c", align=SE),
+ Label("d", align=SE),
+ Label("e", align=SE),
+ Label("f", align=SE),
+ };
int j, k, start = -1;
for (i = magic_i; i < calibration.length; ++i) {
for (j = 0; j < calibration[i].piezo_approach.length; ++j) {
start = 0;
}
piezo_approach_t p0 = piezoApproach(calibration, i, start);
- for (k = start; k < start + 6; ++k) {
+ for (k = start; k < start + labels.length; ++k) {
if (k < calibration[i].piezo_approach.length) {
piezo_approach_t p = piezoApproach(calibration, i, k);
real[] x = piezo[p.start:p.stop] - piezo[p0.start];
x = x * gain * sens;
real[] y = deflection[p.start:p.stop] - deflection[p0.start];
graphData(x=x, y=y, mpath=mcross, dots=true);
+ label(labels[k - start], (x[x.length-1], y[y.length-1]));
}
}
break; /* done with this stepper approach */