Localization for the Schrodinger equation in a locally periodic medium