Skip to content

Commit

Permalink
Merge pull request #668 from ut-issl/feature/modify-settings
Browse files Browse the repository at this point in the history
Modify data directory
  • Loading branch information
200km authored Aug 25, 2024
2 parents 2d2ad11 + 503493e commit 1a65545
Show file tree
Hide file tree
Showing 68 changed files with 483 additions and 100 deletions.
50 changes: 36 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
working-directory: ./ExtLibraries
run: |
cmake --install .
- name: check extlib
shell: powershell
working-directory: ./ExtLibraries
Expand All @@ -99,38 +100,48 @@ jobs:
ls cspice/include
ls cspice/generic_kernels
ls nrlmsise00
ls nrlmsise00/table
ls nrlmsise00/lib*
ls nrlmsise00/lib*/libnrlmsise00.lib
ls nrlmsise00/src
- name: copy to settings
if: steps.cache-extlib.outputs.cache-hit == 'true'
shell: powershell
run: |
ls ./settings/environment/cspice
cp -r "./ExtLibraries/cspice/generic_kernels" "./settings/environment/cspice"
ls ./settings/environment/cspice
ls ./settings/environment/cspice/generic_kernels/lsk
ls ./settings/environment/cspice/generic_kernels/pck
ls ./settings/environment/cspice/generic_kernels/spk
- name: build 32bit
if: matrix.build_bit == 'BUILD_64BIT=OFF'
shell: cmd
run: |
cl.exe
cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DEXT_LIB_DIR=./ExtLibraries -DFLIGHT_SW_DIR=./c2a-core -DC2A_NAME=Examples/minimum_user -D${{ matrix.use_c2a }} -D${{ matrix.build_bit }}
cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DSETTINGS_DIR_FROM_EXE=./settings -DCORE_DIR_FROM_EXE=./ -DEXT_LIB_DIR=./ExtLibraries -DEXT_LIB_DIR_FROM_EXE=./ExtLibraries -DFLIGHT_SW_DIR=./c2a-core -DC2A_NAME=Examples/minimum_user -D${{ matrix.use_c2a }} -D${{ matrix.build_bit }}
cmake --build .
- name: build 64bit
if: matrix.build_bit == 'BUILD_64BIT=ON' && matrix.use_c2a == 'USE_C2A=OFF'
shell: cmd
run: |
cl.exe
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DEXT_LIB_DIR=./ExtLibraries -DFLIGHT_SW_DIR=./c2a-core -DC2A_NAME=Examples/minimum_user -D${{ matrix.use_c2a }} -D${{ matrix.build_bit }}
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DSETTINGS_DIR_FROM_EXE=./settings -DCORE_DIR_FROM_EXE=./ -DEXT_LIB_DIR=./ExtLibraries -DEXT_LIB_DIR_FROM_EXE=./ExtLibraries -DFLIGHT_SW_DIR=./c2a-core -DC2A_NAME=Examples/minimum_user -D${{ matrix.use_c2a }} -D${{ matrix.build_bit }}
cmake --build .
- name: fix simulation config
shell: bash
working-directory: ./data/sample/initialize_files
working-directory: ./settings
run: |
find . -type f -name '*.ini' -exec sed -i 's/..\/..\/..\/ExtLibraries/..\/..\/ExtLibraries/g' {} \;
find . -type f -name '*.ini' -exec sed -i 's/..\/..\/logs/.\/logs/g' {} \;
- name: run simulation(SampleSat)
if: matrix.build_bit == 'BUILD_64BIT=OFF' || (matrix.build_bit == 'BUILD_64BIT=ON' && matrix.use_c2a == 'USE_C2A=OFF')
working-directory: ./data/sample
working-directory: ./
run: |
..\..\Debug\S2E.exe
.\Debug\S2E.exe
build_s2e_linux:
name: Build on Linux
Expand Down Expand Up @@ -190,6 +201,7 @@ jobs:
working-directory: ./ExtLibraries
run: |
cmake --install .
- name: check extlib
working-directory: ./ExtLibraries
run: |
Expand All @@ -198,35 +210,45 @@ jobs:
ls cspice/include
ls cspice/generic_kernels
ls nrlmsise00
ls nrlmsise00/table
ls nrlmsise00/lib*
ls nrlmsise00/lib*/libnrlmsise00.a
ls nrlmsise00/src
- name: copy to settings
if: steps.cache-extlib.outputs.cache-hit == 'true'
run: |
ls ./settings/environment/cspice
cp -r "./ExtLibraries/cspice/generic_kernels" "./settings/environment/cspice"
ls ./settings/environment/cspice
ls ./settings/environment/cspice/generic_kernels/lsk
ls ./settings/environment/cspice/generic_kernels/pck
ls ./settings/environment/cspice/generic_kernels/spk

