Principal component analysis for soft x-ray spectromicroscopy