If you are an experienced git user, you can skip this section and go to the next one.
To contribute work to the GitHub repository, we recommend using GitHub Desktop.
It has an easy to use graphical interface that allows you to clone, pull, commit, and push to repositories.
Download the installer, follow the instructions, then open the application and log in with your GitHub account.
In GitHub Desktop, select File --> Clone repository... and select the TOLOSAT/mission-analysis repository.
You can place it wherever you want on your machine.
Once the repository is cloned, you can proceed to step 2.
If you already have Anaconda installed, you can use it. Otherwise, we recommend installing Miniforge.
On Mac, you will use the Terminal. On Windows, you will use Anaconda prompt or Miniforge prompt.
Navigate to the Python folder in the repository
Use the cd command to navigate to the python sub-folder within the mission-analysis repository. Your active directory should look like this:
.../GitHub/mission-analysis/python
Example command:
cd [path_to_repository]/mission-analysis/python
Create the environment
Next, run the following command to create the environment with Python 3.9:
conda create -n tolosat-tudatpy python=3.9
conda activate tolosat-tudatpy
Update the environment with project dependencies
After activating the environment, update it with the project dependencies by running:
conda env update -n tolosat-tudatpy -f environment.yaml
If any conflicts arise during this process, press CTRL+C to cancel the operation and reach out to the team for assistance.
Once the installation is complete, you can proceed to the next step.
If you already have a Python IDE of preference, you can use it, but you will need to configure the Python interpreter yourself.
We recommend using PyCharm. A professional license is provided for free to students by applying here.
Once installed, proceed to step 3.2.
In PyCharm, select File --> Open... and select the mission-analysis folder.
This will open the full project.
In the bottom right corner, you should see a Python interpreter dropdown menu. Follow the next steps:
- Click on the dropdown menu and select
Add New Interpreter - Click
Add Local Interpreter... - In the left panel, select
Conda Environment - In the
Interpreterdropdown menu, selecttolosat-tudatpy - Click
OK
Then, right-click on the python folder and select Mark Directory as --> Sources Root.
In PyCharm, open the python\examples\perturbed_satellite_orbit.py file and run it with right-click
--> Run 'perturbed_satellite_orbit'.
If everything is set up correctly, you should see the following output:
State vector contains:
Vector entries, Vector contents
[0:6], translational state of body Delfi-C3
Dependent variables being saved, output vector contains:
Vector entry, Vector contents
0, Total acceleration in inertial frame of Delfi-C3
3, Kepler elements of Delfi-C3 w.r.t. Earth
9, Spherical position angle latitude angle of Delfi-C3 w.r.t. Earth
10, Spherical position angle longitude angle of Delfi-C3 w.r.t. Earth
11, Single acceleration norm of type central gravity , acting on Delfi-C3, exerted by Sun
12, Single acceleration norm of type central gravity , acting on Delfi-C3, exerted by Moon
13, Single acceleration norm of type central gravity , acting on Delfi-C3, exerted by Mars
14, Single acceleration norm of type central gravity , acting on Delfi-C3, exerted by Venus
15, Single acceleration norm of type spherical harmonic gravity , acting on Delfi-C3, exerted by Earth
16, Single acceleration norm of type aerodynamic , acting on Delfi-C3, exerted by Earth
17, Single acceleration norm of type cannonball radiation pressure , acting on Delfi-C3, exerted by Sun
Process finished with exit code 0
A total of four plots should also be displayed.
To run scripts in the Python console, which allows to keep interacting with them after they are run and to see all the variables and their value, you can follow the next steps:
- In the dropdown menu at the top right of your screen, left of the green
Runbutton, clickEdit Configurations... - In the
Executioncategory, enableRun in Python Console - Click
OK
You can now run the script again with the green Run button in the right corner.
The script will now run in the Python console and you will see all the variables created along with their type and
value.
- Exit Code -1066598273 (0xC06D007F): This error is caused by a binary compatibility mismatch with the required TudatPy version. To solve it, activate the environment and downgrade numpy by running the following command:
conda install numpy=1.23