private TimeSeriesByLocation FilterSelectedCounties(TimeSeriesByLocation countryTimeSeriesByLocation, PredictionSettings settings) { var locations = countryTimeSeriesByLocation.LocationsWithDayData.Where(location => settings.Countries.Contains(location.Country)).ToList(); return(new TimeSeriesByLocation { LocationsWithDayData = locations }); }
private TimeSeriesByLocation GetGrowingCountriesTimeSeries(TimeSeriesByLocation countryTimeSeriesByLocation) { var locations = countryTimeSeriesByLocation.LocationsWithDayData.OrderByDescending(location => location.DayLocationData.Last().WeeklyNewCases - location.DayLocationData[location.DayLocationData.IndexOf(location.DayLocationData.Last()) - 30].WeeklyNewCases) .Take(5).ToList(); return(new TimeSeriesByLocation { LocationsWithDayData = locations }); }