Understanding the effect of thionation on naphthalene diimide using first-principles predictions of near-edge x-ray absorption fine structure spectra.