- name: build
env:
CC: ${{ steps.compiler.outputs.CC }}
CXX: ${{ steps.compiler.outputs.CXX }}
run: |
cmake . -DEXT_LIB_DIR=./ExtLibraries -D${{ matrix.build_bit }}
cmake . -DEXT_LIB_DIR=./ExtLibraries -DEXT_LIB_DIR_FROM_EXE=./ExtLibraries -DSETTINGS_DIR_FROM_EXE=./settings -DCORE_DIR_FROM_EXE=./ -D${{ matrix.build_bit }}
cmake --build .
- name: fix simulation config
working-directory: ./data/sample/initialize_files
working-directory: ./settings
run: |
find . -type f -name '*.ini' -exec sed -i 's/..\/..\/..\/ExtLibraries/..\/..\/ExtLibraries/g' {} \;
find . -type f -name '*.ini' -exec sed -i 's/..\/..\/logs/.\/logs/g' {} \;
- name: run simulation(SampleSat)
working-directory: ./data/sample
working-directory: ./
run: |
../../S2E
./S2E
- name: generate graph
working-directory: ./scripts/Plot
run: |
sudo apt-get install -y gnuplot
pip3 install yq
LOG=$(ls ../../data/sample/logs/logs_*/*.csv)
LOG=$(ls ../../logs/logs_*/*.csv)
echo "plot $LOG"
./gen_graph.sh "${LOG}"
ls
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/google-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ jobs:
ls cspice/include
ls cspice/generic_kernels
ls nrlmsise00
ls nrlmsise00/table
ls nrlmsise00/lib*
ls nrlmsise00/lib*/libnrlmsise00.a
ls nrlmsise00/src
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ src/.vscode/
build/

# Log files
data/**/logs/
**/logs/

# CSIPCE
scripts/tmp_cspice/
Expand All @@ -34,3 +34,9 @@ Icon

# Python
__pycache__/

# Setting files
settings/environment/cspice
settings/environment/space_weather
settings/environment/gravity_field
settings/environment/star_catalogue
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ if(NOT DEFINED C2A_NAME)
endif()

## Directory path for ini files
if(NOT DEFINED INI_FILE_DIR_FROM_EXE)
set(INI_FILE_DIR_FROM_EXE ../../data/sample/initialize_files)
if(NOT DEFINED SETTINGS_DIR_FROM_EXE)
set(SETTINGS_DIR_FROM_EXE ../../settings)
endif()

if(NOT DEFINED EXT_LIB_DIR_FROM_EXE)
Expand Down
6 changes: 5 additions & 1 deletion ExtLibraries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ if(NOT DEFINED EXT_LIB_DIR)
set(EXT_LIB_DIR "${CMAKE_CURRENT_LIST_DIR}/../../ExtLibraries/")
endif()

if(NOT DEFINED SETTINGS_DIR)
set(SETTINGS_DIR "${CMAKE_CURRENT_LIST_DIR}/../settings/")
endif()

