snad-space / ztf-viewer

ZTF data releases light curve viewer
http://ztf.snad.space
MIT License
14 stars 2 forks source link

SNAD ZTF DR web viewer

This projects contains a source of ZTF Data Releases light curve viewer developed by the SNAD team.

Evaluation

Both production and development versions can be started via Docker compose using docker-compose.yml and docker-compose.dev.yml correspondingly. Current production configuration assumes that there is a Docker proxy network shared with jwilder/nginx-proxy which proxies the webserver to the outer world. Also, this configuration require secret.env file containing secret environment variables, such as API keys.

Environment variables

Environment variables to configure the server, see default values in config.py:

Running development docker-compose

You could run a development version of the server at http://127.0.0.1:8050 using docker-compose.dev.yml file:

docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build

This will run Dash/Flask server in debug mode and will reload the server on code changes if you mount the source code directory ztf_viewer as a volume:

docker compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.dev.local.yml up --build

Running without docker

The server can be run locally without Docker in debug mode.

# Configure Python virtual environment
python3 -m venv ~/.virtualenv/ztf-viewer
source ~/.virtualenv/ztf-viewer/bin/activate

# Install the package
python -m pip install -e .

# Run webserver
CACHE_TYPE="memory" UNAVAILABLE_CATALOGS_CACHE_TYPE="memory" python -m ztf_viewer

Go to the url specified in the command line output, it should be something like http://localhost:8050/ Some features like FITS viewer wouldn't work.

Web-services used by the viewer