diff --git a/data/sample/initialize_files/sample_simulation_base.ini b/data/sample/initialize_files/sample_simulation_base.ini index 7bb5ca84c..bd3a1e6dd 100644 --- a/data/sample/initialize_files/sample_simulation_base.ini +++ b/data/sample/initialize_files/sample_simulation_base.ini @@ -85,10 +85,6 @@ inertial_frame = J2000 center_object = EARTH aberration_correction = NONE -// Earth Rotation model -// Idle:no motion, Simple:Z-axis rotation only, Full:full-dynamics -earth_rotation_mode = Simple - // Definition of calculation celestial bodies number_of_selected_body = 3 selected_body_name(0) = EARTH @@ -105,17 +101,17 @@ selected_body_name(10) = PLUTO // Celestial rotation mode // Currently, s2e-core supports Earth and Moon only -is_enable_body_rotation(0) = Full -is_enable_body_rotation(1) = DISABLE -is_enable_body_rotation(2) = Simple -is_enable_body_rotation(3) = DISABLE -is_enable_body_rotation(4) = DISABLE -is_enable_body_rotation(5) = DISABLE -is_enable_body_rotation(6) = DISABLE -is_enable_body_rotation(7) = DISABLE -is_enable_body_rotation(8) = DISABLE -is_enable_body_rotation(9) = DISABLE -is_enable_body_rotation(10) = DISABLE +rotation_mode(0) = FULL // EARTH IDLE:no motion, SIMPLE:Z-axis rotation only, FULL:full-dynamics +rotation_mode(1) = DISABLE +rotation_mode(2) = SIMPLE // MOON IDLE:no motion, SIMPLE:Mean Earth and Principal Axis, IAU_MOON: IAU_MOON frame by SPICE +rotation_mode(3) = DISABLE +rotation_mode(4) = DISABLE +rotation_mode(5) = DISABLE +rotation_mode(6) = DISABLE +rotation_mode(7) = DISABLE +rotation_mode(8) = DISABLE +rotation_mode(9) = DISABLE +rotation_mode(10) = DISABLE [CSPICE_KERNELS] // CSPICE Kernel files definition diff --git a/src/environment/global/celestial_information.cpp b/src/environment/global/celestial_information.cpp index 9bf144db1..9e7a2c71a 100644 --- a/src/environment/global/celestial_information.cpp +++ b/src/environment/global/celestial_information.cpp @@ -19,8 +19,7 @@ #include "library/logger/log_utility.hpp" CelestialInformation::CelestialInformation(const std::string inertial_frame_name, const std::string aberration_correction_setting, - const std::string center_body_name, const EarthRotationMode earth_rotation_mode, - const unsigned int number_of_selected_body, int* selected_body_ids, + const std::string center_body_name, const unsigned int number_of_selected_body, int* selected_body_ids, const std::vector rotation_mode_list) : number_of_selected_bodies_(number_of_selected_body), selected_body_ids_(selected_body_ids), @@ -65,7 +64,7 @@ CelestialInformation::CelestialInformation(const std::string inertial_frame_name } // Initialize rotation - earth_rotation_ = new EarthRotation(earth_rotation_mode); + earth_rotation_ = new EarthRotation(ConvertEarthRotationMode(GetRotationMode("EARTH"))); moon_rotation_ = new MoonRotation(*this, ConvertMoonRotationMode(GetRotationMode("MOON"))); } @@ -235,13 +234,10 @@ CelestialInformation* InitCelestialInformation(std::string file_name) { } // Read Rotation setting - std::string rotation_mode_string = ini_file.ReadString(section, "earth_rotation_mode"); - EarthRotationMode rotation_mode = ConvertEarthRotationMode(rotation_mode_string); - std::vector rotation_mode_list = ini_file.ReadVectorString(section, "is_enable_body_rotation", num_of_selected_body); + std::vector rotation_mode_list = ini_file.ReadVectorString(section, "rotation_mode", num_of_selected_body); CelestialInformation* celestial_info; - celestial_info = - new CelestialInformation(inertial_frame, aber_cor, center_obj, rotation_mode, num_of_selected_body, selected_body, rotation_mode_list); + celestial_info = new CelestialInformation(inertial_frame, aber_cor, center_obj, num_of_selected_body, selected_body, rotation_mode_list); // log setting celestial_info->is_log_enabled_ = ini_file.ReadEnable(section, INI_LOG_LABEL); diff --git a/src/environment/global/celestial_information.hpp b/src/environment/global/celestial_information.hpp index 7655420b3..7c4afa854 100644 --- a/src/environment/global/celestial_information.hpp +++ b/src/environment/global/celestial_information.hpp @@ -30,14 +30,12 @@ class CelestialInformation : public ILoggable { * @param [in] inertial_frame_name: Definition of inertial frame * @param [in] aberration_correction_setting: Stellar aberration correction * @param [in] center_body_name: Center body name of inertial frame - * @param [in] earth_rotation_mode: Designation of rotation model * @param [in] number_of_selected_body: Number of selected body * @param [in] selected_body_ids: SPICE IDs of selected bodies * @param [in] rotation_mode_list: Rotation mode list for planets */ CelestialInformation(const std::string inertial_frame_name, const std::string aberration_correction_setting, const std::string center_body_name, - const EarthRotationMode earth_rotation_mode, const unsigned int number_of_selected_body, int* selected_body_ids, - const std::vector rotation_mode_list); + const unsigned int number_of_selected_body, int* selected_body_ids, const std::vector rotation_mode_list); /** * @fn CelestialInformation * @brief Copy constructor diff --git a/src/environment/global/earth_rotation.cpp b/src/environment/global/earth_rotation.cpp index cb25d6bfd..2f8218dde 100644 --- a/src/environment/global/earth_rotation.cpp +++ b/src/environment/global/earth_rotation.cpp @@ -262,11 +262,11 @@ libra::Matrix<3, 3> EarthRotation::PolarMotion(const double x_p, const double y_ EarthRotationMode ConvertEarthRotationMode(const std::string mode) { EarthRotationMode rotation_mode; - if (mode == "Idle") { + if (mode == "IDLE") { rotation_mode = EarthRotationMode::kIdle; - } else if (mode == "Simple") { + } else if (mode == "SIMPLE") { rotation_mode = EarthRotationMode::kSimple; - } else if (mode == "Full") { + } else if (mode == "FULL") { rotation_mode = EarthRotationMode::kFull; } else // if rotation_mode is neither Idle, Simple, nor Full, set rotation_mode to Idle { diff --git a/src/environment/global/moon_rotation.cpp b/src/environment/global/moon_rotation.cpp index 6595ff6af..75ede8b33 100644 --- a/src/environment/global/moon_rotation.cpp +++ b/src/environment/global/moon_rotation.cpp @@ -38,11 +38,11 @@ void MoonRotation::Update(const SimulationTime& simulation_time) { MoonRotationMode ConvertMoonRotationMode(const std::string mode) { MoonRotationMode rotation_mode; - if (mode == "Idle") { + if (mode == "IDLE") { rotation_mode = MoonRotationMode::kIdle; - } else if (mode == "Simple") { + } else if (mode == "SIMPLE") { rotation_mode = MoonRotationMode::kSimple; - } else if (mode == "IauMoon") { + } else if (mode == "IAU_MOON") { rotation_mode = MoonRotationMode::kIauMoon; } else // if rotation_mode is neither Idle, Simple, nor Full, set rotation_mode to Idle {