# windows path
string(REPLACE "\\" "/" EXT_LIB_DIR ${EXT_LIB_DIR})
string(REPLACE "\\" "/" SETTINGS_DIR ${SETTINGS_DIR})

message("ExtLibraries install dir: ${EXT_LIB_DIR}")

add_subdirectory(nrlmsise00)
add_subdirectory(cspice)
add_subdirectory(GeoPotential)
add_subdirectory(lunar_gravity_field)
11 changes: 0 additions & 11 deletions ExtLibraries/GeoPotential/CMakeLists.txt

This file was deleted.

4 changes: 3 additions & 1 deletion ExtLibraries/cspice/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ include(FetchContent)
set(CSPICE_INSTALL_DIR ${EXT_LIB_DIR}/cspice)
set(GENERIC_KERNEL_URL_BASE https://naif.jpl.nasa.gov/pub/naif/generic_kernels)

set(GENERIC_KERNEL_INSTALL_DIR ${SETTINGS_DIR}/environment/cspice)

if(WIN32)
# Windows
if(BUILD_64BIT)
Expand Down Expand Up @@ -118,5 +120,5 @@ configure_file(
)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generic_kernels
DESTINATION ${CSPICE_INSTALL_DIR}
DESTINATION ${GENERIC_KERNEL_INSTALL_DIR}
)
2 changes: 1 addition & 1 deletion ExtLibraries/lunar_gravity_field/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.18)

include(FetchContent)

set(LUNAR_GRAVITY_FIELD_INSTALL_DIR ${EXT_LIB_DIR}/lunar_gravity_field)
set(LUNAR_GRAVITY_FIELD_INSTALL_DIR ${SETTINGS_DIR}/environment/gravity_field)

