add: find closest index to average intensity