Measuring urban energy sustainability and its application to two Spanish cities: Malaga and Barcelona