diff --git a/CHANGELOG.md b/CHANGELOG.md index 71ef88a3d..66c627c58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added getter sRated for SystemParticipant inputs and updated them in tests in src[#1412](https://github.com/ie3-institute/PowerSystemDataModel/issues/1412) - Added converters documentation [#1139](https://github.com/ie3-institute/PowerSystemDataModel/issues/1139) - Added abstraction for power value sources [#1438](https://github.com/ie3-institute/PowerSystemDataModel/issues/1438) +- Add ground temperatures level 1 and 2 as option to weather data. [#1343](https://github.com/ie3-institute/PowerSystemDataModel/issues/1343) ### Fixed - Fixed small issues in tests [#1400](https://github.com/ie3-institute/PowerSystemDataModel/issues/1400) diff --git a/docs/readthedocs/models/input/additionaldata/weathersource.md b/docs/readthedocs/models/input/additionaldata/weathersource.md index b06322076..a59e79c55 100644 --- a/docs/readthedocs/models/input/additionaldata/weathersource.md +++ b/docs/readthedocs/models/input/additionaldata/weathersource.md @@ -62,5 +62,14 @@ Weather data is comprised of five key components: * - **`windDirection`** - Wind direction, where 0° is North, 90° is East, etc. - ° (degrees) + + * - **`groundTemperatureLevel1`** + - Ground temperature at level 1 for this coordinate. + - K (Kelvin) + + * - **`groundTemperatureLevel2`** + - Ground temperature at level 2 for this coordinate. + - K (Kelvin) ``` -Weather data in COSMO and ICON formats is supported. Additional optional weather data can also be provided. \ No newline at end of file +Weather data in COSMO and ICON formats is supported. Additional optional weather data can also be provided. +The ground temperature measurements at level 1 and level 2 depth are used. Underground cables are typically laid at around 80 cm depth. \ No newline at end of file diff --git a/src/main/java/edu/ie3/datamodel/io/connectors/InfluxDbConnector.java b/src/main/java/edu/ie3/datamodel/io/connectors/InfluxDbConnector.java index f96fb621a..bf0228dd3 100644 --- a/src/main/java/edu/ie3/datamodel/io/connectors/InfluxDbConnector.java +++ b/src/main/java/edu/ie3/datamodel/io/connectors/InfluxDbConnector.java @@ -218,6 +218,9 @@ public static Map>> parseQueryResult( */ public static Map>> parseResult( QueryResult.Result result, String... measurementNames) { + if (result.getSeries() == null) { + return Collections.emptyMap(); + } Stream seriesStream = result.getSeries().stream(); if (measurementNames.length > 0) { seriesStream = diff --git a/src/main/java/edu/ie3/datamodel/io/factory/timeseries/CosmoTimeBasedWeatherValueFactory.java b/src/main/java/edu/ie3/datamodel/io/factory/timeseries/CosmoTimeBasedWeatherValueFactory.java index 09048fb89..e3003c7f3 100644 --- a/src/main/java/edu/ie3/datamodel/io/factory/timeseries/CosmoTimeBasedWeatherValueFactory.java +++ b/src/main/java/edu/ie3/datamodel/io/factory/timeseries/CosmoTimeBasedWeatherValueFactory.java @@ -13,8 +13,9 @@ import edu.ie3.util.quantities.interfaces.Irradiance; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; -import java.util.Collections; +import java.util.Arrays; import java.util.List; +import java.util.Optional; import java.util.Set; import javax.measure.quantity.Angle; import javax.measure.quantity.Speed; @@ -32,6 +33,8 @@ public class CosmoTimeBasedWeatherValueFactory extends TimeBasedWeatherValueFact private static final String TEMPERATURE = "temperature"; private static final String WIND_DIRECTION = "windDirection"; private static final String WIND_VELOCITY = "windVelocity"; + private static final String GROUND_TEMPERATURE_LEVEL_1 = "groundTemperatureLevel1"; + private static final String GROUND_TEMPERATURE_LEVEL_2 = "groundTemperatureLevel2"; public CosmoTimeBasedWeatherValueFactory(TimeUtil timeUtil) { super(timeUtil); @@ -55,7 +58,11 @@ protected List> getFields(Class entityClass) { TEMPERATURE, WIND_DIRECTION, WIND_VELOCITY); - return Collections.singletonList(minConstructorParams); + + Set withGroundTemp = + expandSet(minConstructorParams, GROUND_TEMPERATURE_LEVEL_1, GROUND_TEMPERATURE_LEVEL_2); + + return Arrays.asList(minConstructorParams, withGroundTemp); } @Override @@ -72,6 +79,10 @@ protected TimeBasedValue buildModel(TimeBasedWeatherValueData data data.getQuantity(WIND_DIRECTION, StandardUnits.WIND_DIRECTION); ComparableQuantity windVelocity = data.getQuantity(WIND_VELOCITY, StandardUnits.WIND_VELOCITY); + Optional> groundTempValOne = + data.getQuantityOptional(GROUND_TEMPERATURE_LEVEL_1, StandardUnits.TEMPERATURE); + Optional> groundTempValTwo = + data.getQuantityOptional(GROUND_TEMPERATURE_LEVEL_2, StandardUnits.TEMPERATURE); WeatherValue weatherValue = new WeatherValue( coordinate, @@ -79,7 +90,10 @@ protected TimeBasedValue buildModel(TimeBasedWeatherValueData data diffuseIrradiance, temperature, windDirection, - windVelocity); + windVelocity, + groundTempValOne, + groundTempValTwo); + return new TimeBasedValue<>(time, weatherValue); } } diff --git a/src/main/java/edu/ie3/datamodel/io/factory/timeseries/IconTimeBasedWeatherValueFactory.java b/src/main/java/edu/ie3/datamodel/io/factory/timeseries/IconTimeBasedWeatherValueFactory.java index 189e40c57..c73156ce2 100644 --- a/src/main/java/edu/ie3/datamodel/io/factory/timeseries/IconTimeBasedWeatherValueFactory.java +++ b/src/main/java/edu/ie3/datamodel/io/factory/timeseries/IconTimeBasedWeatherValueFactory.java @@ -33,6 +33,8 @@ public class IconTimeBasedWeatherValueFactory extends TimeBasedWeatherValueFacto private static final String TEMPERATURE = "t2m"; private static final String WIND_VELOCITY_U = "u131m"; private static final String WIND_VELOCITY_V = "v131m"; + private static final String GROUND_TEMPERATURE_LEVEL_1 = "tg1"; + private static final String GROUND_TEMPERATURE_LEVEL_2 = "tg2"; public IconTimeBasedWeatherValueFactory() { super(); @@ -53,7 +55,8 @@ protected List> getFields(Class entityClass) { "albrad", "asobs", "aswdifuS", - "tG", + "tg1", + "tg2", "u10m", "u20m", "u216m", @@ -88,6 +91,11 @@ protected TimeBasedValue buildModel(TimeBasedWeatherValueData data data.getQuantity(TEMPERATURE, Units.KELVIN).to(StandardUnits.TEMPERATURE); ComparableQuantity windDirection = getWindDirection(data); ComparableQuantity windVelocity = getWindVelocity(data); + Optional> groundTemperatureLevel1 = + data.getQuantityOptional(GROUND_TEMPERATURE_LEVEL_1, Units.KELVIN); + Optional> groundTemperatureLevl2 = + data.getQuantityOptional(GROUND_TEMPERATURE_LEVEL_2, Units.KELVIN); + WeatherValue weatherValue = new WeatherValue( coordinate, @@ -95,7 +103,9 @@ protected TimeBasedValue buildModel(TimeBasedWeatherValueData data diffuseIrradiance, temperature, windDirection, - windVelocity); + windVelocity, + groundTemperatureLevel1, + groundTemperatureLevl2); return new TimeBasedValue<>(time, weatherValue); } diff --git a/src/main/java/edu/ie3/datamodel/io/processor/timeseries/FieldSourceToMethod.java b/src/main/java/edu/ie3/datamodel/io/processor/timeseries/FieldSourceToMethod.java index ac2977d72..594832388 100644 --- a/src/main/java/edu/ie3/datamodel/io/processor/timeseries/FieldSourceToMethod.java +++ b/src/main/java/edu/ie3/datamodel/io/processor/timeseries/FieldSourceToMethod.java @@ -25,5 +25,7 @@ public enum FieldSource { WEATHER_IRRADIANCE, WEATHER_TEMPERATURE, WEATHER_WIND, + GROUND_TEMPERATURE_LEVEL_1, + GROUND_TEMPERATURE_LEVEL_2, } } diff --git a/src/main/java/edu/ie3/datamodel/io/processor/timeseries/TimeSeriesProcessor.java b/src/main/java/edu/ie3/datamodel/io/processor/timeseries/TimeSeriesProcessor.java index 430746a34..030253967 100644 --- a/src/main/java/edu/ie3/datamodel/io/processor/timeseries/TimeSeriesProcessor.java +++ b/src/main/java/edu/ie3/datamodel/io/processor/timeseries/TimeSeriesProcessor.java @@ -165,13 +165,31 @@ private SortedMap buildFieldToSource( if (valueClass.equals(WeatherValue.class)) { /* Treat the nested weather values specially. */ /* Flatten the nested structure of Weather value */ - mapFieldNameToGetter(valueClass, Arrays.asList("solarIrradiance", "temperature", "wind")) + mapFieldNameToGetter( + valueClass, + Arrays.asList( + "solarIrradiance", + "temperature", + "wind", + "groundTemperatureLevel1", + "groundTemperatureLevel2")) .forEach(addFunction.apply(VALUE)); mapFieldNameToGetter(SolarIrradianceValue.class) .forEach(addFunction.apply(WEATHER_IRRADIANCE)); mapFieldNameToGetter(TemperatureValue.class).forEach(addFunction.apply(WEATHER_TEMPERATURE)); mapFieldNameToGetter(WindValue.class).forEach(addFunction.apply(WEATHER_WIND)); + Map groundTempMap = mapFieldNameToGetter(GroundTemperatureValue.class); + groundTempMap.forEach( + (fieldName, getter) -> + addFunction + .apply(GROUND_TEMPERATURE_LEVEL_1) + .accept("groundTemperatureLevel1", getter)); + groundTempMap.forEach( + (fieldName, getter) -> + addFunction + .apply(GROUND_TEMPERATURE_LEVEL_2) + .accept("groundTemperatureLevel2", getter)); } else if (valueClass.equals(BdewLoadValues.class)) { @@ -272,6 +290,20 @@ private Map handleEntry(T timeSeries, E entry) throws EntityProc Map windFieldToMethod = extractFieldToMethod(WEATHER_WIND); valueResult.putAll(processObject(weatherValue.getWind(), windFieldToMethod)); + + Map groundTempOneFieldToMethod = + extractFieldToMethod(GROUND_TEMPERATURE_LEVEL_1); + Optional gtOneOpt = weatherValue.getGroundTemperatureLevel1(); + if (gtOneOpt.isPresent()) { + valueResult.putAll(processObject(gtOneOpt.get(), groundTempOneFieldToMethod)); + } + + Map groundTempTwoFieldToMethod = + extractFieldToMethod(GROUND_TEMPERATURE_LEVEL_2); + Optional gtTwoOpt = weatherValue.getGroundTemperatureLevel2(); + if (gtTwoOpt.isPresent()) { + valueResult.putAll(processObject(gtTwoOpt.get(), groundTempTwoFieldToMethod)); + } } /* Join all information and sort them */ diff --git a/src/main/java/edu/ie3/datamodel/models/value/GroundTemperatureValue.java b/src/main/java/edu/ie3/datamodel/models/value/GroundTemperatureValue.java new file mode 100644 index 000000000..021c79fd6 --- /dev/null +++ b/src/main/java/edu/ie3/datamodel/models/value/GroundTemperatureValue.java @@ -0,0 +1,30 @@ +/* + * © 2025. TU Dortmund University, + * Institute of Energy Systems, Energy Efficiency and Energy Economics, + * Research group Distribution grid planning and operation +*/ +package edu.ie3.datamodel.models.value; + +import javax.measure.quantity.Temperature; +import tech.units.indriya.ComparableQuantity; + +/** + * Describes a ground temperature value. This class extends {@link TemperatureValue} to represent + * temperature at a specific depth in the ground. + */ +public class GroundTemperatureValue extends TemperatureValue { + + /** + * Constructs a new GroundTemperatureValue. + * + * @param temperature The temperature quantity (typically in K) + */ + public GroundTemperatureValue(ComparableQuantity temperature) { + super(temperature); + } + + @Override + public String toString() { + return "GroundTemperatureValue{" + "temperature=" + getTemperature().orElse(null) + '}'; + } +} diff --git a/src/main/java/edu/ie3/datamodel/models/value/WeatherValue.java b/src/main/java/edu/ie3/datamodel/models/value/WeatherValue.java index e34bfcc63..582295469 100644 --- a/src/main/java/edu/ie3/datamodel/models/value/WeatherValue.java +++ b/src/main/java/edu/ie3/datamodel/models/value/WeatherValue.java @@ -7,6 +7,7 @@ import edu.ie3.util.quantities.interfaces.Irradiance; import java.util.Objects; +import java.util.Optional; import javax.measure.quantity.Angle; import javax.measure.quantity.Speed; import javax.measure.quantity.Temperature; @@ -27,24 +28,38 @@ public class WeatherValue implements Value { /** Wind values for this coordinate */ private final WindValue wind; + /** Ground temperature value for this coordinate */ + private final Optional groundTemperatureLevel1; + + /** Ground temperature value for this coordinate */ + private final Optional groundTemperatureLevel2; + /** * @param coordinate of this weather value set * @param solarIrradiance values for this coordinate * @param temperature values for this coordinate * @param wind values for this coordinate + * @param groundTemperatureValueOne values for this coordinate (can be null) + * @param groundTemperatureValueTwo values for this coordinate (can be null) */ public WeatherValue( Point coordinate, SolarIrradianceValue solarIrradiance, TemperatureValue temperature, - WindValue wind) { + WindValue wind, + Optional groundTemperatureValueOne, + Optional groundTemperatureValueTwo) { this.coordinate = coordinate; this.solarIrradiance = solarIrradiance; this.temperature = temperature; this.wind = wind; + this.groundTemperatureLevel1 = groundTemperatureValueOne; + this.groundTemperatureLevel2 = groundTemperatureValueTwo; } /** + * Constructor with all parameters as quantities. + * * @param coordinate of this weather value set * @param directSolarIrradiance Direct sun irradiance for this coordinate (typically in W/m²) * @param diffuseSolarIrradiance Diffuse sun irradiance for this coordinate (typically in W/m²) @@ -52,6 +67,8 @@ public WeatherValue( * @param direction Direction, the wind comes from as an angle from north increasing clockwise * (typically in rad) * @param velocity Wind velocity for this coordinate (typically in m/s) + * @param groundTempValOne Ground temperature for this coordinate (typically in K, can be null) + * @param groundTempValTwo Ground temperature for this coordinate (typically in K, can be null) */ public WeatherValue( Point coordinate, @@ -59,12 +76,18 @@ public WeatherValue( ComparableQuantity diffuseSolarIrradiance, ComparableQuantity temperature, ComparableQuantity direction, - ComparableQuantity velocity) { + ComparableQuantity velocity, + Optional> groundTempValOne, + Optional> groundTempValTwo) { this( coordinate, new SolarIrradianceValue(directSolarIrradiance, diffuseSolarIrradiance), new TemperatureValue(temperature), - new WindValue(direction, velocity)); + new WindValue(direction, velocity), + Optional.ofNullable(groundTempValOne) + .flatMap(optional -> optional.map(GroundTemperatureValue::new)), + Optional.ofNullable(groundTempValTwo) + .flatMap(optional -> optional.map(GroundTemperatureValue::new))); } public Point getCoordinate() { @@ -83,6 +106,14 @@ public WindValue getWind() { return wind; } + public Optional getGroundTemperatureLevel1() { + return groundTemperatureLevel1; + } + + public Optional getGroundTemperatureLevel2() { + return groundTemperatureLevel2; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -91,12 +122,20 @@ public boolean equals(Object o) { return coordinate.equals(that.coordinate) && solarIrradiance.equals(that.solarIrradiance) && temperature.equals(that.temperature) - && wind.equals(that.wind); + && wind.equals(that.wind) + && Objects.equals(groundTemperatureLevel1, that.groundTemperatureLevel1) + && Objects.equals(groundTemperatureLevel2, that.groundTemperatureLevel2); } @Override public int hashCode() { - return Objects.hash(coordinate, solarIrradiance, temperature, wind); + return Objects.hash( + coordinate, + solarIrradiance, + temperature, + wind, + groundTemperatureLevel1, + groundTemperatureLevel2); } @Override @@ -110,6 +149,10 @@ public String toString() { + temperature + ", wind=" + wind + + ", groundTemperatureLevel1=" + + groundTemperatureLevel1 + + ", groundTemperatureLevel2=" + + groundTemperatureLevel2 + '}'; } } diff --git a/src/test/groovy/edu/ie3/datamodel/io/factory/timeseries/CosmoTimeBasedWeatherValueFactoryTest.groovy b/src/test/groovy/edu/ie3/datamodel/io/factory/timeseries/CosmoTimeBasedWeatherValueFactoryTest.groovy index e85aebf3b..6e8fa2df3 100644 --- a/src/test/groovy/edu/ie3/datamodel/io/factory/timeseries/CosmoTimeBasedWeatherValueFactoryTest.groovy +++ b/src/test/groovy/edu/ie3/datamodel/io/factory/timeseries/CosmoTimeBasedWeatherValueFactoryTest.groovy @@ -28,7 +28,9 @@ class CosmoTimeBasedWeatherValueFactoryTest extends Specification { "directIrradiance" : "286.872985839844", "temperature" : "", "windDirection" : "0", - "windVelocity" : "1.66103506088257" + "windVelocity" : "1.66103506088257", + "groundTemperatureLevel1" : "", + "groundTemperatureLevel2" : "" ] def data = new TimeBasedWeatherValueData(parameter, coordinate) @@ -39,7 +41,9 @@ class CosmoTimeBasedWeatherValueFactoryTest extends Specification { Quantities.getQuantity(282.671997070312d, StandardUnits.SOLAR_IRRADIANCE), null, Quantities.getQuantity(0d, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(1.66103506088257d, StandardUnits.WIND_VELOCITY))) + Quantities.getQuantity(1.66103506088257d, StandardUnits.WIND_VELOCITY), + Optional.empty(), + Optional.empty())) when: def model = factory.buildModel(data) @@ -61,7 +65,9 @@ class CosmoTimeBasedWeatherValueFactoryTest extends Specification { "directIrradiance" : "286.872985839844", "temperature" : "278.019012451172", "windDirection" : "0", - "windVelocity" : "1.66103506088257" + "windVelocity" : "1.66103506088257", + "groundTemperatureLevel1" : "", + "groundTemperatureLevel2" : "" ] def data = new TimeBasedWeatherValueData(parameter, coordinate) @@ -72,7 +78,9 @@ class CosmoTimeBasedWeatherValueFactoryTest extends Specification { Quantities.getQuantity(282.671997070312d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE), Quantities.getQuantity(0d, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(1.66103506088257d, StandardUnits.WIND_VELOCITY))) + Quantities.getQuantity(1.66103506088257d, StandardUnits.WIND_VELOCITY), + Optional.of(Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE)), + Optional.of(Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE)))) when: def model = factory.buildModel(data) diff --git a/src/test/groovy/edu/ie3/datamodel/io/factory/timeseries/IconTimeBasedWeatherValueFactoryTest.groovy b/src/test/groovy/edu/ie3/datamodel/io/factory/timeseries/IconTimeBasedWeatherValueFactoryTest.groovy index cac18982c..30dd649ee 100644 --- a/src/test/groovy/edu/ie3/datamodel/io/factory/timeseries/IconTimeBasedWeatherValueFactoryTest.groovy +++ b/src/test/groovy/edu/ie3/datamodel/io/factory/timeseries/IconTimeBasedWeatherValueFactoryTest.groovy @@ -83,7 +83,8 @@ class IconTimeBasedWeatherValueFactoryTest extends Specification { "aswdifuS" : "0.5713421484374998", "aswdirS" : "2.317613203124999", "t2m" : "289.1179319051744", - "tg" : "288.4101691197649", + "tg1":"288.4101691197649", + "tg2":"288.4101691197649", "u10m" : "0.3021732864307963", "u131m" : "2.6058700426057797", "u20m" : "0.32384365019387784", @@ -125,6 +126,10 @@ class IconTimeBasedWeatherValueFactoryTest extends Specification { assert QuantityUtil.isEquivalentAbs(it.value.wind.direction.get(), Quantities.getQuantity(214.16711674907722, PowerSystemUnits.DEGREE_GEOM)) assert it.value.wind.velocity.present assert QuantityUtil.isEquivalentAbs(it.value.wind.velocity.get(), Quantities.getQuantity(4.640010877529081, PowerSystemUnits.METRE_PER_SECOND)) + assert it.value.groundTemperatureLevel1.present + assert QuantityUtil.isEquivalentAbs(it.value.groundTemperatureLevel1.get().temperature.get(), Quantities.getQuantity(15.2601691197649, Units.CELSIUS)) + assert it.value.groundTemperatureLevel2.present + assert QuantityUtil.isEquivalentAbs(it.value.groundTemperatureLevel2.get().temperature.get(), Quantities.getQuantity(15.2601691197649, Units.CELSIUS)) } } } diff --git a/src/test/groovy/edu/ie3/datamodel/io/source/csv/CsvWeatherSourceCosmoTest.groovy b/src/test/groovy/edu/ie3/datamodel/io/source/csv/CsvWeatherSourceCosmoTest.groovy index cc5e709f2..7f42e9205 100644 --- a/src/test/groovy/edu/ie3/datamodel/io/source/csv/CsvWeatherSourceCosmoTest.groovy +++ b/src/test/groovy/edu/ie3/datamodel/io/source/csv/CsvWeatherSourceCosmoTest.groovy @@ -12,6 +12,7 @@ import edu.ie3.datamodel.io.naming.FileNamingStrategy import edu.ie3.datamodel.io.source.IdCoordinateSource import edu.ie3.datamodel.models.timeseries.individual.IndividualTimeSeries import edu.ie3.datamodel.models.timeseries.individual.TimeBasedValue +import edu.ie3.datamodel.models.value.GroundTemperatureValue import edu.ie3.datamodel.models.value.SolarIrradianceValue import edu.ie3.datamodel.models.value.TemperatureValue import edu.ie3.datamodel.models.value.WeatherValue @@ -125,7 +126,9 @@ class CsvWeatherSourceCosmoTest extends Specification implements CsvTestDataMeta "diffuseIrradiance": "5.678", "temperature" : "9.1011", "windVelocity" : "12.1314", - "windDirection" : "15.1617" + "windDirection" : "15.1617", + "groundTemperaturLevel1": "8.0", + "groundTemperatureLevel2": "9.5" ] def expectedValue = new TimeBasedValue( TimeUtil.withDefaults.toZonedDateTime("2020-10-16T12:40:42Z"), @@ -140,9 +143,13 @@ class CsvWeatherSourceCosmoTest extends Specification implements CsvTestDataMeta ), new WindValue( Quantities.getQuantity(12.1314, WIND_DIRECTION), - Quantities.getQuantity(15.1617, WIND_VELOCITY) - ) - ) + Quantities.getQuantity(15.1617, WIND_VELOCITY)), + Optional.of(new GroundTemperatureValue( + Quantities.getQuantity(8.0, TEMPERATURE) + )), + Optional.of(new GroundTemperatureValue( + Quantities.getQuantity(9.5, TEMPERATURE) + ))) ) when: @@ -168,7 +175,9 @@ class CsvWeatherSourceCosmoTest extends Specification implements CsvTestDataMeta "diffuseirradiance": "5.678", "temperature" : "9.1011", "windvelocity" : "12.1314", - "winddirection" : "15.1617" + "winddirection" : "15.1617", + "groundTemperaturLevel1": "8.0", + "groundTemperatureLevel2": "9.5" ] when: @@ -192,7 +201,9 @@ class CsvWeatherSourceCosmoTest extends Specification implements CsvTestDataMeta "diffuseirradiance": "5.678", "temperature" : "9.1011", "windvelocity" : "12.1314", - "winddirection" : "15.1617" + "winddirection" : "15.1617", + "groundTemperaturLevel1": "8.0", + "groundTemperatureLevel2": "9.5" ] when: @@ -216,7 +227,9 @@ class CsvWeatherSourceCosmoTest extends Specification implements CsvTestDataMeta "diffuseirradiance": "5.678", "temperature" : "9.1011", "windvelocity" : "12.1314", - "winddirection" : "15.1617" + "winddirection" : "15.1617", + "groundTemperaturLevel1": "8.0", + "groundTemperatureLevel2": "9.5" ] when: diff --git a/src/test/groovy/edu/ie3/datamodel/utils/validation/UniquenessValidationUtilsTest.groovy b/src/test/groovy/edu/ie3/datamodel/utils/validation/UniquenessValidationUtilsTest.groovy index 92169b0bf..80b4be3db 100644 --- a/src/test/groovy/edu/ie3/datamodel/utils/validation/UniquenessValidationUtilsTest.groovy +++ b/src/test/groovy/edu/ie3/datamodel/utils/validation/UniquenessValidationUtilsTest.groovy @@ -21,6 +21,7 @@ import edu.ie3.datamodel.models.result.CongestionResult import edu.ie3.datamodel.models.result.NodeResult import edu.ie3.datamodel.models.result.ResultEntity import edu.ie3.datamodel.models.timeseries.individual.TimeBasedValue +import edu.ie3.datamodel.models.value.GroundTemperatureValue import edu.ie3.datamodel.models.value.SolarIrradianceValue import edu.ie3.datamodel.models.value.TemperatureValue import edu.ie3.datamodel.models.value.WeatherValue @@ -210,7 +211,9 @@ class UniquenessValidationUtilsTest extends Specification { GeoUtils.buildPoint(50d, 7d), new SolarIrradianceValue(Quantities.getQuantity(10d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(10d, StandardUnits.SOLAR_IRRADIANCE)), new TemperatureValue(Quantities.getQuantity(5d, Units.CELSIUS)), - new WindValue(Quantities.getQuantity(5d, DEGREE_GEOM), Quantities.getQuantity(10d, METRE_PER_SECOND)) + new WindValue(Quantities.getQuantity(5d, DEGREE_GEOM), Quantities.getQuantity(10d, METRE_PER_SECOND)), + Optional.of(new GroundTemperatureValue(Quantities.getQuantity(5d, Units.CELSIUS))), + Optional.of(new GroundTemperatureValue(Quantities.getQuantity(5d, Units.CELSIUS))) ) Set> uniqueValues = [ @@ -232,7 +235,9 @@ class UniquenessValidationUtilsTest extends Specification { GeoUtils.buildPoint(50d, 7d), new SolarIrradianceValue(Quantities.getQuantity(10d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(10d, StandardUnits.SOLAR_IRRADIANCE)), new TemperatureValue(Quantities.getQuantity(5d, Units.CELSIUS)), - new WindValue(Quantities.getQuantity(5d, DEGREE_GEOM), Quantities.getQuantity(10d, METRE_PER_SECOND)) + new WindValue(Quantities.getQuantity(5d, DEGREE_GEOM), Quantities.getQuantity(10d, METRE_PER_SECOND)), + Optional.of(new GroundTemperatureValue(Quantities.getQuantity(5d, Units.CELSIUS))), + Optional.of(new GroundTemperatureValue(Quantities.getQuantity(5d, Units.CELSIUS))) ) Set> notUniqueValues = [ new TimeBasedValue(time, value), diff --git a/src/test/groovy/edu/ie3/test/common/CosmoWeatherTestData.groovy b/src/test/groovy/edu/ie3/test/common/CosmoWeatherTestData.groovy index ac4412c8e..dc60a38cd 100644 --- a/src/test/groovy/edu/ie3/test/common/CosmoWeatherTestData.groovy +++ b/src/test/groovy/edu/ie3/test/common/CosmoWeatherTestData.groovy @@ -24,7 +24,9 @@ class CosmoWeatherTestData extends WeatherTestData { Quantities.getQuantity(286.872985839844d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE), Quantities.getQuantity(0d, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(1.66103506088257d, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(1.66103506088257d, StandardUnits.WIND_VELOCITY), + Optional.of(Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE)), + Optional.of(Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE)) ) public static final WeatherValue WEATHER_VALUE_193186_16H = new WeatherValue( @@ -33,7 +35,9 @@ class CosmoWeatherTestData extends WeatherTestData { Quantities.getQuantity(286.872d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(278.012d, StandardUnits.TEMPERATURE), Quantities.getQuantity(0d, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(1.662d, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(1.662d, StandardUnits.WIND_VELOCITY), + Optional.of(Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE)), + Optional.of(Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE)) ) public static final WeatherValue WEATHER_VALUE_193186_17H = new WeatherValue( @@ -42,7 +46,9 @@ class CosmoWeatherTestData extends WeatherTestData { Quantities.getQuantity(286.873d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(278.013d, StandardUnits.TEMPERATURE), Quantities.getQuantity(0d, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(1.663d, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(1.663d, StandardUnits.WIND_VELOCITY), + Optional.of(Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE)), + Optional.of(Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE)) ) public static final WeatherValue WEATHER_VALUE_193187_15H = new WeatherValue( @@ -51,7 +57,9 @@ class CosmoWeatherTestData extends WeatherTestData { Quantities.getQuantity(287.872985839844d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(279.019012451172d, StandardUnits.TEMPERATURE), Quantities.getQuantity(0d, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(1.76103506088257d, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(1.76103506088257d, StandardUnits.WIND_VELOCITY), + Optional.of(Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE)), + Optional.of(Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE)) ) public static final WeatherValue WEATHER_VALUE_193187_16H = new WeatherValue( @@ -60,7 +68,9 @@ class CosmoWeatherTestData extends WeatherTestData { Quantities.getQuantity(287.872d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(279.012d, StandardUnits.TEMPERATURE), Quantities.getQuantity(0d, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(1.762d, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(1.762d, StandardUnits.WIND_VELOCITY), + Optional.of(Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE)), + Optional.of(Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE)) ) public static final WeatherValue WEATHER_VALUE_193188_15H = new WeatherValue( @@ -69,6 +79,8 @@ class CosmoWeatherTestData extends WeatherTestData { Quantities.getQuantity(288.872985839844d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(280.019012451172d, StandardUnits.TEMPERATURE), Quantities.getQuantity(0d, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(1.86103506088257d, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(1.86103506088257d, StandardUnits.WIND_VELOCITY), + Optional.of(Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE)), + Optional.of(Quantities.getQuantity(278.019012451172d, StandardUnits.TEMPERATURE)) ) } diff --git a/src/test/groovy/edu/ie3/test/common/IconWeatherTestData.groovy b/src/test/groovy/edu/ie3/test/common/IconWeatherTestData.groovy index 0a251f9d3..4022311d5 100644 --- a/src/test/groovy/edu/ie3/test/common/IconWeatherTestData.groovy +++ b/src/test/groovy/edu/ie3/test/common/IconWeatherTestData.groovy @@ -24,7 +24,9 @@ class IconWeatherTestData extends WeatherTestData { Quantities.getQuantity(228.021339757131, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(24.4741992659816, StandardUnits.TEMPERATURE), Quantities.getQuantity(270.45278309919627, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(3.76601470961371, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(3.76601470961371, StandardUnits.WIND_VELOCITY), + Optional.of(Quantities.getQuantity(24.4741992659816, StandardUnits.TEMPERATURE)), + Optional.of(Quantities.getQuantity(24.4741992659816, StandardUnits.TEMPERATURE)) ) public static final WeatherValue WEATHER_VALUE_67775_16H = new WeatherValue( @@ -33,7 +35,9 @@ class IconWeatherTestData extends WeatherTestData { Quantities.getQuantity(200.46049098038043, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(24.1700023473353, StandardUnits.TEMPERATURE), Quantities.getQuantity(278.144331776102, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(4.05744164637287, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(4.05744164637287, StandardUnits.WIND_VELOCITY), + Optional.of(Quantities.getQuantity(24.4741992659816, StandardUnits.TEMPERATURE)), + Optional.of(Quantities.getQuantity(24.4741992659816, StandardUnits.TEMPERATURE)) ) public static final WeatherValue WEATHER_VALUE_67775_17H = new WeatherValue( @@ -42,7 +46,9 @@ class IconWeatherTestData extends WeatherTestData { Quantities.getQuantity(180.73429610400223, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(23.6787403584074, StandardUnits.TEMPERATURE), Quantities.getQuantity(286.891007103442, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(3.81526300455393, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(3.81526300455393, StandardUnits.WIND_VELOCITY), + Optional.of(Quantities.getQuantity(24.4741992659816, StandardUnits.TEMPERATURE)), + Optional.of(Quantities.getQuantity(24.4741992659816, StandardUnits.TEMPERATURE)) ) public static final WeatherValue WEATHER_VALUE_67776_15H = new WeatherValue( @@ -51,7 +57,9 @@ class IconWeatherTestData extends WeatherTestData { Quantities.getQuantity(245.24079037841295, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(22.365335568404, StandardUnits.TEMPERATURE), Quantities.getQuantity(245.604554131632, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(4.39390441381814, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(4.39390441381814, StandardUnits.WIND_VELOCITY), + Optional.of(Quantities.getQuantity(24.4741992659816, StandardUnits.TEMPERATURE)), + Optional.of(Quantities.getQuantity(24.4741992659816, StandardUnits.TEMPERATURE)) ) public static final WeatherValue WEATHER_VALUE_67776_16H = new WeatherValue( @@ -60,6 +68,8 @@ class IconWeatherTestData extends WeatherTestData { Quantities.getQuantity(241.641483540946, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(20.305111314491, StandardUnits.TEMPERATURE), Quantities.getQuantity(252.810224701109, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(3.44242472583919, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(3.44242472583919, StandardUnits.WIND_VELOCITY), + Optional.of(Quantities.getQuantity(24.4741992659816, StandardUnits.TEMPERATURE)), + Optional.of(Quantities.getQuantity(24.4741992659816, StandardUnits.TEMPERATURE)) ) } diff --git a/src/test/groovy/edu/ie3/test/common/TimeSeriesTestData.groovy b/src/test/groovy/edu/ie3/test/common/TimeSeriesTestData.groovy index eb25d08fa..7f95921f3 100644 --- a/src/test/groovy/edu/ie3/test/common/TimeSeriesTestData.groovy +++ b/src/test/groovy/edu/ie3/test/common/TimeSeriesTestData.groovy @@ -57,16 +57,16 @@ trait TimeSeriesTestData { Set> individualEnergyPriceTimeSeriesProcessed = [ [ - "time" : "2020-04-02T10:00:00Z", - "price" : "5.0" + "time" : "2020-04-02T10:00:00Z", + "price" : "5.0" ] as LinkedHashMap, [ - "time" : "2020-04-02T10:15:00Z", - "price" : "15.0" + "time" : "2020-04-02T10:15:00Z", + "price" : "15.0" ] as LinkedHashMap, [ - "time" : "2020-04-02T10:30:00Z", - "price" : "10.0" + "time" : "2020-04-02T10:30:00Z", + "price" : "10.0" ] as LinkedHashMap ] as Set @@ -96,16 +96,16 @@ trait TimeSeriesTestData { Set> individualTemperatureTimeSeriesProcessed = [ [ - "time" : "2020-04-02T10:00:00Z", - "temperature" : "5.0" + "time" : "2020-04-02T10:00:00Z", + "temperature" : "5.0" ] as LinkedHashMap, [ - "time" : "2020-04-02T10:15:00Z", - "temperature" : "15.0" + "time" : "2020-04-02T10:15:00Z", + "temperature" : "15.0" ] as LinkedHashMap, [ - "time" : "2020-04-02T10:30:00Z", - "temperature" : "10.0" + "time" : "2020-04-02T10:30:00Z", + "temperature" : "10.0" ] as LinkedHashMap ] as Set @@ -126,19 +126,19 @@ trait TimeSeriesTestData { Set> individualWindTimeSeriesProcessed = [ [ - "direction" : "5.0", - "time" : "2020-04-02T10:00:00Z", - "velocity" : "10.0" + "direction" : "5.0", + "time" : "2020-04-02T10:00:00Z", + "velocity" : "10.0" ] as LinkedHashMap, [ - "direction" : "15.0", - "time" : "2020-04-02T10:15:00Z", - "velocity" : "20.0" + "direction" : "15.0", + "time" : "2020-04-02T10:15:00Z", + "velocity" : "20.0" ] as LinkedHashMap, [ - "direction" : "10.0", - "time" : "2020-04-02T10:30:00Z", - "velocity" : "15.0" + "direction" : "10.0", + "time" : "2020-04-02T10:30:00Z", + "velocity" : "15.0" ] as LinkedHashMap ] as Set @@ -159,19 +159,19 @@ trait TimeSeriesTestData { Set> individualIrradianceTimeSeriesProcessed = [ [ - "directIrradiance" : "5.0", - "diffuseIrradiance" : "10.0", - "time" : "2020-04-02T10:00:00Z" + "directIrradiance" : "5.0", + "diffuseIrradiance" : "10.0", + "time" : "2020-04-02T10:00:00Z" ] as LinkedHashMap, [ - "directIrradiance" : "15.0", - "diffuseIrradiance" : "20.0", - "time" : "2020-04-02T10:15:00Z" + "directIrradiance" : "15.0", + "diffuseIrradiance" : "20.0", + "time" : "2020-04-02T10:15:00Z" ] as LinkedHashMap, [ - "directIrradiance" : "10.0", - "diffuseIrradiance" : "15.0", - "time" : "2020-04-02T10:30:00Z" + "directIrradiance" : "10.0", + "diffuseIrradiance" : "15.0", + "time" : "2020-04-02T10:30:00Z" ] as LinkedHashMap ] as Set @@ -184,7 +184,9 @@ trait TimeSeriesTestData { defaultLocation, new SolarIrradianceValue(Quantities.getQuantity(5d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(10d, StandardUnits.SOLAR_IRRADIANCE)), new TemperatureValue(Quantities.getQuantity(5d, CELSIUS)), - new WindValue(Quantities.getQuantity(5d, DEGREE_GEOM), Quantities.getQuantity(10d, METRE_PER_SECOND)) + new WindValue(Quantities.getQuantity(5d, DEGREE_GEOM), Quantities.getQuantity(10d, METRE_PER_SECOND)), + Optional.empty(), + Optional.empty(), ) ), new TimeBasedValue<>( @@ -193,7 +195,9 @@ trait TimeSeriesTestData { defaultLocation, new SolarIrradianceValue(Quantities.getQuantity(15d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(20d, StandardUnits.SOLAR_IRRADIANCE)), new TemperatureValue(Quantities.getQuantity(15d, CELSIUS)), - new WindValue(Quantities.getQuantity(15d, DEGREE_GEOM), Quantities.getQuantity(20d, METRE_PER_SECOND)) + new WindValue(Quantities.getQuantity(15d, DEGREE_GEOM), Quantities.getQuantity(20d, METRE_PER_SECOND)), + Optional.empty(), + Optional.empty() ) ), new TimeBasedValue<>( @@ -202,7 +206,9 @@ trait TimeSeriesTestData { defaultLocation, new SolarIrradianceValue(Quantities.getQuantity(10d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(15d, StandardUnits.SOLAR_IRRADIANCE)), new TemperatureValue(Quantities.getQuantity(10d, CELSIUS)), - new WindValue(Quantities.getQuantity(10d, DEGREE_GEOM), Quantities.getQuantity(15d, METRE_PER_SECOND)) + new WindValue(Quantities.getQuantity(10d, DEGREE_GEOM), Quantities.getQuantity(15d, METRE_PER_SECOND)), + Optional.of(new GroundTemperatureValue(Quantities.getQuantity(10d, CELSIUS))), + Optional.of(new GroundTemperatureValue(Quantities.getQuantity(10d, CELSIUS))) ) ), ] as Set @@ -210,31 +216,33 @@ trait TimeSeriesTestData { Set> individualWeatherTimeSeriesProcessed = [ [ - "coordinate" : "{\"type\":\"Point\",\"coordinates\":[7.412152,51.492758],\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}}}", - "diffuseIrradiance" : "10.0", - "directIrradiance" : "5.0", - "direction" : "5.0", - "temperature" : "5.0", - "time" : "2020-04-02T10:00:00Z", - "velocity" : "10.0" + "coordinate" : "{\"type\":\"Point\",\"coordinates\":[7.412152,51.492758],\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}}}", + "diffuseIrradiance" : "10.0", + "directIrradiance" : "5.0", + "direction" : "5.0", + "temperature" : "5.0", + "time" : "2020-04-02T10:00:00Z", + "velocity" : "10.0", ] as LinkedHashMap, [ - "coordinate" : "{\"type\":\"Point\",\"coordinates\":[7.412152,51.492758],\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}}}", - "diffuseIrradiance" : "20.0", - "directIrradiance" : "15.0", - "direction" : "15.0", - "temperature" : "15.0", - "time" : "2020-04-02T10:15:00Z", - "velocity" : "20.0" + "coordinate" : "{\"type\":\"Point\",\"coordinates\":[7.412152,51.492758],\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}}}", + "diffuseIrradiance" : "20.0", + "directIrradiance" : "15.0", + "direction" : "15.0", + "temperature" : "15.0", + "time" : "2020-04-02T10:15:00Z", + "velocity" : "20.0", ] as LinkedHashMap, [ - "coordinate" : "{\"type\":\"Point\",\"coordinates\":[7.412152,51.492758],\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}}}", - "diffuseIrradiance" : "15.0", - "directIrradiance" : "10.0", - "direction" : "10.0", - "temperature" : "10.0", - "time" : "2020-04-02T10:30:00Z", - "velocity" : "15.0" + "coordinate" : "{\"type\":\"Point\",\"coordinates\":[7.412152,51.492758],\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}}}", + "diffuseIrradiance" : "15.0", + "directIrradiance" : "10.0", + "direction" : "10.0", + "temperature" : "10.0", + "time" : "2020-04-02T10:30:00Z", + "velocity" : "15.0", + "groundTemperatureLevel1" : "10.0", + "groundTemperatureLevel2" : "10.0" ] as LinkedHashMap ] as Set @@ -255,16 +263,16 @@ trait TimeSeriesTestData { Set> individualHeatDemandTimeSeriesProcessed = [ [ - "heatDemand" : "5.0", - "time" : "2020-04-02T10:00:00Z" + "heatDemand" : "5.0", + "time" : "2020-04-02T10:00:00Z" ] as LinkedHashMap, [ - "heatDemand" : "15.0", - "time" : "2020-04-02T10:15:00Z" + "heatDemand" : "15.0", + "time" : "2020-04-02T10:15:00Z" ] as LinkedHashMap, [ - "heatDemand" : "10.0", - "time" : "2020-04-02T10:30:00Z" + "heatDemand" : "10.0", + "time" : "2020-04-02T10:30:00Z" ] as LinkedHashMap ] as Set @@ -285,16 +293,16 @@ trait TimeSeriesTestData { Set> individualPTimeSeriesProcessed = [ [ - "p" : "5.0", - "time" : "2020-04-02T10:00:00Z" + "p" : "5.0", + "time" : "2020-04-02T10:00:00Z" ] as LinkedHashMap, [ - "p" : "15.0", - "time" : "2020-04-02T10:15:00Z" + "p" : "15.0", + "time" : "2020-04-02T10:15:00Z" ] as LinkedHashMap, [ - "p" : "10.0", - "time" : "2020-04-02T10:30:00Z" + "p" : "10.0", + "time" : "2020-04-02T10:30:00Z" ] as LinkedHashMap ] as Set @@ -315,19 +323,19 @@ trait TimeSeriesTestData { Set> individualHeatAndPTimeSeriesProcessed = [ [ - "heatDemand" : "10.0", - "p" : "5.0", - "time" : "2020-04-02T10:00:00Z" + "heatDemand" : "10.0", + "p" : "5.0", + "time" : "2020-04-02T10:00:00Z" ] as LinkedHashMap, [ - "heatDemand" : "20.0", - "p" : "15.0", - "time" : "2020-04-02T10:15:00Z" + "heatDemand" : "20.0", + "p" : "15.0", + "time" : "2020-04-02T10:15:00Z" ] as LinkedHashMap, [ - "heatDemand" : "15.0", - "p" : "10.0", - "time" : "2020-04-02T10:30:00Z" + "heatDemand" : "15.0", + "p" : "10.0", + "time" : "2020-04-02T10:30:00Z" ] as LinkedHashMap ] as Set @@ -348,19 +356,19 @@ trait TimeSeriesTestData { Set> individualSTimeSeriesProcessed = [ [ - "p" : "5.0", - "q" : "10.0", - "time" : "2020-04-02T10:00:00Z" + "p" : "5.0", + "q" : "10.0", + "time" : "2020-04-02T10:00:00Z" ] as LinkedHashMap, [ - "p" : "15.0", - "q" : "20.0", - "time" : "2020-04-02T10:15:00Z" + "p" : "15.0", + "q" : "20.0", + "time" : "2020-04-02T10:15:00Z" ] as LinkedHashMap, [ - "p" : "10.0", - "q" : "15.0", - "time" : "2020-04-02T10:30:00Z" + "p" : "10.0", + "q" : "15.0", + "time" : "2020-04-02T10:30:00Z" ] as LinkedHashMap ] as Set @@ -381,22 +389,22 @@ trait TimeSeriesTestData { Set> individualHeatAndSTimeSeriesProcessed = [ [ - "heatDemand" : "15.0", - "p" : "5.0", - "q" : "10.0", - "time" : "2020-04-02T10:00:00Z" + "heatDemand" : "15.0", + "p" : "5.0", + "q" : "10.0", + "time" : "2020-04-02T10:00:00Z" ] as LinkedHashMap, [ - "heatDemand" : "25.0", - "p" : "15.0", - "q" : "20.0", - "time" : "2020-04-02T10:15:00Z" + "heatDemand" : "25.0", + "p" : "15.0", + "q" : "20.0", + "time" : "2020-04-02T10:15:00Z" ] as LinkedHashMap, [ - "heatDemand" : "20.0", - "p" : "10.0", - "q" : "15.0", - "time" : "2020-04-02T10:30:00Z" + "heatDemand" : "20.0", + "p" : "10.0", + "q" : "15.0", + "time" : "2020-04-02T10:30:00Z" ] as LinkedHashMap ] as Set diff --git a/src/test/groovy/edu/ie3/test/helper/WeatherSourceTestHelper.groovy b/src/test/groovy/edu/ie3/test/helper/WeatherSourceTestHelper.groovy index 6c4576d9e..2c7a8402b 100644 --- a/src/test/groovy/edu/ie3/test/helper/WeatherSourceTestHelper.groovy +++ b/src/test/groovy/edu/ie3/test/helper/WeatherSourceTestHelper.groovy @@ -12,13 +12,11 @@ import edu.ie3.util.quantities.QuantityUtil trait WeatherSourceTestHelper { - static boolean equalsIgnoreUUID(IndividualTimeSeries ts1, - IndividualTimeSeries ts2) { + static boolean equalsIgnoreUUID(IndividualTimeSeries ts1, IndividualTimeSeries ts2) { return equalsIgnoreUUID(ts1.entries, ts2.entries) } - static boolean equalsIgnoreUUID(Collection> c1, - Collection> c2) { + static boolean equalsIgnoreUUID(Collection> c1, Collection> c2) { if (c1 == null || c2 == null) return (c1 == null && c2 == null) if (c1.size() != c2.size()) return false for (TimeBasedValue value1 : c1) { @@ -39,4 +37,4 @@ trait WeatherSourceTestHelper { weatherValue1.wind.velocity.present == weatherValue2.wind.velocity.present && QuantityUtil.isEquivalentAbs(weatherValue1.wind.velocity.get(), weatherValue2.wind.velocity.get(), 1E-10) && weatherValue1.wind.direction.present == weatherValue2.wind.direction.present && QuantityUtil.isEquivalentAbs(weatherValue1.wind.direction.get(), weatherValue2.wind.direction.get(), 1E-10) } -} +} \ No newline at end of file diff --git a/src/test/resources/edu/ie3/datamodel/io/sink/_sql/time_series.sql b/src/test/resources/edu/ie3/datamodel/io/sink/_sql/time_series.sql index cdceb0e52..1f3ffd33e 100644 --- a/src/test/resources/edu/ie3/datamodel/io/sink/_sql/time_series.sql +++ b/src/test/resources/edu/ie3/datamodel/io/sink/_sql/time_series.sql @@ -99,6 +99,8 @@ CREATE TABLE public.time_series_weather direction DOUBLE PRECISION, temperature DOUBLE PRECISION, velocity DOUBLE PRECISION, + ground_temperature_level_1 DOUBLE PRECISION, + ground_temperature_level_2 DOUBLE PRECISION, grid_uuid UUID NOT NULL REFERENCES grids(uuid) ) WITHOUT OIDS @@ -106,4 +108,4 @@ CREATE TABLE public.time_series_weather CREATE INDEX time_series_weather_series_id ON time_series_weather USING hash (time_series); -CREATE UNIQUE INDEX time_series_weather_series_time ON time_series_weather USING btree (time_series, time); \ No newline at end of file +CREATE UNIQUE INDEX time_series_weather_series_time ON time_series_weather USING btree (time_series, time); diff --git a/src/test/resources/edu/ie3/datamodel/io/source/csv/_weather/cosmo/its_weather_8bc9120d-fb9b-4484-b4e3-0cdadf0feea9.csv b/src/test/resources/edu/ie3/datamodel/io/source/csv/_weather/cosmo/its_weather_8bc9120d-fb9b-4484-b4e3-0cdadf0feea9.csv index d73cac992..0d60c0480 100644 --- a/src/test/resources/edu/ie3/datamodel/io/source/csv/_weather/cosmo/its_weather_8bc9120d-fb9b-4484-b4e3-0cdadf0feea9.csv +++ b/src/test/resources/edu/ie3/datamodel/io/source/csv/_weather/cosmo/its_weather_8bc9120d-fb9b-4484-b4e3-0cdadf0feea9.csv @@ -1,7 +1,7 @@ -"uuid";"coordinate_id";"time";"diffuse_irradiance";"direct_irradiance";"temperature";"wind_direction";"wind_velocity" -"3cee46d5-1fe7-419e-a652-32f9be6703be";193186;2020-04-28T15:00:00Z;286.872985839844;282.671997070312;278.019012451172;0;1.66103506088257 -"1fbc6f7e-52fe-4668-93c8-33454d7feb6c";193187;2020-04-28T15:00:00Z;287.872985839844;283.671997070312;279.019012451172;0;1.76103506088257 -"78c7a057-ad6c-4ea1-bb74-7e28fbb08957";193188;2020-04-28T15:00:00Z;288.872985839844;284.671997070312;280.019012451172;0;1.86103506088257 -"b146fbff-ddd5-45b4-9d30-dd2a8550f7ba";193186;2020-04-28T16:00:00Z;286.872;282.672;278.012;0;1.662 -"7bdfb687-aa20-43af-8bbe-c23d9cc448ed";193187;2020-04-28T16:00:00Z;287.872;283.672;279.012;0;1.762 -"4d233e6a-9e01-4a46-bef6-88172ab366f4";193186;2020-04-28T17:00:00Z;286.873;282.673;278.013;0;1.663 \ No newline at end of file +"uuid";"coordinate_id";"time";"diffuse_irradiance";"direct_irradiance";"temperature";"wind_direction";"wind_velocity";"ground_temperature_level_1";"ground_temperature_level_2" +"3cee46d5-1fe7-419e-a652-32f9be6703be";193186;"2020-04-28T15:00:00Z";286.872985839844;282.671997070312;278.019012451172;0;1.66103506088257;279.5;281.0 +"1fbc6f7e-52fe-4668-93c8-33454d7feb6c";193187;"2020-04-28T15:00:00Z";287.872985839844;283.671997070312;279.019012451172;0;1.76103506088257;280.5;281.1 +"78c7a057-ad6c-4ea1-bb74-7e28fbb08957";193188;"2020-04-28T15:00:00Z";288.872985839844;284.671997070312;280.019012451172;0;1.86103506088257;281.5;281.2 +"b146fbff-ddd5-45b4-9d30-dd2a8550f7ba";193186;"2020-04-28T16:00:00Z";286.872;282.672;278.012;0;1.662;279.2;281.0 +"7bdfb687-aa20-43af-8bbe-c23d9cc448ed";193187;"2020-04-28T16:00:00Z";287.872;283.672;279.012;0;1.762;280.2;281.1 +"4d233e6a-9e01-4a46-bef6-88172ab366f4";193186;"2020-04-28T17:00:00Z";286.873;282.673;278.013;0;1.663;278.8;281.0 \ No newline at end of file diff --git a/src/test/resources/edu/ie3/datamodel/io/source/csv/_weather/icon/its_weather_513606bc-539e-445b-9675-2f98be3d9231.csv b/src/test/resources/edu/ie3/datamodel/io/source/csv/_weather/icon/its_weather_513606bc-539e-445b-9675-2f98be3d9231.csv index 7890a6d8a..f52024b2a 100644 --- a/src/test/resources/edu/ie3/datamodel/io/source/csv/_weather/icon/its_weather_513606bc-539e-445b-9675-2f98be3d9231.csv +++ b/src/test/resources/edu/ie3/datamodel/io/source/csv/_weather/icon/its_weather_513606bc-539e-445b-9675-2f98be3d9231.csv @@ -1,6 +1,6 @@ -"time","alb_rad","asob_s","aswdifd_s","aswdifu_s","aswdir_s","t_2m","t_g","u_10m","u_131m","u_20m","u_216m","u_65m","v_10m","v_131m","v_20m","v_216m","v_65m","w_131m","w_20m","w_216m","w_65m","z0","coordinate_id","p_131m","p_20m","p_65m","sobs_rad","t_131m" -2019-08-01T15:00:00Z,13.015240669,503.46974264373205,228.021339757131,80.8246124780934,356.2648859375,297.6241992659816,300.6632065668998,2.594603775363224,3.7658971156831287,2.5812495613105044,3.941521213236469,3.4740205817325034,-0.024078646721241395,-0.029760831916596106,-0.052967885304510534,-0.009698125518755707,-0.04996610799324721,0.004091443774095653,0.0015809058504647026,0.005954484657501378,0.002666343696204668,0.9553221665631989,67775,,,,, -2019-08-01T15:00:00Z,13.013334274000002,498.219742300774,245.24079037841295,80.0782271098217,333.0547140625,295.515335568404,297.43684351873816,2.6907481330116054,4.001601219938975,2.6888332994845783,4.140469437423411,3.714032263672762,1.2097386659833593,1.8148233176685413,1.1963736417917374,1.8944592514336933,1.667063608988315,-0.010735134459808796,-0.006350491263316599,-0.012234044440804974,-0.009044908476315713,0.955336762972383,67776,,,,, -2019-08-01T16:00:00Z,13.015240669,348.84439309613776,200.46049098038043,56.00436431107297,204.38963365625,297.3200023473353,298.8447737622156,2.557259341952788,4.0165196739267675,2.5543417132442308,4.204610497390883,3.6709121158156393,-0.38463576259530396,-0.5748064219197632,-0.4001297004267148,-0.574231301551345,-0.5484601012731134,0.008420781588303635,0.004028919955548831,0.0103738560877878,0.0064212084500956355,0.9553236526118866,67775,,,,, -2019-08-01T16:00:00Z,13.013334274000002,287.1635211775765,241.641483540946,46.18262289142059,91.70939132296976,293.455111314491,294.9876832274387,2.2429257128168105,3.288655459909278,2.2469304566362895,3.456196177795884,3.063505298416552,0.7052856075394569,1.0173658432825086,0.6940309956521304,1.0831645239762804,0.9402700184046242,-0.009609051331189665,-0.0037207462780739073,-0.01264290152206423,-0.006439463432156433,0.9553365723370035,67776,,,,, -2019-08-01T17:00:00Z,13.015240669,306.57139450950467,180.73429610400223,49.19860365549343,175.039569078125,296.8287403584074,297.6596017457568,2.2517126616190337,3.650669504895637,2.2438962003705027,3.7980736030429303,3.339152911211416,-0.6950893529619305,-1.1085323450143223,-0.7122478653505989,-1.1293057574368208,-1.0352309009257914,0.012464921655326946,0.0059655751175761145,0.015265360298047703,0.009632113129412919,0.9553227603369525,67775,,,,, +"time","alb_rad","asob_s","aswdifd_s","aswdifu_s","aswdir_s","t_2m","tg_1","tg_2","u_10m","u_131m","u_20m","u_216m","u_65m","v_10m","v_131m","v_20m","v_216m","v_65m","w_131m","w_20m","w_216m","w_65m","z0","coordinate_id","p_131m","p_20m","p_65m","sobs_rad","t_131m" +"2019-08-01T15:00:00Z",13.015240669,503.46974264373205,228.021339757131,80.8246124780934,356.2648859375,297.6241992659816,300.6632065668998,289.5,2.594603775363224,3.7658971156831287,2.5812495613105044,3.941521213236469,3.4740205817325034,-0.024078646721241395,-0.029760831916596106,-0.052967885304510534,-0.009698125518755707,-0.04996610799324721,0.004091443774095653,0.0015809058504647026,0.005954484657501378,0.002666343696204668,0.9553221665631989,67775,,,,, +"2019-08-01T15:00:00Z",13.013334274000002,498.219742300774,245.24079037841295,80.0782271098217,333.0547140625,295.515335568404,300.6632065668998,289.2,2.6907481330116054,4.001601219938975,2.6888332994845783,4.140469437423411,3.714032263672762,1.2097386659833593,1.8148233176685413,1.1963736417917374,1.8944592514336933,1.667063608988315,-0.010735134459808796,-0.006350491263316599,-0.012234044440804974,-0.009044908476315713,0.955336762972383,67776,,,,, +"2019-08-01T16:00:00Z",13.015240669,348.84439309613776,200.46049098038043,56.00436431107297,204.38963365625,297.3200023473353,300.6632065668998,289.5,2.557259341952788,4.0165196739267675,2.5543417132442308,4.204610497390883,3.6709121158156393,-0.38463576259530396,-0.5748064219197632,-0.4001297004267148,-0.574231301551345,-0.5484601012731134,0.008420781588303635,0.004028919955548831,0.0103738560877878,0.0064212084500956355,0.9553236526118866,67775,,,,, +"2019-08-01T16:00:00Z",13.013334274000002,287.1635211775765,241.641483540946,46.18262289142059,91.70939132296976,293.455111314491,300.6632065668998,289.2,2.2429257128168105,3.288655459909278,2.2469304566362895,3.456196177795884,3.063505298416552,0.7052856075394569,1.0173658432825086,0.6940309956521304,1.0831645239762804,0.9402700184046242,-0.009609051331189665,-0.0037207462780739073,-0.01264290152206423,-0.006439463432156433,0.9553365723370035,67776,,,,, +"2019-08-01T17:00:00Z",13.015240669,306.57139450950467,180.73429610400223,49.19860365549343,175.039569078125,296.8287403584074,300.6632065668998,289.5,2.2517126616190337,3.650669504895637,2.2438962003705027,3.7980736030429303,3.339152911211416,-0.6950893529619305,-1.1085323450143223,-0.7122478653505989,-1.1293057574368208,-1.0352309009257914,0.012464921655326946,0.0059655751175761145,0.015265360298047703,0.009632113129412919,0.9553227603369525,67775,,,,, \ No newline at end of file diff --git a/src/test/resources/edu/ie3/datamodel/io/source/influxdb/_weather/cosmo/weather.txt b/src/test/resources/edu/ie3/datamodel/io/source/influxdb/_weather/cosmo/weather.txt index 982e7ea5b..8d62e9867 100644 --- a/src/test/resources/edu/ie3/datamodel/io/source/influxdb/_weather/cosmo/weather.txt +++ b/src/test/resources/edu/ie3/datamodel/io/source/influxdb/_weather/cosmo/weather.txt @@ -5,9 +5,9 @@ CREATE DATABASE test_weather # CONTEXT-DATABASE: test_weather -weather,coordinate_id=193186 diffuse_irradiance=286.872985839844,direct_irradiance=282.671997070312,temperature=278.019012451172,wind_direction=0,wind_velocity=1.66103506088257 1588086000000 -weather,coordinate_id=193187 diffuse_irradiance=287.872985839844,direct_irradiance=283.671997070312,temperature=279.019012451172,wind_direction=0,wind_velocity=1.76103506088257 1588086000000 -weather,coordinate_id=193188 diffuse_irradiance=288.872985839844,direct_irradiance=284.671997070312,temperature=280.019012451172,wind_direction=0,wind_velocity=1.86103506088257 1588086000000 -weather,coordinate_id=193186 diffuse_irradiance=286.872,direct_irradiance=282.672,temperature=278.012,wind_direction=0,wind_velocity=1.662 1588089600000 -weather,coordinate_id=193187 diffuse_irradiance=287.872,direct_irradiance=283.672,temperature=279.012,wind_direction=0,wind_velocity=1.762 1588089600000 -weather,coordinate_id=193186 diffuse_irradiance=286.873,direct_irradiance=282.673,temperature=278.013,wind_direction=0,wind_velocity=1.663 1588093200000 +weather,coordinate_id=193186 diffuse_irradiance=286.872985839844,direct_irradiance=282.671997070312,temperature=278.019012451172,wind_direction=0,wind_velocity=1.66103506088257,ground_temperature_level_1=278.019012451172,ground_temperature_level_2=278.019012451172 1588086000000 +weather,coordinate_id=193187 diffuse_irradiance=287.872985839844,direct_irradiance=283.671997070312,temperature=279.019012451172,wind_direction=0,wind_velocity=1.76103506088257,ground_temperature_level_1=278.019012451172,ground_temperature_level_2=278.019012451172 1588086000000 +weather,coordinate_id=193188 diffuse_irradiance=288.872985839844,direct_irradiance=284.671997070312,temperature=280.019012451172,wind_direction=0,wind_velocity=1.86103506088257,ground_temperature_level_1=278.019012451172,ground_temperature_level_2=278.019012451172 1588086000000 +weather,coordinate_id=193186 diffuse_irradiance=286.872,direct_irradiance=282.672,temperature=278.012,wind_direction=0,wind_velocity=1.662,ground_temperature_level_1=278.019012451172,ground_temperature_level_2=278.019012451172 1588089600000 +weather,coordinate_id=193187 diffuse_irradiance=287.872,direct_irradiance=283.672,temperature=279.012,wind_direction=0,wind_velocity=1.762,ground_temperature_level_1=278.019012451172,ground_temperature_level_2=278.019012451172 1588089600000 +weather,coordinate_id=193186 diffuse_irradiance=286.873,direct_irradiance=282.673,temperature=278.013,wind_direction=0,wind_velocity=1.663,ground_temperature_level_1=278.019012451172,ground_temperature_level_2=278.019012451172 1588093200000 diff --git a/src/test/resources/edu/ie3/datamodel/io/source/influxdb/_weather/icon/weather.txt b/src/test/resources/edu/ie3/datamodel/io/source/influxdb/_weather/icon/weather.txt index 1057060a2..5addc4fd5 100644 --- a/src/test/resources/edu/ie3/datamodel/io/source/influxdb/_weather/icon/weather.txt +++ b/src/test/resources/edu/ie3/datamodel/io/source/influxdb/_weather/icon/weather.txt @@ -1,12 +1,10 @@ -# DDL -CREATE DATABASE test_weather - # DML # CONTEXT-DATABASE: test_weather -weather,coordinate_id=67775 alb_rad=13.0152406690000007,asob_s=503.46974264373199,aswdifd_s=228.021339757130988,aswdifu_s=80.8246124780933997,aswdir_s=356.264885937500026,t_2m=297.624199265981986,t_g=300.663206566899987,u_10m=2.59460377536322007,u_131m=3.76589711568313001,u_20m=2.58124956131049998,u_216m=3.94152121323647009,u_65m=3.47402058173249983,v_10m=-0.0240786467212413986,v_131m=-0.0297608319165960991,v_20m=-0.0529678853045104994,v_216m=-0.00969812551875571041,v_65m=-0.0499661079932472024,w_131m=0.00409144377409564972,w_20m=0.00158090585046470004,w_216m=0.00595448465750138007,w_65m=0.00266634369620467014,z_0=0.955322166563199016,p_131m=42.0,p_20m=42.0,p_65m=42.0,sobsrad=42.0,t_131m=42.0 1564671600000 -weather,coordinate_id=67775 alb_rad=13.0152406690000007,asob_s=348.844393096137992,aswdifd_s=200.460490980380001,aswdifu_s=56.0043643110729974,aswdir_s=204.389633656249998,t_2m=297.320002347334992,t_g=298.844773762215993,u_10m=2.55725934195278981,u_131m=4.01651967392677012,u_20m=2.55434171324422987,u_216m=4.20461049739088022,u_65m=3.67091211581564014,v_10m=-0.38463576259530402,v_131m=-0.574806421919763055,v_20m=-0.400129700426714974,v_216m=-0.574231301551345052,v_65m=-0.548460101273112954,w_131m=0.00842078158830364062,w_20m=0.0040289199555488299,w_216m=0.0103738560877878003,w_65m=0.00642120845009563988,z_0=0.955323652611887009,p_131m=42.0,p_20m=42.0,p_65m=42.0,sobsrad=42.0,t_131m=42.0 1564675200000 -weather,coordinate_id=67775 alb_rad=13.0152406690000007,asob_s=306.571394509505012,aswdifd_s=180.734296104001999,aswdifu_s=49.1986036554934003,aswdir_s=175.039569078124998,t_2m=296.828740358407003,t_g=297.659601745757016,u_10m=2.25171266161903016,u_131m=3.65066950489564013,u_20m=2.24389620037050008,u_216m=3.79807360304292985,u_65m=3.33915291121141999,v_10m=-0.695089352961929974,v_131m=-1.10853234501432008,v_20m=-0.71224786535059903,v_216m=-1.12930575743681993,v_65m=-1.03523090092579007,w_131m=0.0124649216553269007,w_20m=0.00596557511757611018,w_216m=0.0152653602980476998,w_65m=0.00963211312941292079,z_0=0.955322760336951959,p_131m=42.0,p_20m=42.0,p_65m=42.0,sobsrad=42.0,t_131m=42.0 1564678800000 -weather,coordinate_id=67776 alb_rad=13.013334274,asob_s=498.219742300773987,aswdifd_s=245.24079037841301,aswdifu_s=80.0782271098216967,aswdir_s=333.054714062500011,t_2m=295.515335568403998,t_g=297.436843518737987,u_10m=2.69074813301160987,u_131m=4.00160121993897988,u_20m=2.68883329948458005,u_216m=4.14046943742340989,u_65m=3.71403226367276007,v_10m=1.20973866598336,v_131m=1.81482331766853999,v_20m=1.19637364179174011,v_216m=1.89445925143368998,v_65m=1.66706360898831996,w_131m=-0.0107351344598088008,w_20m=-0.00635049126331660007,w_216m=-0.0122340444408049996,w_65m=-0.00904490847631570991,z_0=0.955336762972383013,p_131m=42.0,p_20m=42.0,p_65m=42.0,sobsrad=42.0,t_131m=42.0 1564671600000 -weather,coordinate_id=67776 alb_rad=13.013334274,asob_s=287.163521177577024,aswdifd_s=241.641483540946012,aswdifu_s=46.1826228914205998,aswdir_s=91.7093913229697932,t_2m=293.455111314490978,t_g=294.987683227438993,u_10m=2.24292571281681008,u_131m=3.28865545990927988,u_20m=2.24693045663628999,u_216m=3.45619617779588006,u_65m=3.06350529841654984,v_10m=0.705285607539457016,v_131m=1.0173658432825099,v_20m=0.694030995652130001,v_216m=1.08316452397627994,v_65m=0.940270018404623986,w_131m=-0.00960905133118966984,w_20m=-0.00372074627807390985,w_216m=-0.0126429015220642007,w_65m=-0.00643946343215642987,z_0=0.955336572337003975,p_131m=42.0,p_20m=42.0,p_65m=42.0,sobsrad=42.0,t_131m=42.0 1564675200000 +weather,coordinate_id=67775 alb_rad=13.0152406690000007,asob_s=503.46974264373199,aswdifd_s=228.021339757130988,aswdifu_s=80.8246124780933997,aswdir_s=356.264885937500026,t_2m=297.624199265981986,tg_1=297.624199265981986,tg_2=297.624199265981986,u_10m=2.59460377536322007,u_131m=3.76589711568313001,u_20m=2.58124956131049998,u_216m=3.94152121323647009,u_65m=3.47402058173249983,v_10m=-0.0240786467212413986,v_131m=-0.0297608319165960991,v_20m=-0.0529678853045104994,v_216m=-0.00969812551875571041,v_65m=-0.0499661079932472024,w_131m=0.00409144377409564972,w_20m=0.00158090585046470004,w_216m=0.00595448465750138007,w_65m=0.00266634369620467014,z_0=0.955322166563199016,p_131m=42.0,p_20m=42.0,p_65m=42.0,sobsrad=42.0,t_131m=42.0 1564671600000 +weather,coordinate_id=67775 alb_rad=13.0152406690000007,asob_s=348.844393096137992,aswdifd_s=200.460490980380001,aswdifu_s=56.0043643110729974,aswdir_s=204.389633656249998,t_2m=297.320002347334992,tg_1=297.624199265981986,tg_2=297.624199265981986,u_10m=2.55725934195278981,u_131m=4.01651967392677012,u_20m=2.55434171324422987,u_216m=4.20461049739088022,u_65m=3.67091211581564014,v_10m=-0.38463576259530402,v_131m=-0.574806421919763055,v_20m=-0.400129700426714974,v_216m=-0.574231301551345052,v_65m=-0.548460101273112954,w_131m=0.00842078158830364062,w_20m=0.0040289199555488299,w_216m=0.0103738560877878003,w_65m=0.00642120845009563988,z_0=0.955323652611887009,p_131m=42.0,p_20m=42.0,p_65m=42.0,sobsrad=42.0,t_131m=42.0 1564675200000 +weather,coordinate_id=67775 alb_rad=13.0152406690000007,asob_s=306.571394509505012,aswdifd_s=180.734296104001999,aswdifu_s=49.1986036554934003,aswdir_s=175.039569078124998,t_2m=296.828740358407003,tg_1=297.624199265981986,tg_2=297.624199265981986,u_10m=2.25171266161903016,u_131m=3.65066950489564013,u_20m=2.24389620037050008,u_216m=3.79807360304292985,u_65m=3.33915291121141999,v_10m=-0.695089352961929974,v_131m=-1.10853234501432008,v_20m=-0.71224786535059903,v_216m=-1.12930575743681993,v_65m=-1.03523090092579007,w_131m=0.0124649216553269007,w_20m=0.00596557511757611018,w_216m=0.0152653602980476998,w_65m=0.00963211312941292079,z_0=0.955322760336951959,p_131m=42.0,p_20m=42.0,p_65m=42.0,sobsrad=42.0,t_131m=42.0 1564678800000 +weather,coordinate_id=67776 alb_rad=13.013334274,asob_s=498.219742300773987,aswdifd_s=245.24079037841301,aswdifu_s=80.0782271098216967,aswdir_s=333.054714062500011,t_2m=295.515335568403998,tg_1=297.624199265981986,tg_2=297.624199265981986,u_10m=2.69074813301160987,u_131m=4.00160121993897988,u_20m=2.68883329948458005,u_216m=4.14046943742340989,u_65m=3.71403226367276007,v_10m=1.20973866598336,v_131m=1.81482331766853999,v_20m=1.19637364179174011,v_216m=1.89445925143368998,v_65m=1.66706360898831996,w_131m=-0.0107351344598088008,w_20m=-0.00635049126331660007,w_216m=-0.0122340444408049996,w_65m=-0.00904490847631570991,z_0=0.955336762972383013,p_131m=42.0,p_20m=42.0,p_65m=42.0,sobsrad=42.0,t_131m=42.0 1564671600000 +weather,coordinate_id=67776 alb_rad=13.013334274,asob_s=287.163521177577024,aswdifd_s=241.641483540946012,aswdifu_s=46.1826228914205998,aswdir_s=91.7093913229697932,t_2m=293.455111314490978,tg_1=297.624199265981986,tg_2=297.624199265981986,u_10m=2.24292571281681008,u_131m=3.28865545990927988,u_20m=2.24693045663628999,u_216m=3.45619617779588006,u_65m=3.06350529841654984,v_10m=0.705285607539457016,v_131m=1.0173658432825099,v_20m=0.694030995652130001,v_216m=1.08316452397627994,v_65m=0.940270018404623986,w_131m=-0.00960905133118966984,w_20m=-0.00372074627807390985,w_216m=-0.0126429015220642007,w_65m=-0.00643946343215642987,z_0=0.955336572337003975,p_131m=42.0,p_20m=42.0,p_65m=42.0,sobsrad=42.0,t_131m=42.0 1564675200000 +weather,coordinate_id=67776 alb_rad=13.013334274,asob_s=306.571394509505012,aswdifd_s=180.734296104001999,aswdifu_s=49.1986036554934003,aswdir_s=175.039569078124998,t_2m=296.828740358407003,tg_1=297.624199265981986,tg_2=297.624199265981986,u_10m=2.25171266161903016,u_131m=3.65066950489564013,u_20m=2.24389620037050008,u_216m=3.79807360304292985,u_65m=3.33915291121141999,v_10m=-0.695089352961929974,v_131m=-1.10853234501432008,v_20m=-0.71224786535059903,v_216m=-1.12930575743681993,v_65m=-1.03523090092579007,w_131m=0.0124649216553269007,w_20m=0.00596557511757611018,w_216m=0.0152653602980476998,w_65m=0.00963211312941292079,z_0=0.955322760336951959,p_131m=42.0,p_20m=42.0,p_65m=42.0,sobsrad=42.0,t_131m=42.0 1564678800000 \ No newline at end of file diff --git a/src/test/resources/edu/ie3/datamodel/io/source/sql/_weather/cosmo/weather.sql b/src/test/resources/edu/ie3/datamodel/io/source/sql/_weather/cosmo/weather.sql index 055698ba1..6907bdf46 100644 --- a/src/test/resources/edu/ie3/datamodel/io/source/sql/_weather/cosmo/weather.sql +++ b/src/test/resources/edu/ie3/datamodel/io/source/sql/_weather/cosmo/weather.sql @@ -8,6 +8,8 @@ CREATE TABLE public.weather wind_velocity double precision, temperature double precision, tid serial, + ground_temperature_level_1 double precision, + ground_temperature_level_2 double precision, CONSTRAINT weather_pkey PRIMARY KEY (tid), CONSTRAINT "weather_datum_coordinate_id_unique" UNIQUE (time, coordinate_id) ) @@ -27,11 +29,11 @@ CREATE INDEX weather_coordinate_id_time_idx TABLESPACE pg_default; INSERT INTO - public.weather (time, coordinate_id, diffuse_irradiance, direct_irradiance, wind_direction, wind_velocity, temperature) + public.weather (time, coordinate_id, diffuse_irradiance, direct_irradiance, wind_direction, wind_velocity, temperature, ground_temperature_level_1, ground_temperature_level_2) VALUES -('2020-04-28 15:00:00+0', 193186, 286.872985839844, 282.671997070312, 0, 1.66103506088257, 278.019012451172), -('2020-04-28 15:00:00+0', 193187, 287.872985839844, 283.671997070312, 0, 1.76103506088257, 279.019012451172), -('2020-04-28 15:00:00+0', 193188, 288.872985839844, 284.671997070312, 0, 1.86103506088257, 280.019012451172), -('2020-04-28 16:00:00+0', 193186, 286.872, 282.672, 0, 1.662, 278.012), -('2020-04-28 16:00:00+0', 193187, 287.872, 283.672, 0, 1.762, 279.012), -('2020-04-28 17:00:00+0', 193186, 286.873, 282.673, 0, 1.663, 278.013); +('2020-04-28 15:00:00+0', 193186, 286.872985839844, 282.671997070312, 0, 1.66103506088257, 278.019012451172, 278.019012451172, 278.019012451172), +('2020-04-28 15:00:00+0', 193187, 287.872985839844, 283.671997070312, 0, 1.76103506088257, 279.019012451172, 278.019012451172, 278.019012451172), +('2020-04-28 15:00:00+0', 193188, 288.872985839844, 284.671997070312, 0, 1.86103506088257, 280.019012451172, 278.019012451172, 278.019012451172), +('2020-04-28 16:00:00+0', 193186, 286.872, 282.672, 0, 1.662, 278.012, 278.019012451172, 278.019012451172), +('2020-04-28 16:00:00+0', 193187, 287.872, 283.672, 0, 1.762, 279.012, 278.019012451172, 278.019012451172), +('2020-04-28 17:00:00+0', 193186, 286.873, 282.673, 0, 1.663, 278.013, 278.019012451172, 278.019012451172); diff --git a/src/test/resources/edu/ie3/datamodel/io/source/sql/_weather/icon/weather.sql b/src/test/resources/edu/ie3/datamodel/io/source/sql/_weather/icon/weather.sql index e88d77c0f..87c821e6e 100644 --- a/src/test/resources/edu/ie3/datamodel/io/source/sql/_weather/icon/weather.sql +++ b/src/test/resources/edu/ie3/datamodel/io/source/sql/_weather/icon/weather.sql @@ -7,7 +7,8 @@ CREATE TABLE public.weather aswdifu_s double precision, aswdir_s double precision, t_2m double precision, - t_g double precision, + tg_1 double precision, + tg_2 double precision, u_10m double precision, u_131m double precision, u_20m double precision, @@ -37,6 +38,7 @@ CREATE TABLE public.weather ) TABLESPACE pg_default; +/* Erstellt die Indizes */ CREATE INDEX weather_coordinate_idx ON public.weather USING btree (coordinate_id ASC NULLS LAST) @@ -48,10 +50,10 @@ CREATE INDEX weather_coordinate_time_idx TABLESPACE pg_default; INSERT INTO - public.weather (time, alb_rad, asob_s, aswdifd_s, aswdifu_s, aswdir_s, t_2m, t_g, u_10m, u_131m, u_20m, u_216m, u_65m, v_10m, v_131m, v_20m, v_216m, v_65m, w_131m, w_20m, w_216m, w_65m, z0, coordinate_id, p_131m, p_20m, p_65m, sobs_rad, t_131m) + public.weather (time, alb_rad, asob_s, aswdifd_s, aswdifu_s, aswdir_s, t_2m, tg_1, tg_2, u_10m, u_131m, u_20m, u_216m, u_65m, v_10m, v_131m, v_20m, v_216m, v_65m, w_131m, w_20m, w_216m, w_65m, z0, coordinate_id, p_131m, p_20m, p_65m, sobs_rad, t_131m) VALUES -('2019-08-01 15:00:00+0', 13.015240669, 503.469742643732, 228.021339757131, 80.8246124780934, 356.2648859375, 297.624199265982, 300.6632065669, 2.59460377536322, 3.76589711568313, 2.5812495613105, 3.94152121323647, 3.4740205817325, -0.0240786467212414, -0.0297608319165961, -0.0529678853045105, -0.00969812551875571, -0.0499661079932472, 0.00409144377409565, 0.0015809058504647, 0.00595448465750138, 0.00266634369620467, 0.955322166563199, 67775, NULL, NULL, NULL, NULL, NULL), -('2019-08-01 16:00:00+0', 13.015240669, 348.844393096138, 200.46049098038, 56.004364311073, 204.38963365625, 297.320002347335, 298.844773762216, 2.55725934195279, 4.01651967392677, 2.55434171324423, 4.20461049739088, 3.67091211581564, -0.384635762595304, -0.574806421919763, -0.400129700426715, -0.574231301551345, -0.548460101273113, 0.00842078158830364, 0.00402891995554883, 0.0103738560877878, 0.00642120845009564, 0.955323652611887, 67775, NULL, NULL, NULL, NULL, NULL), -('2019-08-01 17:00:00+0', 13.015240669, 306.571394509505, 180.734296104002, 49.1986036554934, 175.039569078125, 296.828740358407, 297.659601745757, 2.25171266161903, 3.65066950489564, 2.2438962003705, 3.79807360304293, 3.33915291121142, -0.69508935296193, -1.10853234501432, -0.712247865350599, -1.12930575743682, -1.03523090092579, 0.0124649216553269, 0.00596557511757611, 0.0152653602980477, 0.00963211312941292, 0.955322760336952, 67775, NULL, NULL, NULL, NULL, NULL), -('2019-08-01 15:00:00+0', 13.013334274, 498.219742300774, 245.240790378413, 80.0782271098217, 333.0547140625, 295.515335568404, 297.436843518738, 2.69074813301161, 4.00160121993898, 2.68883329948458, 4.14046943742341, 3.71403226367276, 1.20973866598336, 1.81482331766854, 1.19637364179174, 1.89445925143369, 1.66706360898832, -0.0107351344598088, -0.0063504912633166, -0.012234044440805, -0.00904490847631571, 0.955336762972383, 67776, NULL, NULL, NULL, NULL, NULL), -('2019-08-01 16:00:00+0', 13.013334274, 287.163521177577, 241.641483540946, 46.1826228914206, 91.7093913229698, 293.455111314491, 294.987683227439, 2.24292571281681, 3.28865545990928, 2.24693045663629, 3.45619617779588, 3.06350529841655, 0.705285607539457, 1.01736584328251, 0.69403099565213, 1.08316452397628, 0.940270018404624, -0.00960905133118967, -0.00372074627807391, -0.0126429015220642, -0.00643946343215643, 0.955336572337004, 67776, NULL, NULL, NULL, NULL, NULL); +('2019-08-01 15:00:00+0', 13.015240669, 503.469742643732, 228.021339757131, 80.8246124780934, 356.2648859375, 297.624199265982, 278.019012451172, 278.019012451172, 2.59460377536322, 3.76589711568313, 2.5812495613105, 3.94152121323647, 3.4740205817325, -0.0240786467212414, -0.0297608319165961, -0.0529678853045105, -0.00969812551875571, -0.0499661079932472, 0.00409144377409565, 0.0015809058504647, 0.00595448465750138, 0.00266634369620467, 0.955322166563199, 67775, NULL, NULL, NULL, NULL, NULL), +('2019-08-01 16:00:00+0', 13.015240669, 348.844393096138, 200.46049098038, 56.004364311073, 204.38963365625, 297.320002347335, 278.019012451172, 278.019012451172, 2.55725934195279, 4.01651967392677, 2.55434171324423, 4.20461049739088, 3.67091211581564, -0.384635762595304, -0.574806421919763, -0.400129700426715, -0.574231301551345, -0.548460101273113, 0.00842078158830364, 0.00402891995554883, 0.0103738560877878, 0.00642120845009564, 0.955323652611887, 67775, NULL, NULL, NULL, NULL, NULL), +('2019-08-01 17:00:00+0', 13.015240669, 306.571394509505, 180.734296104002, 49.1986036554934, 175.039569078125, 296.828740358407, 278.019012451172, 278.019012451172, 2.25171266161903, 3.65066950489564, 2.2438962003705, 3.79807360304293, 3.33915291121142, -0.69508935296193, -1.10853234501432, -0.712247865350599, -1.12930575743682, -1.03523090092579, 0.0124649216553269, 0.00596557511757611, 0.0152653602980477, 0.00963211312941292, 0.955322760336952, 67775, NULL, NULL, NULL, NULL, NULL), +('2019-08-01 15:00:00+0', 13.013334274, 498.219742300774, 245.240790378413, 80.0782271098217, 333.0547140625, 295.515335568404, 278.019012451172, 278.019012451172, 2.69074813301161, 4.00160121993898, 2.68883329948458, 4.14046943742341, 3.71403226367276, 1.20973866598336, 1.81482331766854, 1.19637364179174, 1.89445925143369, 1.66706360898832, -0.0107351344598088, -0.0063504912633166, -0.012234044440805, -0.00904490847631571, 0.955336762972383, 67776, NULL, NULL, NULL, NULL, NULL), +('2019-08-01 16:00:00+0', 13.013334274, 287.163521177577, 241.641483540946, 46.1826228914206, 91.7093913229698, 293.455111314491, 278.019012451172, 278.019012451172, 2.24292571281681, 3.28865545990928, 2.24693045663629, 3.45619617779588, 3.06350529841655, 0.705285607539457, 1.01736584328251, 0.69403099565213, 1.08316452397628, 0.940270018404624, -0.00960905133118967, -0.00372074627807391, -0.0126429015220642, -0.00643946343215643, 0.955336572337004, 67776, NULL, NULL, NULL, NULL, NULL); \ No newline at end of file