Structural and magnetic properties of Er thin films and Er/Y superlattices: Magnetoelastic effects