Peak finding

Work on finding peaks in 1D curves to support automatic calibration.
Use D as distance, because d is used for d-spacing most of the time.