Minor refactoring
Minor refactoring

- Split off a "select" method so other functions can subselect with
indices without computing averages

kcompher/thunder,poolio/thunder,oliverhuangchao/thunder,pearsonlab/thunder,oliverhuangchao/thunder,mikarubi/thunder,broxtronix/thunder,pearsonlab/thunder,j-friedrich/thunder,zhwa/thunder,kunallillaney/thunder,broxtronix/thunder,jwittenbach/thunder,thunder-project/thunder,j-friedrich/thunder,mikarubi/thunder,zhwa/thunder,kunallillaney/thunder,poolio/thunder,kcompher/thunder