Excitation mechanisms and localization sites of erbium-doped porous silicon