Defining the new function getWeather in weather file