Skip to content

Commit 63242d5

Browse files
committed
Adapt column name from "datum" to "time" with ICON weather data
1 parent 7995b54 commit 63242d5

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3131
- BREAKING: Moved methods `buildSafe{Coord,Point,LineString,LineStringBetweenCoords,LineStringBetweenPoints}`, `totalLengthOfLineString` from `GridAndGeoUtils` to `GeoUtils` in [_PowerSystemUtils_](https://github.com/ie3-institute/PowerSystemUtils)
3232
- BREAKING: Moved `CoordinateDistance` to [_PowerSystemUtils_](https://github.com/ie3-institute/PowerSystemUtils)
3333
- BREAKING: Weather source
34-
- Adapted data scheme (COSMO: `"coordinate"` to `"coordinate id"`, `"irradiation"` to `"irradiance"`)
34+
- Adapted data scheme (COSMO: `"coordinate"` to `"coordinate id"`, `"irradiation"` to `"irradiance"`, ICON: `"datum"` to `"coordinate"`)
3535
- Harmonized the source of coordinate id column name across implementations of `WeatherSource`
3636
- Get field name in different casing (to actually get the column name in database, file, ...)
3737

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
*/
3030
public class IconTimeBasedWeatherValueFactory extends TimeBasedWeatherValueFactory {
3131
/* Redefine the column names to meet the icon specifications */
32-
private static final String TIME = "datum";
3332
private static final String DIFFUSE_IRRADIANCE = "aswdifdS";
3433
private static final String DIRECT_IRRADIANCE = "aswdirS";
3534
private static final String TEMPERATURE = "t2m";

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,17 @@ class IconTimeBasedWeatherValueFactoryTest extends Specification {
7676
def coordinate = CosmoWeatherTestData.COORDINATE_67775
7777

7878
def parameter = [
79-
"datum" : "2019-08-01 01:00:00",
80-
"albRad" : "13.015240669",
81-
"asobS" : "3.555093673828124",
82-
"aswdifdS" : "1.8088226191406245",
83-
"aswdifuS" : "0.5713421484374998",
84-
"aswdirS" : "2.317613203124999",
85-
"t2m" : "289.1179319051744",
86-
"tg" : "288.4101691197649",
87-
"u10m" : "0.3021732864307963",
88-
"u131m" : "2.6058700426057797",
89-
"u20m" : "0.32384365019387784",
79+
"time" : "2019-08-01 01:00:00",
80+
"albRad" : "13.015240669",
81+
"asobS" : "3.555093673828124",
82+
"aswdifdS": "1.8088226191406245",
83+
"aswdifuS": "0.5713421484374998",
84+
"aswdirS" : "2.317613203124999",
85+
"t2m" : "289.1179319051744",
86+
"tg" : "288.4101691197649",
87+
"u10m" : "0.3021732864307963",
88+
"u131m" : "2.6058700426057797",
89+
"u20m" : "0.32384365019387784",
9090
"u216m" : "3.9015497418041756",
9191
"u65m" : "1.2823686334340363",
9292
"v10m" : "1.3852550649486943",

src/test/resources/testcontainersFiles/sql/icon/weather.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CREATE TABLE public.weather
22
(
3-
datum timestamp with time zone,
3+
time timestamp with time zone,
44
alb_rad double precision,
55
asob_s double precision,
66
aswdifd_s double precision,
@@ -29,8 +29,8 @@ CREATE TABLE public.weather
2929
p_65m double precision,
3030
sobs_rad double precision,
3131
t_131m double precision,
32-
CONSTRAINT weather_pkey PRIMARY KEY (datum, coordinate_id),
33-
CONSTRAINT weather_datum_coordinate_unique UNIQUE (datum, coordinate_id)
32+
CONSTRAINT weather_pkey PRIMARY KEY (time, coordinate_id),
33+
CONSTRAINT weather_time_coordinate_unique UNIQUE (time, coordinate_id)
3434
)
3535
WITH (
3636
OIDS = FALSE
@@ -44,11 +44,11 @@ CREATE INDEX weather_coordinate_idx
4444

4545
CREATE INDEX weather_coordinate_time_idx
4646
ON public.weather USING btree
47-
(coordinate_id ASC NULLS LAST, datum ASC NULLS LAST)
47+
(coordinate_id ASC NULLS LAST, time ASC NULLS LAST)
4848
TABLESPACE pg_default;
4949

5050
INSERT INTO
51-
public.weather (datum, 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)
51+
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)
5252
VALUES
5353
('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),
5454
('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),

src/test/resources/weather/icon/its_weather_513606bc-539e-445b-9675-2f98be3d9231.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"datum","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"
1+
"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"
22
2019-08-01 15:00:00,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,,,,,
33
2019-08-01 16:00:00,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,,,,,
44
2019-08-01 17:00:00,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,,,,,

0 commit comments

Comments
 (0)