From 3a26e4a93ce27d80cc003e21453c91f75a8c314b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jan 2023 15:50:06 +0000 Subject: [PATCH 01/10] iss #193 fix for measurement_units --- schema/iea43_wra_data_model.schema.json | 8 ++++++-- tools/iea43_wra_data_model_postgresql.sql | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/schema/iea43_wra_data_model.schema.json b/schema/iea43_wra_data_model.schema.json index 8b0ce99..d36ab6c 100644 --- a/schema/iea43_wra_data_model.schema.json +++ b/schema/iea43_wra_data_model.schema.json @@ -1028,7 +1028,10 @@ "description": "The sensitivity programmed into the logger. Usually used for pyranometers. It is the same as 1/slope with zero for offset." }, "measurement_units_id": { - "type": "string", + "type": [ + "string", + "null" + ], "title": "Measurement Units", "description": "The measurement units of the values the sensor records.", "enum": [ @@ -1071,7 +1074,8 @@ "ppt", "psu", "S/m", - "-" + "-", + null ] }, "height_m": { diff --git a/tools/iea43_wra_data_model_postgresql.sql b/tools/iea43_wra_data_model_postgresql.sql index c14b89c..6722e5c 100644 --- a/tools/iea43_wra_data_model_postgresql.sql +++ b/tools/iea43_wra_data_model_postgresql.sql @@ -444,7 +444,7 @@ CREATE TABLE IF NOT EXISTS logger_measurement_config( slope decimal, "offset" decimal, -- offset is a SQL reserved word so needs to be escaped sensitivity decimal, - measurement_units_id text NOT NULL, + measurement_units_id text, height_m decimal, serial_number text, connection_channel text, From 9258654497c6986af0bbd25eeb78347854a94dc0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jan 2023 16:31:49 +0000 Subject: [PATCH 02/10] iss #193 fix for mast_geometry_id --- schema/iea43_wra_data_model.schema.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schema/iea43_wra_data_model.schema.json b/schema/iea43_wra_data_model.schema.json index d36ab6c..d62e52d 100644 --- a/schema/iea43_wra_data_model.schema.json +++ b/schema/iea43_wra_data_model.schema.json @@ -361,7 +361,8 @@ "lattice_triangle", "lattice_square_round_edges", "lattice_square_sharp_edges", - "pole" + "pole", + null ] }, "mast_oem": { From a85d368daaefe6db530e93bf05350dc8ad6c3aed Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jan 2023 16:39:15 +0000 Subject: [PATCH 03/10] iss #193 fix for classification --- schema/iea43_wra_data_model.schema.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/schema/iea43_wra_data_model.schema.json b/schema/iea43_wra_data_model.schema.json index d62e52d..3cacdab 100644 --- a/schema/iea43_wra_data_model.schema.json +++ b/schema/iea43_wra_data_model.schema.json @@ -1274,7 +1274,10 @@ ] }, "classification": { - "type": "string", + "type": [ + "string", + "null" + ], "title": "Classification", "description": "The classification of a particular anemometer for this location. This combines the class index (number) with the terrain class (A, B, C, D or S) e.g. 1.2A. The format of this is validated by a regex which has the form of ^[0-9][.][0-9][ABCDS]$ i.e. digit.digit followed by a character.", "examples": [ From 6303df62212543062d25b6fe3e7f7553b65e8c92 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jan 2023 16:48:05 +0000 Subject: [PATCH 04/10] iss #193 update CHANGELOG --- CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81ac014..10eb7fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,8 +16,11 @@ types and units. 1. To `sensor` object, added: 1. `sensor_body_size_mm` (Issue [#155](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/155)) -1. To `logger_main_config`: - 1. fix inconsistency with data types for `logger_firmware_version`. (Issue [#87](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/87)) +1. Fix inconsistency with data types for: + 1. `logger_firmware_version` (Issue [#87](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/87)) + 1. `measurement_units_id` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) + 1. `mast_geometry_id` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) + 1. `classification` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. To `logger_measurement_config` object: 1. added `logger_stated_boom_orientation_deg` (Issue [#190](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/190)) 1. To `sensor_type` enum add: From e3d0d4ceb1f33032c9a6b383ec78a94cfa063c46 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jan 2023 17:43:12 +0000 Subject: [PATCH 05/10] iss #193 fix measurement_location_uuid in db --- tools/iea43_wra_data_model_postgresql.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/iea43_wra_data_model_postgresql.sql b/tools/iea43_wra_data_model_postgresql.sql index 6722e5c..443034d 100644 --- a/tools/iea43_wra_data_model_postgresql.sql +++ b/tools/iea43_wra_data_model_postgresql.sql @@ -366,7 +366,7 @@ CREATE TABLE IF NOT EXISTS mast_section_geometry( CREATE TABLE IF NOT EXISTS vertical_profiler_properties( uuid UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - measurement_location_uuid UUID, + measurement_location_uuid UUID NOT NULL, device_datum_plane_height_m decimal, height_reference_id text DEFAULT 'ground_level', device_orientation_deg decimal CHECK (device_orientation_deg >= 0 AND device_orientation_deg <= 360), From 7df2dd1a4aee09bdf25c52929cb785fde9b46fea Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jan 2023 17:46:46 +0000 Subject: [PATCH 06/10] iss #193 fix for structure_type_id --- CHANGELOG.md | 1 + schema/iea43_wra_data_model.schema.json | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10eb7fb..615fe7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ types and units. 1. `measurement_units_id` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. `mast_geometry_id` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. `classification` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) + 1. `structure_type_id` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. To `logger_measurement_config` object: 1. added `logger_stated_boom_orientation_deg` (Issue [#190](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/190)) 1. To `sensor_type` enum add: diff --git a/schema/iea43_wra_data_model.schema.json b/schema/iea43_wra_data_model.schema.json index 3cacdab..167e065 100644 --- a/schema/iea43_wra_data_model.schema.json +++ b/schema/iea43_wra_data_model.schema.json @@ -1698,10 +1698,7 @@ "title": "Interference Structures", "properties":{ "structure_type_id":{ - "type": [ - "string", - "null" - ], + "type": "string", "title": "Structure Type", "description": "The type of structure that is causing an interference in the sensor's measurements.", "enum": [ From 3bfde427a540b5673bd3065aeaf15a0ba65ed20a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Jan 2023 18:38:54 +0000 Subject: [PATCH 07/10] iss #193 add null to enums where type has a null --- CHANGELOG.md | 4 ++++ schema/iea43_wra_data_model.schema.json | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 615fe7c..1d96632 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ types and units. 1. `mast_geometry_id` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. `classification` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. `structure_type_id` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) + 1. `orientation_reference` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) + 1. `device_vertical_orientation` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) + 1. `sensor_type_id` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) + 1. `mounting_type_id` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. To `logger_measurement_config` object: 1. added `logger_stated_boom_orientation_deg` (Issue [#190](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/190)) 1. To `sensor_type` enum add: diff --git a/schema/iea43_wra_data_model.schema.json b/schema/iea43_wra_data_model.schema.json index 167e065..b6ee729 100644 --- a/schema/iea43_wra_data_model.schema.json +++ b/schema/iea43_wra_data_model.schema.json @@ -205,7 +205,8 @@ "enum": [ "magnetic_north", "true_north", - "grid_north" + "grid_north", + null ] }, "height_reference": { @@ -670,7 +671,8 @@ "description": "The vertical orientation that the remote sensing device is installed. E.g. an ADCP mounted on the sea floor has an 'upwards' vertical orientation pointing towards the sea surface whereas an ADCP mounted underneath a buoy has a 'downward' vertical orientation pointing towards the sea floor.", "enum": [ "upward", - "downward" + "downward", + null ] }, "date_from": { @@ -1270,7 +1272,8 @@ "ctd", "lidar", "sodar", - "other" + "other", + null ] }, "classification": { @@ -1568,7 +1571,8 @@ "enum": [ "side", "goal_post", - "top" + "top", + null ] }, "boom_orientation_deg": { From 16f467417be9e58f319ac029508149cef8b7a092 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Jan 2023 19:00:07 +0000 Subject: [PATCH 08/10] iss #193 locally defined date_from in mast_properties as it is not required --- CHANGELOG.md | 1 + schema/iea43_wra_data_model.schema.json | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d96632..77c5631 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ types and units. 1. `device_vertical_orientation` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. `sensor_type_id` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. `mounting_type_id` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) + 1. `mast_properties`.`date_from` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. To `logger_measurement_config` object: 1. added `logger_stated_boom_orientation_deg` (Issue [#190](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/190)) 1. To `sensor_type` enum add: diff --git a/schema/iea43_wra_data_model.schema.json b/schema/iea43_wra_data_model.schema.json index b6ee729..67e6186 100644 --- a/schema/iea43_wra_data_model.schema.json +++ b/schema/iea43_wra_data_model.schema.json @@ -414,7 +414,16 @@ ] }, "date_from": { - "$ref": "#/definitions/date_from" + "type": [ + "string", + "null" + ], + "format": "date-time", + "title": "Date From", + "description": "The date from when these properties are active. If these properties follow a change, then this Date From should equal the previous Date To. The format of this date should follow ISO 8601 with the 'T' required. If a timezone is used, it is essential that this timezone is the same as the logger timezone.", + "examples": [ + "2020-07-28T20:00:00" + ] }, "date_to": { "$ref": "#/definitions/date_to" From 0a01e01165d4d3873e0a9b5a30ccbaaab2212b7c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Jan 2023 14:41:12 +0000 Subject: [PATCH 09/10] iss #193 locally define lidar_config.date_from as it is not required --- CHANGELOG.md | 1 + schema/iea43_wra_data_model.schema.json | 11 ++++++++++- tools/iea43_wra_data_model_postgresql.sql | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77c5631..24a09fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ types and units. 1. `sensor_type_id` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. `mounting_type_id` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. `mast_properties`.`date_from` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) + 1. `lidar_config`.`date_from` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. To `logger_measurement_config` object: 1. added `logger_stated_boom_orientation_deg` (Issue [#190](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/190)) 1. To `sensor_type` enum add: diff --git a/schema/iea43_wra_data_model.schema.json b/schema/iea43_wra_data_model.schema.json index 67e6186..3a788ea 100644 --- a/schema/iea43_wra_data_model.schema.json +++ b/schema/iea43_wra_data_model.schema.json @@ -943,7 +943,16 @@ ] }, "date_from": { - "$ref": "#/definitions/date_from" + "type": [ + "string", + "null" + ], + "format": "date-time", + "title": "Date From", + "description": "The date from when these properties are active. If these properties follow a change, then this Date From should equal the previous Date To. The format of this date should follow ISO 8601 with the 'T' required. If a timezone is used, it is essential that this timezone is the same as the logger timezone.", + "examples": [ + "2020-07-28T20:00:00" + ] }, "date_to": { "$ref": "#/definitions/date_to" diff --git a/tools/iea43_wra_data_model_postgresql.sql b/tools/iea43_wra_data_model_postgresql.sql index 443034d..eab9a31 100644 --- a/tools/iea43_wra_data_model_postgresql.sql +++ b/tools/iea43_wra_data_model_postgresql.sql @@ -415,7 +415,7 @@ CREATE TABLE IF NOT EXISTS lidar_config( uuid UUID PRIMARY KEY DEFAULT uuid_generate_v4(), logger_main_config_uuid UUID, flow_corrections_applied boolean, - date_from timestamp WITHOUT TIME ZONE NOT NULL, + date_from timestamp WITHOUT TIME ZONE, date_to timestamp WITHOUT TIME ZONE, notes text, update_at timestamp WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP, From eeaf7f0bf19844fa9d1c322eef2d4ad2b1006dae Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Jan 2023 14:44:28 +0000 Subject: [PATCH 10/10] iss #193 locally define vertical_profiler_properties.date_from as it is not required --- CHANGELOG.md | 1 + schema/iea43_wra_data_model.schema.json | 11 ++++++++++- tools/iea43_wra_data_model_postgresql.sql | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24a09fc..c83a1ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ types and units. 1. `mounting_type_id` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. `mast_properties`.`date_from` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. `lidar_config`.`date_from` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) + 1. `vertical_profiler_properties`.`date_from` (Issue [#193](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/193)) 1. To `logger_measurement_config` object: 1. added `logger_stated_boom_orientation_deg` (Issue [#190](https://github.com/IEA-Task-43/digital_wra_data_standard/issues/190)) 1. To `sensor_type` enum add: diff --git a/schema/iea43_wra_data_model.schema.json b/schema/iea43_wra_data_model.schema.json index 3a788ea..6fd6514 100644 --- a/schema/iea43_wra_data_model.schema.json +++ b/schema/iea43_wra_data_model.schema.json @@ -685,7 +685,16 @@ ] }, "date_from": { - "$ref": "#/definitions/date_from" + "type": [ + "string", + "null" + ], + "format": "date-time", + "title": "Date From", + "description": "The date from when these properties are active. If these properties follow a change, then this Date From should equal the previous Date To. The format of this date should follow ISO 8601 with the 'T' required. If a timezone is used, it is essential that this timezone is the same as the logger timezone.", + "examples": [ + "2020-07-28T20:00:00" + ] }, "date_to": { "$ref": "#/definitions/date_to" diff --git a/tools/iea43_wra_data_model_postgresql.sql b/tools/iea43_wra_data_model_postgresql.sql index eab9a31..99ce2aa 100644 --- a/tools/iea43_wra_data_model_postgresql.sql +++ b/tools/iea43_wra_data_model_postgresql.sql @@ -372,7 +372,7 @@ CREATE TABLE IF NOT EXISTS vertical_profiler_properties( device_orientation_deg decimal CHECK (device_orientation_deg >= 0 AND device_orientation_deg <= 360), orientation_reference_id text, device_vertical_orientation_id text, - date_from timestamp WITHOUT TIME ZONE NOT NULL, + date_from timestamp WITHOUT TIME ZONE, date_to timestamp WITHOUT TIME ZONE, notes text, update_at timestamp WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,