Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify data directory #668

Merged
merged 75 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
a55c615
Move logs directory
200km Jul 20, 2024
38b6b8c
Modify path to logs directory
200km Jul 20, 2024
0e2fb49
Modify path to logs directory
200km Jul 20, 2024
dbd5883
Move and rename initialize_files
200km Jul 20, 2024
57efaba
Fix initialize_files path
200km Jul 20, 2024
3720ab5
Fix to use macro
200km Jul 20, 2024
e7b06ed
Add environment directory in settings
200km Jul 20, 2024
bcf5f6b
Move gnss directory
200km Jul 20, 2024
fbe9736
Make sample_satellite directory
200km Jul 20, 2024
50a00a3
Move to sample_satellite directory
200km Jul 20, 2024
87358f1
Make sample_ground_station directory
200km Jul 20, 2024
20af6ac
Update file path
200km Jul 20, 2024
07ae818
Make ground_station/components
200km Jul 20, 2024
606af83
Add antenna pattern for ground station
200km Jul 20, 2024
0c33f8d
Fix data directory in s2e
200km Jul 20, 2024
536052a
Fix to use GITHUB_OUTPUT
200km Jul 20, 2024
dcd4839
Fix small
200km Jul 20, 2024
0bd6d36
Fix small
200km Jul 20, 2024
ecf0daf
Fix small
200km Jul 20, 2024
859389a
Fix data directory path in CI
200km Jul 21, 2024
c4b4edf
Modify default settings directory path
200km Jul 21, 2024
97107aa
Add EXT_LIB_DIR_FROM_EXE option to CI
200km Jul 21, 2024
57c8a85
Fix Linux build
200km Jul 21, 2024
2279318
Fix INI file path
200km Jul 21, 2024
6090585
Add CORE_DIR_FROM_EXE setting in CI
200km Jul 21, 2024
cf8aebf
Fix simulation config setting
200km Jul 21, 2024
8cdc86b
Fix simulation config setting
200km Jul 21, 2024
efff45b
Fix working directory for Win
200km Jul 21, 2024
7f4afcc
Revive shell:bash
200km Jul 21, 2024
ed38c9d
Merge branch 'feature/move-initialize-file-directory' into feature/re…
200km Jul 21, 2024
159361f
Fix ini file name
200km Jul 22, 2024
295c4c4
Merge pull request #661 from ut-issl/feature/move-logs-directory
200km Aug 8, 2024
fd45f1a
Merge pull request #662 from ut-issl/feature/move-initialize-file-dir…
200km Aug 9, 2024
8d31bf6
Merge pull request #663 from ut-issl/feature/refactor-settings
200km Aug 9, 2024
aa697fb
Merge with develop
200km Aug 25, 2024
cfb77ac
Move egm file to settings
200km Aug 25, 2024
b7a375d
Delete GeoPotential CMake
200km Aug 25, 2024
3a96fc9
Remove Geopotential CMake call
200km Aug 25, 2024
5fbb92b
Update download directory for lunar gravity field
200km Aug 25, 2024
076b337
Update default directory path for gravity field settings
200km Aug 25, 2024
d2ae413
Move IGRF coeff files to settings
200km Aug 25, 2024
a195423
Update directory path to the IGRF coefficient
200km Aug 25, 2024
f68bf7e
Add space wheather directory
200km Aug 25, 2024
f8ebcd9
Modify nrlmsise CMake
200km Aug 25, 2024
31c420f
Update directory path for space wheather
200km Aug 25, 2024
4ce4458
Fix typo
200km Aug 25, 2024
c9e52a2
Fix CI
200km Aug 25, 2024
7da5987
Add cspice directory in settings/environment
200km Aug 25, 2024
d7aa8ef
Update generic kernel storing directory
200km Aug 25, 2024
4cc78bf
Update directory path for CSPICE kernels
200km Aug 25, 2024
08f4628
Add star catalogue directory
200km Aug 25, 2024
5ebaedf
Fix hip catalogue download directory
200km Aug 25, 2024
817965a
Update directory path to the hip catalogue
200km Aug 25, 2024
ea5c6bc
Merge pull request #676 from ut-issl/feature/add-gravity-field-settin…
200km Aug 25, 2024
19010e4
Merge pull request #677 from ut-issl/feature/add-magnetic-field-setti…
200km Aug 25, 2024
7965d62
Merge pull request #678 from ut-issl/feature/add-space-wheather-direc…
200km Aug 25, 2024
c6602a7
Merge pull request #679 from ut-issl/feature/add-cspice-settings
200km Aug 25, 2024
409652e
Merge pull request #680 from ut-issl/feature/add-star-catalogue
200km Aug 25, 2024
254cd78
Add gitignore for new setting files
200km Aug 25, 2024
e8646bf
Rename INI_FILE_DIR_FROM_EXE to SETTINGS_DIR_FROM_EXE
200km Aug 25, 2024
0c9ddc3
Fix Actions setting
200km Aug 25, 2024
f5ee306
modify extlib directory definition
200km Aug 25, 2024
f518c3c
Add setting file copy when cache is available
200km Aug 25, 2024
e51be0d
Fix small
200km Aug 25, 2024
eaa00e5
Fix directory
200km Aug 25, 2024
bb0a2f7
Merge pull request #681 from ut-issl/feature/add-ignore-for-new-setti…
200km Aug 25, 2024
5177e13
Merge pull request #682 from ut-issl/feature/rename-preprocessor-for-…
200km Aug 25, 2024
48b4e05
Add copied file checking
200km Aug 25, 2024
8d40c5e
Add copied file checking
200km Aug 25, 2024
b6e6b08
Merge pull request #683 from ut-issl/feature/modify-extlib-cmake
200km Aug 25, 2024
098952e
Fix directory
200km Aug 25, 2024
7d6b200
Fix directory
200km Aug 25, 2024
894a63b
Fix directory
200km Aug 25, 2024
edf63e4
Fix
200km Aug 25, 2024
503493e
Merge pull request #684 from ut-issl/feature/fix-actions-cache
200km Aug 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 38 additions & 16 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 All @@ -149,8 +160,8 @@ jobs:
run: |
COMPILER="${{ matrix.compiler }}"
read -r -a COMPILER <<< "$COMPILER"
echo "::set-output name=CC::${COMPILER[0]}"
echo "::set-output name=CXX::${COMPILER[1]}"
echo "CC=${COMPILER[0]}" >> "$GITHUB_OUTPUT"
echo "CXX=${COMPILER[1]}" >> "$GITHUB_OUTPUT"

- name: install deps
run: |
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.
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