A method to identify shallow dopants in semiconductor nanowires