set(LUNAR_GRAVITY_FIELD_URL_BASE https://pds-geosciences.wustl.edu/grail/grail-l-lgrs-5-rdr-v1/grail_1001/shadr)
set(LUNAR_GRAVITY_FIELD_FILE gggrx_1200a_sha.tab)
Expand Down
3 changes: 2 additions & 1 deletion ExtLibraries/nrlmsise00/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include(ExternalProject)
include(FetchContent)

set(NRLMSISE_INSTALL_DIR ${EXT_LIB_DIR}/nrlmsise00)
set(TABLE_FILE_INSTALL_DIR ${SETTINGS_DIR}/environment/space_weather)

set(NRLMSISE_TABLE_URL_BASE ftp://ftp.agi.com/pub/DynamicEarthData)
set(NRLMSISE_TABLE_FILE SpaceWeather-v1.2.txt)
Expand Down Expand Up @@ -90,5 +91,5 @@ install(FILES ${NRLMSISE_TMP_DIR}/nrlmsise-00_data.c

## install table
install(FILES ${NRLMSISE_TMP_DIR}/${NRLMSISE_TABLE_FILE}
DESTINATION ${NRLMSISE_INSTALL_DIR}/table
DESTINATION ${TABLE_FILE_INSTALL_DIR}
)
2 changes: 1 addition & 1 deletion common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${S2E_DIR}/src)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

# Directory path setting
target_compile_definitions(${PROJECT_NAME} PRIVATE "INI_FILE_DIR_FROM_EXE=\"${INI_FILE_DIR_FROM_EXE}\"")
target_compile_definitions(${PROJECT_NAME} PRIVATE "SETTINGS_DIR_FROM_EXE=\"${SETTINGS_DIR_FROM_EXE}\"")
target_compile_definitions(${PROJECT_NAME} PRIVATE "EXT_LIB_DIR_FROM_EXE=\"${EXT_LIB_DIR_FROM_EXE}\"")
target_compile_definitions(${PROJECT_NAME} PRIVATE "CORE_DIR_FROM_EXE=\"${CORE_DIR_FROM_EXE}\"")

Expand Down

This file was deleted.

12 changes: 0 additions & 12 deletions data/sample/initialize_files/sample_ground_station.ini

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/Common/download_HIPcatalogue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
cd `dirname $0`

#set variables
DIR_TMP=../../../ExtLibraries/tmp_hipcatalogue/
DIR_HIPCATALOGUE=../../../ExtLibraries/HipparcosCatalogue/
DIR_TMP=./tmp_hipcatalogue/
DIR_HIPCATALOGUE=../../settings/environment/star_catalogue/

mkdir -p $DIR_TMP
mkdir -p $DIR_HIPCATALOGUE
Expand Down
2 changes: 1 addition & 1 deletion scripts/Plot/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def read_scalar_from_csv(read_file_name, header_name):
return vector

def add_log_file_arguments(aparser):
aparser.add_argument('--logs-dir', type=str, help='logs directory like "../../data/sample/logs"', default='../../data/sample/logs')
aparser.add_argument('--logs-dir', type=str, help='logs directory like "../../logs"', default='../../logs')
aparser.add_argument('--file-tag', type=str, help='log file tag like 220627_142946')
return aparser

Expand Down
2 changes: 1 addition & 1 deletion scripts/Plot/plot_gs_visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
print("log: " + read_file_tag)

# Read Gound Station position from the ini file in the logs directory
gs_ini_file_name = path_to_logs + '/' + 'logs_' + read_file_tag + "/sample_ground_station.ini"
gs_ini_file_name = path_to_logs + '/' + 'logs_' + read_file_tag + "/ground_station.ini"
configur = ConfigParser(comment_prefixes=('#', ';', '//'), inline_comment_prefixes=('#', ';', '//'))
configur.read(gs_ini_file_name)
gs_lat_deg = configur.getfloat('GROUND_STATION_0', 'latitude_deg')
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[GNSS_SATELLITES]
directory_path = INI_FILE_DIR_FROM_EXE/gnss/final_products/
directory_path = SETTINGS_DIR_FROM_EXE/environment/gnss/final_products/
calculation = DISABLE
logging = DISABLE

Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tx_antenna_gain_model = ISOTROPIC
tx_gain_dBi = 12.0

// Antenna radiation pattern CSV file path
tx_antenna_radiation_pattern_file = INI_FILE_DIR_FROM_EXE/components/antenna_radiation_pattern_csv_files/sample_antenna_radiation_pattern.csv
tx_antenna_radiation_pattern_file = SETTINGS_DIR_FROM_EXE/components/antenna_radiation_pattern_csv_files/sample_antenna_radiation_pattern.csv
// General information of the CSV file
tx_length_theta = 360
tx_length_phi = 181
Expand Down Expand Up @@ -65,7 +65,7 @@ rx_antenna_gain_model = ISOTROPIC
rx_gain_dBi = 43.27

// Antenna radiation pattern CSV file path
rx_antenna_radiation_pattern_file = INI_FILE_DIR_FROM_EXE/components/antenna_radiation_pattern_csv_files/sample_antenna_radiation_pattern.csv
rx_antenna_radiation_pattern_file = SETTINGS_DIR_FROM_EXE/sample_ground_station/components/antenna_radiation_pattern_csv_files/sample_antenna_radiation_pattern.csv
// General information of the CSV file
rx_length_theta = 360
rx_length_phi = 181
Expand Down
12 changes: 12 additions & 0 deletions settings/sample_ground_station/ground_station.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[GROUND_STATION_0]
// Position of the ground station
latitude_deg = 26.140837
longitude_deg = 127.661483
height_m = 3.4

// The minimum limit of elevation to work the station
elevation_limit_angle_deg = 5.0

[COMPONENT_FILES]
ground_station_antenna_file = SETTINGS_DIR_FROM_EXE/sample_ground_station/components/ground_station_antenna.ini
ground_station_calculator_file = SETTINGS_DIR_FROM_EXE/sample_ground_station/components/ground_station_calculator.ini
Empty file.
Loading

0 comments on commit 1a65545

Please sign in to comment.