Put detector->reality index translations into common functions