This repository is used to download the batch files for astro plasma datasets: Emission spectrum and Ionization.
-
Clone the repository
git clone [email protected]:tbhaxor/CloudyPlasmaServer.git
-
Create and source a virtual environment (recommonded, but optional)
virtualenv .venv source .venv/bin/activate
-
Upgrade pip and install dependencies
pip install -U pip pip install -r requirements.txt
Note If you are maintaining or into development of this repository, please consider using poetry.
-
Provide environment file
cat <<EOF > .env IONIZATION_DATASET_DIR='/path/to/directory/containing/ionization-batches' EMISSION_DATASET_DIR='/path/to/directory/containing/emission-batches' EOF
-
Migrate the database
python manage.py migrate
Once you have performed the steps from the Setup, you are good to go
python manage.py runserver
This will open the 8000
port by default, but you can change it using the following command
python manage.py runserver 127.0.0.1:<PORT>
Replace the placeholder <PORT>
with the port number of your choice.
Get rid of all the hassle of setup and getting started. You can use the following
Requirements Docker runtime installed on your system
-
Pull the image
docker pull ghcr.io/tbhaxor/astro-data:latest
-
Run the docker container with appropriate container. This will iniitally create a container and start it
docker run -d -p 5000:5000 \ -e EMISSION_DATASET_DIR=/data/emission-data -e IONIZATION_DATASET_DIR=/data/ionization-data \ -v /path/of/emission/batches:/data/emission-data:ro -v /path/of/ionization/batches:/data/ionization-data:ro \ --name astro-data ghcr.io/tbhaxor/astro-data:latest
Note Replace the /path/* placeholder with the actual path of emission and ionization data on your host system.
This will start the server on the http://localhost:5000, you can open this url in the browser to interact with the server.
-
Stop and restart the server
# stop the container docker stop astro-data # restart the container docker start astro-data
Note On updates, all you need to do is follow docker setup from step 1. Make sure you delete the container (
docker rm -f astro-data
) before moving forward.