auto-calculate wavelength border size (could still be improved)