Web Interface of AstroPlasma
This is a web interface for the AstroPlasma repository which allows you to interpolate the plasma properties from the pre-computed dataset from the cloudy.
- Compute Ionization Fraction of the Specific Element and Ion
- Plot Ion fraction vs temperature graph for both CIE and PIE modes
- Plot emission spectrum of the elements
- Interactive graphs
- Simple file server to download the batch file on demand (used internally in upstream AstroPlasma repository)
- Docker engine
- Poetry
- Python 3.9+
- Git CLI
- Dataset mounted using nfs (Contact me or @dutta-alankar)
-
Clone the repository
git clone https://github.com/tbhaxor/CloudyInterpolator.git cd CloudyInterpolator
-
Install the packages
poetry install
Note This command will automatically set-up virtual environment for you.
-
Provide environment file
cat <<EOF > .env IONIZATION_DATASET_DIR='/path/to/directory/containing/ionization-batches' EMISSION_DATASET_DIR='/path/to/directory/containing/emission-batches' PY_ENV=dev EOF
Note Omit
PY_ENV=dev
if you want to deploy it on the production -
Migrate the database
poetry run python manage.py migrate
Once you have performed the steps from the Setup, you are good to go
poetry run python manage.py runserver
This will open the 8000
port by default, but you can change it using the following command
poetry run 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 and docker compose installed on your system
-
Generate docker compose file from the template file
bash deployment/scripts/gen-docker-compose.bash -c http://example.com -i /path/to/ionization/dataset -e /path/to/emission/dataset
Note Let's suppose I am hosting my webserver on the http://example.com, so it should be the value of
-c
argument. You can provide multiple origins separated by comma and without any spaces. -
Run the workload
docker-compose up --pull always
Note You can access the server at port http://localhost:8000.
The configuration template named as docker-compose.local.yml
is now a recommended version as code is not frequently built.
- Generate docker compose file from the template file
bash deployment/scripts/gen-docker-compose.bash -s docker-compose.local.yml -c http://example.com -i /path/to/ionization/dataset -e /path/to/emission/dataset
-
Install the dependencies
poetry install
-
Generate static files
poetry run ./manage.py collectstatic --noinput --skip-checks
-
Run the server
docker-compose up --pull always
Note You can access the server at port http://localhost:8000.