diff --git a/CHANGELOG.md b/CHANGELOG.md index e5e5b2059c..43bf272203 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -198,6 +198,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix test timeouts for all tests [#1222](https://github.com/ie3-institute/simona/issues/1222) - Fix handling of states in `ParticipantModelShell` [#1228](https://github.com/ie3-institute/simona/issues/1228) - Fix input data handling in `ParticipantModel` [#1237](https://github.com/ie3-institute/simona/issues/1237) +- Reduce log spamming during night time due to missing direct solar irradiance data [#984](https://github.com/ie3-institute/simona/issues/984) ### Removed - Removed `SimonaListerner` and related code [#1205](https://github.com/ie3-institute/simona/issues/1205) diff --git a/src/main/scala/edu/ie3/simona/service/weather/WeatherSourceWrapper.scala b/src/main/scala/edu/ie3/simona/service/weather/WeatherSourceWrapper.scala index 6ccc0942bd..a2750bbe0d 100644 --- a/src/main/scala/edu/ie3/simona/service/weather/WeatherSourceWrapper.scala +++ b/src/main/scala/edu/ie3/simona/service/weather/WeatherSourceWrapper.scala @@ -46,6 +46,9 @@ import edu.ie3.simona.util.TickUtil import edu.ie3.simona.util.TickUtil.TickLong import edu.ie3.util.DoubleUtils.ImplicitDouble import edu.ie3.util.interval.ClosedInterval +import edu.ie3.util.scala.quantities.WattsPerSquareMeter +import squants.motion.MetersPerSecond +import squants.thermal.Kelvin import tech.units.indriya.ComparableQuantity import java.nio.file.Paths @@ -141,11 +144,20 @@ private[weather] final case class WeatherSourceWrapper private ( (averagedWeather.diffIrr + nonEmptyDiffIrr * weight, weight) } - val (dirIrradience, dirIrrWeight) = currentWeather.dirIrr match { - case EMPTY_WEATHER_DATA.`dirIrr` => - logger.warn(s"Direct solar irradiance not available at $point.") + val (dirIrradiance, dirIrrWeight) = currentWeather match { + case WeatherData( + WattsPerSquareMeter(0d), + WattsPerSquareMeter(0d), + Kelvin(0d), + MetersPerSecond(0d), + ) => + logger.warn(s"Direct solar irradiance data is missing at $point.") (averagedWeather.dirIrr, 0d) - case nonEmptyDirIrr => + + case WeatherData(WattsPerSquareMeter(0d), _, _, _) => + (averagedWeather.dirIrr, weight) + + case WeatherData(nonEmptyDirIrr, _, _, _) => (averagedWeather.dirIrr + nonEmptyDirIrr * weight, weight) } @@ -166,7 +178,7 @@ private[weather] final case class WeatherSourceWrapper private ( } ( - WeatherData(diffIrradiance, dirIrradience, temperature, windVelocity), + WeatherData(diffIrradiance, dirIrradiance, temperature, windVelocity), currentWeightSum.add( diffIrrWeight, dirIrrWeight,