Skip to content

snad-space/ztf-viewer

Repository files navigation

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:

  • CACHE_TYPE: cache type, specify redis to use redis server, or memory to use in-process cache
  • UNAVAILABLE_CATALOGS_CACHE_TYPE: unavailable catalog cache type, specify redis to use redis server, or memory to use in-process cache
  • REDIS_URL: redis server address
  • LC_API_URL: SNAD ZTF database API address
  • AKB_API_URL: knowledge database address
  • FEATURES_API_URL: feature extraction service address
  • OGLE_III_API_URL: SNAD OGLE III mirror address
  • ZTF_PERIODIC_API_URL: SNAD mirror of the ZTF periodic variables catalog
  • TNS_API_URL: SNAD mirror of the TNS
  • ZTF_FITS_PROXY_URL: address of SNAD proxy for ZTF FITS
  • JS9_URL: address of full-functional JS9 viewer supporting JS9.LoadProxy

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