scale_d16.pro fails when two scans do not overlap
Reported and solved by Stef. This is a case that was not foreseen, as the scaling routine assumed that there was always some overlap between the theta regions of two consecutive scans. Now when two consecutive scans do not overlap, the function will use the last and first 5 points of each scan to compute their medians and use those to calculate the scaling factor. This assumes that the intensity in two different theta regions should be the same, so it is not very safe, but the routine will print a warning and it is up to the user to check if the scaling is correct or not.