Temperature and high-pressure dependent x-ray absorption of SmNiO3 at the Ni K and Sm L3 edges