PFS spectral simulator web app using PFS Exposure Time Calculator and Spectrum Simulator.
See requirements.txt
for the latest dependencies.
For production:
- python (>=3.9)
- panel (>=1.2)
- astropy
- jinja2
- loguru
- matplotlib
- myst-parser
- numpy
- pandas
- setuptools
- synphot
- pfsspecsim @ git+https://github.com/Subaru-PFS/spt_ExposureTimeCalculator.git
For development:
- black
- ipython
- jupyter
- notebook
- pip
- ruff
- pyright
- isort
- specutils
For documentation:
- mkdocs
- mkdocs-material
- mkdocs-macros-plugin
- mkdocs-video
- fontawesome-markdown
First of all, please clone this repository. There are several ways to install the app.
python3 -m venv .
source .venv/bin/activate
# if you use pip
python3 -m pip install -r requirements.txt
python3 -m pip install -e .
# if you use pdm
pdm install
If you wish to build documentation, run the following command in the docs
directory.
cd docs
# if you use pip
mkdocs build
cd ../
# if you use pdm
pdm run mkdocs build
The documentation is built under docs/site
.
If you have Docker installed, you can run the Docker image as follows.
docker run -it -p 8080:8080 --rm monodera/pfs_etc_web
You can deploy the app to Google Cloud Run.
gcloud run deploy pfsetcweb --source .
You can run the app by using the panel serve
as follows.
# installed via pip
panel serve ./app.py --static-dirs etc-docs="./docs/site/"
# installed via pdm
pdm run panel serve ./app.py --static-dirs etc-docs="./docs/site/"
Then open http://localhost:5006/app
in a web browser.
You can specify the number of threads used by the ETC using OMP_NUM_THREADS
environment variable. A larger number of threads will enable to achieve faster running time, but reduce the per-thread efficiency of the computation. My experiment with AMD EPYC 7542 is summarized as follows.
OMP_NUM_THREADS | time (s) |
---|---|
1 | 274.09 |
2 | 158.04 |
4 | 82.05 |
8 | 45.94 |
16 | 23.91 |
32 | 13.17 |
64 | 7.99 |
128 | 4.83 |
Open http://localhost:8080/app
in a web browser.
Open your app URL in a web browser.