Extracting energetic ion distributions from energetic neutral atom images of space plasmas