This project provides a FastAPI
-based service for density prediction using a Transformer
model.
Accurate density estimations of the Thermosphere are essential for all spacecraft operations in
low earth orbit. Density estimation is a part of the Space Weather prediction process.
root/ # Repository root
│
├── docs # Documentation. . Not in Repo!
└── libs/density_prediction # Package root
├── Dockerfile
├── poetry.lock
├── pyproject.toml
├── README.md # This file
├── app # FastAPI application
├── logs # Log files
├── scripts # Scripts for building and running the Docker container
└── tests # Unit tests
- Python 3.10+
- Poetry 1.8+
-
Clone the repository:
git clone https://github.com/leo-gan/density_prediction cd <repository_directory>
-
Install Poetry if you haven't already:
curl -sSL https://install.python-poetry.org | python3 -
-
Install the required packages:
poetry install
-
Activate the virtual environment:
poetry shell
Set the MODEL_PATH
environment variable to point to your model file. You can also modify the default path in libs/density_prediction/app/config/settings.py
.
To start the FastAPI server, run:
bash libs/density_prediction/scripts/start_server.sh
To stop the FastAPI server, run:
bash libs/density_prediction/scripts/stop_server.sh