diff --git a/src/constellation_generation/by_TLE/constellation_configuration.py b/src/constellation_generation/by_TLE/constellation_configuration.py index cea91e65..4bc94790 100644 --- a/src/constellation_generation/by_TLE/constellation_configuration.py +++ b/src/constellation_generation/by_TLE/constellation_configuration.py @@ -34,6 +34,10 @@ def constellation_configuration(dT , constellation_name): # calculate and save the longitude, latitude and altitude information of different satellites according to shell # and timeslot + # ensure the data/TLE_constellation/ directory exists + data_directory = "data/TLE_constellation/" + # This will create the directory if it does not exist + os.makedirs(data_directory, exist_ok=True) # determine whether the .h5 file of the delay and satellite position data of the current constellation exists. If # it exists, delete the file and create an empty .h5 file. If it does not exist, directly create an empty .h5 file. file_path = "data/TLE_constellation/" + constellation_name + ".h5" diff --git a/src/constellation_generation/by_XML/constellation_configuration.py b/src/constellation_generation/by_XML/constellation_configuration.py index f5d67966..3c7cf08b 100644 --- a/src/constellation_generation/by_XML/constellation_configuration.py +++ b/src/constellation_generation/by_XML/constellation_configuration.py @@ -51,6 +51,10 @@ def constellation_configuration(dT , constellation_name): # convert string to int type number_of_shells = int(constellation_configuration_information['constellation']['number_of_shells']) shells = [] + # ensure the data/XML_constellation/ directory exists + data_directory = "data/XML_constellation/" + # This will create the directory if it does not exist + os.makedirs(data_directory, exist_ok=True) # determine whether the .h5 file of the delay and satellite position data of the current constellation exists. If # it exists, delete the file and create an empty .h5 file. If it does not exist, directly create an empty .h5 file. file_path = "data/XML_constellation/" + constellation_name + ".h5"