From c0756b08d7fdac6e5b6a3f18a2c65b3831261d60 Mon Sep 17 00:00:00 2001 From: Kaleb Phipps Date: Wed, 27 Nov 2024 15:30:12 +0100 Subject: [PATCH 1/2] include kinematic parameters that are fixed for all heliostats --- paint/util/paint_mappings.py | 20 ++++++++ .../generate_properties_json_and_stac.py | 50 ++++++++++++++++--- 2 files changed, 63 insertions(+), 7 deletions(-) diff --git a/paint/util/paint_mappings.py b/paint/util/paint_mappings.py index b12d61d..0f76ce3 100644 --- a/paint/util/paint_mappings.py +++ b/paint/util/paint_mappings.py @@ -382,3 +382,23 @@ WGS84_A = 6378137.0 # Major axis in meters WGS84_B = 6356752.314245 # Minor axis in meters WGS84_E2 = (WGS84_A**2 - WGS84_B**2) / WGS84_A**2 # Eccentricity squared + +# Extra Kinematic Properties +FIRST_JOINT_TRANSLATION_E_KEY = "first_joint_translation_e" +FIRST_JOINT_TRANSLATION_N_KEY = "first_joint_translation_n" +FIRST_JOINT_TRANSLATION_U_KEY = "first_joint_translation_u" +SECOND_JOINT_TRANSLATION_E_KEY = "second_joint_translation_e" +SECOND_JOINT_TRANSLATION_N_KEY = "second_joint_translation_n" +SECOND_JOINT_TRANSLATION_U_KEY = "second_joint_translation_u" +CONCENTRATOR_TRANSLATION_E_KEY = "concentrator_translation_e" +CONCENTRATOR_TRANSLATION_N_KEY = "concentrator_translation_n" +CONCENTRATOR_TRANSLATION_U_KEY = "concentrator_translation_u" +FIRST_JOINT_TRANSLATION_E = 0.0 +FIRST_JOINT_TRANSLATION_N = 0.0 +FIRST_JOINT_TRANSLATION_U = 0.0 +SECOND_JOINT_TRANSLATION_E = 0.0 +SECOND_JOINT_TRANSLATION_N = 0.0 +SECOND_JOINT_TRANSLATION_U = 0.315 +CONCENTRATOR_TRANSLATION_E = 0.0 +CONCENTRATOR_TRANSLATION_N = -0.17755 +CONCENTRATOR_TRANSLATION_U = -0.4045 diff --git a/preprocessing-scripts/generate_properties_json_and_stac.py b/preprocessing-scripts/generate_properties_json_and_stac.py index 8a530b8..7da51c6 100755 --- a/preprocessing-scripts/generate_properties_json_and_stac.py +++ b/preprocessing-scripts/generate_properties_json_and_stac.py @@ -2,7 +2,6 @@ import argparse import json -import os from pathlib import Path from typing import Any @@ -88,6 +87,35 @@ def extract_properties_data_and_generate_stac_item( ]: kinematic_data.pop(key_to_remove, None) + # Include additional kinematic properties that are identical for all heliostats change. + kinematic_data[ + mappings.FIRST_JOINT_TRANSLATION_E_KEY + ] = mappings.FIRST_JOINT_TRANSLATION_E + kinematic_data[ + mappings.FIRST_JOINT_TRANSLATION_N_KEY + ] = mappings.FIRST_JOINT_TRANSLATION_N + kinematic_data[ + mappings.FIRST_JOINT_TRANSLATION_U_KEY + ] = mappings.FIRST_JOINT_TRANSLATION_U + kinematic_data[ + mappings.SECOND_JOINT_TRANSLATION_E_KEY + ] = mappings.SECOND_JOINT_TRANSLATION_E + kinematic_data[ + mappings.SECOND_JOINT_TRANSLATION_N_KEY + ] = mappings.SECOND_JOINT_TRANSLATION_N + kinematic_data[ + mappings.SECOND_JOINT_TRANSLATION_U_KEY + ] = mappings.SECOND_JOINT_TRANSLATION_U + kinematic_data[ + mappings.CONCENTRATOR_TRANSLATION_E_KEY + ] = mappings.CONCENTRATOR_TRANSLATION_E + kinematic_data[ + mappings.CONCENTRATOR_TRANSLATION_N_KEY + ] = mappings.CONCENTRATOR_TRANSLATION_N + kinematic_data[ + mappings.CONCENTRATOR_TRANSLATION_U_KEY + ] = mappings.CONCENTRATOR_TRANSLATION_U + # Extract renovation date. renovation_date = renovations.renovation_number_to_date[ renovation_data[mappings.RENOVATION_ID] @@ -269,14 +297,22 @@ def main(arguments: argparse.Namespace): if __name__ == "__main__": - lsdf_root = str(os.environ.get("LSDFPROJECTS")) - input_axis = Path(lsdf_root) / "paint" / "PAINT" / "axis_data.csv" - output_folder = Path(lsdf_root) / "paint" / mappings.POWER_PLANT_GPPD_ID + # lsdf_root = str(os.environ.get("LSDFPROJECTS")) + # input_axis = Path(lsdf_root) / "paint" / "PAINT" / "axis_data.csv" + # output_folder = Path(lsdf_root) / "paint" / mappings.POWER_PLANT_GPPD_ID + # input_position = ( + # Path(lsdf_root) / "paint" / "PAINT" / "Heliostatpositionen_xyz.xlsx" + # ) + # input_renovations = Path(lsdf_root) / "paint" / "PAINT" / "renovation_data.csv" + # input_facets = Path(lsdf_root) / "paint" / "PAINT" / "facet_data.npy" + + input_axis = Path(PAINT_ROOT) / "ExampleDataKIT" / "axis_data.csv" + output_folder = Path(PAINT_ROOT) / "AAA_ARGH" input_position = ( - Path(lsdf_root) / "paint" / "PAINT" / "Heliostatpositionen_xyz.xlsx" + Path(PAINT_ROOT) / "ExampleDataKIT" / "Heliostatpositionen_xyz.xlsx" ) - input_renovations = Path(lsdf_root) / "paint" / "PAINT" / "renovation_data.csv" - input_facets = Path(lsdf_root) / "paint" / "PAINT" / "facet_data.npy" + input_renovations = Path(PAINT_ROOT) / "ExampleDataKIT" / "renovation_data.csv" + input_facets = Path(PAINT_ROOT) / "ExampleDataKIT" / "facet_data.npy" parser = argparse.ArgumentParser() parser.add_argument( From 9917180526c6d6fc60b93deffe36d1318389093b Mon Sep 17 00:00:00 2001 From: Kaleb Phipps Date: Wed, 27 Nov 2024 15:32:52 +0100 Subject: [PATCH 2/2] fix paths --- .../generate_properties_json_and_stac.py | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/preprocessing-scripts/generate_properties_json_and_stac.py b/preprocessing-scripts/generate_properties_json_and_stac.py index 7da51c6..86ac430 100755 --- a/preprocessing-scripts/generate_properties_json_and_stac.py +++ b/preprocessing-scripts/generate_properties_json_and_stac.py @@ -2,6 +2,7 @@ import argparse import json +import os from pathlib import Path from typing import Any @@ -297,22 +298,14 @@ def main(arguments: argparse.Namespace): if __name__ == "__main__": - # lsdf_root = str(os.environ.get("LSDFPROJECTS")) - # input_axis = Path(lsdf_root) / "paint" / "PAINT" / "axis_data.csv" - # output_folder = Path(lsdf_root) / "paint" / mappings.POWER_PLANT_GPPD_ID - # input_position = ( - # Path(lsdf_root) / "paint" / "PAINT" / "Heliostatpositionen_xyz.xlsx" - # ) - # input_renovations = Path(lsdf_root) / "paint" / "PAINT" / "renovation_data.csv" - # input_facets = Path(lsdf_root) / "paint" / "PAINT" / "facet_data.npy" - - input_axis = Path(PAINT_ROOT) / "ExampleDataKIT" / "axis_data.csv" - output_folder = Path(PAINT_ROOT) / "AAA_ARGH" + lsdf_root = str(os.environ.get("LSDFPROJECTS")) + input_axis = Path(lsdf_root) / "paint" / "PAINT" / "axis_data.csv" + output_folder = Path(lsdf_root) / "paint" / mappings.POWER_PLANT_GPPD_ID input_position = ( - Path(PAINT_ROOT) / "ExampleDataKIT" / "Heliostatpositionen_xyz.xlsx" + Path(lsdf_root) / "paint" / "PAINT" / "Heliostatpositionen_xyz.xlsx" ) - input_renovations = Path(PAINT_ROOT) / "ExampleDataKIT" / "renovation_data.csv" - input_facets = Path(PAINT_ROOT) / "ExampleDataKIT" / "facet_data.npy" + input_renovations = Path(lsdf_root) / "paint" / "PAINT" / "renovation_data.csv" + input_facets = Path(lsdf_root) / "paint" / "PAINT" / "facet_data.npy" parser = argparse.ArgumentParser() parser.add_argument(