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
.
Use the cd [path_to_repository]
command to navigate to the python
sub-folder of the mission-analysis
repository.
Your active path should look something like this: .../GitHub/mission-analysis/python
.
Then, run the following command to create the environment:
conda env create -f environment.yaml
If any conflict is detected, use CTRL+C
to cancel the operation and seek help from the team.
Once the installation is completed, you can proceed to step 3.
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
Interpreter
dropdown 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
Run
button, clickEdit Configurations...
- In the
Execution
category, 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.