Skip to content

Commit aa481ca

Browse files
Rename GroundTemperature variable
1 parent a1967ea commit aa481ca

File tree

17 files changed

+88
-88
lines changed

17 files changed

+88
-88
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Added getter sRated for SystemParticipant inputs and updated them in tests in src[#1412](https://github.com/ie3-institute/PowerSystemDataModel/issues/1412)
1313
- Added converters documentation [#1139](https://github.com/ie3-institute/PowerSystemDataModel/issues/1139)
1414
- Added abstraction for power value sources [#1438](https://github.com/ie3-institute/PowerSystemDataModel/issues/1438)
15+
- Add ground temperatures level 1 and 2 as option to weather data. [#1343](https://github.com/ie3-institute/PowerSystemDataModel/issues/1343)
1516

1617
### Fixed
1718
- Fixed small issues in tests [#1400](https://github.com/ie3-institute/PowerSystemDataModel/issues/1400)
@@ -46,7 +47,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4647

4748
### Added
4849
- Extend Validation to EnergyManagement Systems. [#1356](https://github.com/ie3-institute/PowerSystemDataModel/issues/1356)
49-
- Add ground temperature (1m) as option to weather data. [#1343](https://github.com/ie3-institute/PowerSystemDataModel/issues/1343)
5050

5151
### Fixed
5252
- Fixed handling of `CongestionResult.InputModelType` in `EntityProcessor` [#1325](https://github.com/ie3-institute/PowerSystemDataModel/issues/1325)

docs/readthedocs/models/input/additionaldata/weathersource.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ Weather data is comprised of five key components:
6363
- Wind direction, where 0° is North, 90° is East, etc.
6464
- ° (degrees)
6565
66-
* - **`groundTemperatureValueOne`**
67-
- Ground temperature at 0cm for this coordinate.
66+
* - **`groundTemperatureLevel1`**
67+
- Ground temperature at level 2 for this coordinate.
6868
- K (Kelvin)
6969
70-
* - **`groundTemperatureValueTwo`**
71-
- Ground temperature at 0cm for this coordinate.
70+
* - **`groundTemperatureLevel2`**
71+
- Ground temperature at level 2 for this coordinate.
7272
- K (Kelvin)
7373
```
7474
Weather data in COSMO and ICON formats is supported. Additional optional weather data can also be provided.
75-
The ground temperature measurements at 0 cm and 80 cm depth are used because underground cables are typically laid at around 80 cm depth.
75+
The ground temperature measurements at level 1 and level 2 depth are used. Underground cables are typically laid at around 80 cm depth.

src/main/java/edu/ie3/datamodel/io/factory/timeseries/CosmoTimeBasedWeatherValueFactory.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public class CosmoTimeBasedWeatherValueFactory extends TimeBasedWeatherValueFact
3333
private static final String TEMPERATURE = "temperature";
3434
private static final String WIND_DIRECTION = "windDirection";
3535
private static final String WIND_VELOCITY = "windVelocity";
36-
private static final String GROUND_TEMPERATURE_VALUE_ONE = "groundTemperature0cm";
37-
private static final String GROUND_TEMPERATURE_VALUE_TWO = "groundTemperature80cm";
36+
private static final String GROUND_TEMPERATURE_LEVEL_1 = "groundTemperatureLevel1";
37+
private static final String GROUND_TEMPERATURE_LEVEL_2 = "groundTemperatureLevel2";
3838

3939
public CosmoTimeBasedWeatherValueFactory(TimeUtil timeUtil) {
4040
super(timeUtil);
@@ -60,7 +60,7 @@ protected List<Set<String>> getFields(Class<?> entityClass) {
6060
WIND_VELOCITY);
6161

6262
Set<String> withGroundTemp =
63-
expandSet(minConstructorParams, GROUND_TEMPERATURE_VALUE_ONE, GROUND_TEMPERATURE_VALUE_TWO);
63+
expandSet(minConstructorParams, GROUND_TEMPERATURE_LEVEL_1, GROUND_TEMPERATURE_LEVEL_2);
6464

6565
return Arrays.asList(minConstructorParams, withGroundTemp);
6666
}
@@ -80,9 +80,9 @@ protected TimeBasedValue<WeatherValue> buildModel(TimeBasedWeatherValueData data
8080
ComparableQuantity<Speed> windVelocity =
8181
data.getQuantity(WIND_VELOCITY, StandardUnits.WIND_VELOCITY);
8282
Optional<ComparableQuantity<Temperature>> groundTempValOne =
83-
data.getQuantityOptional(GROUND_TEMPERATURE_VALUE_ONE, StandardUnits.TEMPERATURE);
83+
data.getQuantityOptional(GROUND_TEMPERATURE_LEVEL_1, StandardUnits.TEMPERATURE);
8484
Optional<ComparableQuantity<Temperature>> groundTempValTwo =
85-
data.getQuantityOptional(GROUND_TEMPERATURE_VALUE_TWO, StandardUnits.TEMPERATURE);
85+
data.getQuantityOptional(GROUND_TEMPERATURE_LEVEL_2, StandardUnits.TEMPERATURE);
8686
WeatherValue weatherValue =
8787
new WeatherValue(
8888
coordinate,

src/main/java/edu/ie3/datamodel/io/factory/timeseries/IconTimeBasedWeatherValueFactory.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public class IconTimeBasedWeatherValueFactory extends TimeBasedWeatherValueFacto
3333
private static final String TEMPERATURE = "t2m";
3434
private static final String WIND_VELOCITY_U = "u131m";
3535
private static final String WIND_VELOCITY_V = "v131m";
36-
private static final String GROUND_TEMPERATURE_VALUE_ONE = "t_v1";
37-
private static final String GROUND_TEMPERATURE_VALUE_TWO = "t_v2";
36+
private static final String GROUND_TEMPERATURE_LEVEL_1 = "tg_1";
37+
private static final String GROUND_TEMPERATURE_LEVEL_2 = "tg_2";
3838

3939
public IconTimeBasedWeatherValueFactory() {
4040
super();
@@ -55,8 +55,8 @@ protected List<Set<String>> getFields(Class<?> entityClass) {
5555
"albrad",
5656
"asobs",
5757
"aswdifuS",
58-
"t_v1",
59-
"t_v2",
58+
"tg_1",
59+
"tg_2",
6060
"u10m",
6161
"u20m",
6262
"u216m",
@@ -91,10 +91,10 @@ protected TimeBasedValue<WeatherValue> buildModel(TimeBasedWeatherValueData data
9191
data.getQuantity(TEMPERATURE, Units.KELVIN).to(StandardUnits.TEMPERATURE);
9292
ComparableQuantity<Angle> windDirection = getWindDirection(data);
9393
ComparableQuantity<Speed> windVelocity = getWindVelocity(data);
94-
Optional<ComparableQuantity<Temperature>> groundTemperatureValueOne =
95-
data.getQuantityOptional(GROUND_TEMPERATURE_VALUE_ONE, Units.KELVIN);
96-
Optional<ComparableQuantity<Temperature>> groundTemperatureValueTwo =
97-
data.getQuantityOptional(GROUND_TEMPERATURE_VALUE_TWO, Units.KELVIN);
94+
Optional<ComparableQuantity<Temperature>> groundTemperatureLevel1 =
95+
data.getQuantityOptional(GROUND_TEMPERATURE_LEVEL_1, Units.KELVIN);
96+
Optional<ComparableQuantity<Temperature>> groundTemperatureLevl2 =
97+
data.getQuantityOptional(GROUND_TEMPERATURE_LEVEL_2, Units.KELVIN);
9898

9999
WeatherValue weatherValue =
100100
new WeatherValue(
@@ -104,8 +104,8 @@ protected TimeBasedValue<WeatherValue> buildModel(TimeBasedWeatherValueData data
104104
temperature,
105105
windDirection,
106106
windVelocity,
107-
groundTemperatureValueOne,
108-
groundTemperatureValueTwo);
107+
groundTemperatureLevel1,
108+
groundTemperatureLevl2);
109109
return new TimeBasedValue<>(time, weatherValue);
110110
}
111111

src/main/java/edu/ie3/datamodel/io/processor/timeseries/FieldSourceToMethod.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public enum FieldSource {
2525
WEATHER_IRRADIANCE,
2626
WEATHER_TEMPERATURE,
2727
WEATHER_WIND,
28-
GROUND_TEMPERATURE_ONE,
29-
GROUND_TEMPERATURE_TWO,
28+
GROUND_TEMPERATURE_LEVEL_1,
29+
GROUND_TEMPERATURE_LEVEL_2,
3030
}
3131
}

src/main/java/edu/ie3/datamodel/io/processor/timeseries/TimeSeriesProcessor.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ private SortedMap<String, FieldSourceToMethod> buildFieldToSource(
176176
groundTempMap.forEach(
177177
(fieldName, getter) ->
178178
addFunction
179-
.apply(GROUND_TEMPERATURE_ONE)
179+
.apply(GROUND_TEMPERATURE_LEVEL_1)
180180
.accept("groundTemperatureValueOne", getter));
181181
groundTempMap.forEach(
182182
(fieldName, getter) ->
183183
addFunction
184-
.apply(GROUND_TEMPERATURE_TWO)
184+
.apply(GROUND_TEMPERATURE_LEVEL_2)
185185
.accept("groundTemperatureValueTwo", getter));
186186

187187
} else if (valueClass.equals(BdewLoadValues.class)) {
@@ -285,15 +285,15 @@ private Map<String, String> handleEntry(T timeSeries, E entry) throws EntityProc
285285
valueResult.putAll(processObject(weatherValue.getWind(), windFieldToMethod));
286286

287287
Map<String, GetterMethod> groundTempOneFieldToMethod =
288-
extractFieldToMethod(GROUND_TEMPERATURE_ONE);
289-
Optional<GroundTemperatureValue> gtOneOpt = weatherValue.getGroundTemperatureValueOne();
288+
extractFieldToMethod(GROUND_TEMPERATURE_LEVEL_1);
289+
Optional<GroundTemperatureValue> gtOneOpt = weatherValue.getGroundTemperatureLevel1();
290290
if (gtOneOpt.isPresent()) {
291291
valueResult.putAll(processObject(gtOneOpt.get(), groundTempOneFieldToMethod));
292292
}
293293

294294
Map<String, GetterMethod> groundTempTwoFieldToMethod =
295-
extractFieldToMethod(GROUND_TEMPERATURE_TWO);
296-
Optional<GroundTemperatureValue> gtTwoOpt = weatherValue.getGroundTemperatureValueTwo();
295+
extractFieldToMethod(GROUND_TEMPERATURE_LEVEL_2);
296+
Optional<GroundTemperatureValue> gtTwoOpt = weatherValue.getGroundTemperatureLevel2();
297297
if (gtTwoOpt.isPresent()) {
298298
valueResult.putAll(processObject(gtTwoOpt.get(), groundTempTwoFieldToMethod));
299299
}

src/main/java/edu/ie3/datamodel/models/value/WeatherValue.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ public class WeatherValue implements Value {
2929
private final WindValue wind;
3030

3131
/** Ground temperature value for this coordinate */
32-
private final Optional<GroundTemperatureValue> groundTemperatureValueOne;
32+
private final Optional<GroundTemperatureValue> groundTemperatureLevel1;
3333

3434
/** Ground temperature value for this coordinate */
35-
private final Optional<GroundTemperatureValue> groundTemperatureValueTwo;
35+
private final Optional<GroundTemperatureValue> groundTemperatureLevel2;
3636

3737
/**
3838
* @param coordinate of this weather value set
@@ -53,8 +53,8 @@ public WeatherValue(
5353
this.solarIrradiance = solarIrradiance;
5454
this.temperature = temperature;
5555
this.wind = wind;
56-
this.groundTemperatureValueOne = groundTemperatureValueOne;
57-
this.groundTemperatureValueTwo = groundTemperatureValueTwo;
56+
this.groundTemperatureLevel1 = groundTemperatureValueOne;
57+
this.groundTemperatureLevel2 = groundTemperatureValueTwo;
5858
}
5959

6060
/**
@@ -106,12 +106,12 @@ public WindValue getWind() {
106106
return wind;
107107
}
108108

109-
public Optional<GroundTemperatureValue> getGroundTemperatureValueOne() {
110-
return groundTemperatureValueOne;
109+
public Optional<GroundTemperatureValue> getGroundTemperatureLevel1() {
110+
return groundTemperatureLevel1;
111111
}
112112

113-
public Optional<GroundTemperatureValue> getGroundTemperatureValueTwo() {
114-
return groundTemperatureValueTwo;
113+
public Optional<GroundTemperatureValue> getGroundTemperatureLevel2() {
114+
return groundTemperatureLevel2;
115115
}
116116

117117
@Override
@@ -123,8 +123,8 @@ public boolean equals(Object o) {
123123
&& solarIrradiance.equals(that.solarIrradiance)
124124
&& temperature.equals(that.temperature)
125125
&& wind.equals(that.wind)
126-
&& Objects.equals(groundTemperatureValueOne, that.groundTemperatureValueOne)
127-
&& Objects.equals(groundTemperatureValueTwo, that.groundTemperatureValueTwo);
126+
&& Objects.equals(groundTemperatureLevel1, that.groundTemperatureLevel1)
127+
&& Objects.equals(groundTemperatureLevel2, that.groundTemperatureLevel2);
128128
}
129129

130130
@Override
@@ -134,8 +134,8 @@ public int hashCode() {
134134
solarIrradiance,
135135
temperature,
136136
wind,
137-
groundTemperatureValueOne,
138-
groundTemperatureValueTwo);
137+
groundTemperatureLevel1,
138+
groundTemperatureLevel2);
139139
}
140140

141141
@Override
@@ -149,10 +149,10 @@ public String toString() {
149149
+ temperature
150150
+ ", wind="
151151
+ wind
152-
+ ", groundTemperatureValueOne="
153-
+ groundTemperatureValueOne
154-
+ ", groundTemperatureValueTwo="
155-
+ groundTemperatureValueTwo
152+
+ ", groundTemperatureLevel1="
153+
+ groundTemperatureLevel1
154+
+ ", groundTemperatureLevel2="
155+
+ groundTemperatureLevel2
156156
+ '}';
157157
}
158158
}

src/test/groovy/edu/ie3/datamodel/io/factory/timeseries/CosmoTimeBasedWeatherValueFactoryTest.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class CosmoTimeBasedWeatherValueFactoryTest extends Specification {
2929
"temperature" : "",
3030
"windDirection" : "0",
3131
"windVelocity" : "1.66103506088257",
32-
"groundTemperatureValueOne" : "",
33-
"groundTemperatureValueTwo" : ""
32+
"groundTemperatureLevel1" : "",
33+
"groundTemperatureLevel2" : ""
3434
]
3535

3636
def data = new TimeBasedWeatherValueData(parameter, coordinate)
@@ -66,8 +66,8 @@ class CosmoTimeBasedWeatherValueFactoryTest extends Specification {
6666
"temperature" : "278.019012451172",
6767
"windDirection" : "0",
6868
"windVelocity" : "1.66103506088257",
69-
"groundTemperatureValueOne" : "",
70-
"groundTemperatureValueTwo" : ""
69+
"groundTemperatureLevel1" : "",
70+
"groundTemperatureLevel2" : ""
7171
]
7272

7373
def data = new TimeBasedWeatherValueData(parameter, coordinate)

src/test/groovy/edu/ie3/datamodel/io/factory/timeseries/IconTimeBasedWeatherValueFactoryTest.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ class IconTimeBasedWeatherValueFactoryTest extends Specification {
8484
"aswdirS" : "2.317613203124999",
8585
"t2m" : "289.1179319051744",
8686
"tg" : "288.4101691197649",
87-
"t_v1":"288.4101691197649",
88-
"t_v2":"288.4101691197649",
87+
"tg_1":"288.4101691197649",
88+
"tg_2":"288.4101691197649",
8989
"u10m" : "0.3021732864307963",
9090
"u131m" : "2.6058700426057797",
9191
"u20m" : "0.32384365019387784",
@@ -127,10 +127,10 @@ class IconTimeBasedWeatherValueFactoryTest extends Specification {
127127
assert QuantityUtil.isEquivalentAbs(it.value.wind.direction.get(), Quantities.getQuantity(214.16711674907722, PowerSystemUnits.DEGREE_GEOM))
128128
assert it.value.wind.velocity.present
129129
assert QuantityUtil.isEquivalentAbs(it.value.wind.velocity.get(), Quantities.getQuantity(4.640010877529081, PowerSystemUnits.METRE_PER_SECOND))
130-
assert it.value.groundTemperatureValueOne.present
131-
assert QuantityUtil.isEquivalentAbs(it.value.groundTemperatureValueOne.get().temperature.get(), Quantities.getQuantity(15.2601691197649, Units.CELSIUS))
132-
assert it.value.groundTemperatureValueTwo.present
133-
assert QuantityUtil.isEquivalentAbs(it.value.groundTemperatureValueTwo.get().temperature.get(), Quantities.getQuantity(15.2601691197649, Units.CELSIUS))
130+
assert it.value.groundTemperatureLevel1.present
131+
assert QuantityUtil.isEquivalentAbs(it.value.groundTemperatureLevel1.get().temperature.get(), Quantities.getQuantity(15.2601691197649, Units.CELSIUS))
132+
assert it.value.groundTemperatureLevel2.present
133+
assert QuantityUtil.isEquivalentAbs(it.value.groundTemperatureLevel2.get().temperature.get(), Quantities.getQuantity(15.2601691197649, Units.CELSIUS))
134134
}
135135
}
136136
}

src/test/groovy/edu/ie3/datamodel/io/source/csv/CsvWeatherSourceCosmoTest.groovy

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ class CsvWeatherSourceCosmoTest extends Specification implements CsvTestDataMeta
127127
"temperature" : "9.1011",
128128
"windVelocity" : "12.1314",
129129
"windDirection" : "15.1617",
130-
"groundtemperatureone": "8.0",
131-
"groundtemperaturetwo": "9.5"
130+
"groundTemperaturLevel1": "8.0",
131+
"groundTemperatureLevel2": "9.5"
132132
]
133133
def expectedValue = new TimeBasedValue(
134134
TimeUtil.withDefaults.toZonedDateTime("2020-10-16T12:40:42Z"),
@@ -176,8 +176,8 @@ class CsvWeatherSourceCosmoTest extends Specification implements CsvTestDataMeta
176176
"temperature" : "9.1011",
177177
"windvelocity" : "12.1314",
178178
"winddirection" : "15.1617",
179-
"groundtemperatureone": "8.0",
180-
"groundtemperaturetwo": "9.5"
179+
"groundTemperaturLevel1": "8.0",
180+
"groundTemperatureLevel2": "9.5"
181181
]
182182

183183
when:
@@ -202,8 +202,8 @@ class CsvWeatherSourceCosmoTest extends Specification implements CsvTestDataMeta
202202
"temperature" : "9.1011",
203203
"windvelocity" : "12.1314",
204204
"winddirection" : "15.1617",
205-
"groundtemperatureone": "8.0",
206-
"groundtemperaturetwo": "9.5"
205+
"groundTemperaturLevel1": "8.0",
206+
"groundTemperatureLevel2": "9.5"
207207
]
208208

209209
when:
@@ -228,8 +228,8 @@ class CsvWeatherSourceCosmoTest extends Specification implements CsvTestDataMeta
228228
"temperature" : "9.1011",
229229
"windvelocity" : "12.1314",
230230
"winddirection" : "15.1617",
231-
"groundtemperatureone": "8.0",
232-
"groundtemperaturetwo": "9.5"
231+
"groundTemperaturLevel1": "8.0",
232+
"groundTemperatureLevel2": "9.5"
233233
]
234234

235235
when:

0 commit comments

Comments
 (0)