Installation

Requirements

  • Python 3.11 or newer.

  • The scientific stack, pulled in automatically as dependencies: numpy, scipy, astropy, synphot, matplotlib, pandas, photutils, bokeh, tifffile, and lazuli-exo (the transit models).

Using a conda environment

The synphot, astropy and photutils stack is happiest in a dedicated environment:

conda create -n wcc-etc python=3.11
conda activate wcc-etc
pip install -e .

Verify the installation

import wcc_etc
print(wcc_etc.__version__)

from wcc_etc import get_scene, Simulation
scene = get_scene("K3IV", mag=20)
sim = Simulation.from_sensor_and_scene("sony:bb", scene)
print(sim.get_snr(10)["snr"])

If that prints a version string and a signal-to-noise value, continue with Quick start.

Running the test suite

The package ships with a pytest suite. From the repository root:

pip install -e .      # editable install so tests see local src/ changes
pytest

Building the documentation locally

The documentation is built with Sphinx and the Read the Docs theme. The tutorial pages are rendered from the Jupyter notebooks by nbsphinx, which needs pandoc installed.

# from the repository root
pip install -e ".[docs]"                      # the package + Sphinx + theme + nbsphinx
# plus a pandoc binary, e.g.  conda install pandoc   or   brew install pandoc

cd docs/sphinx
make html

Open docs/sphinx/_build/html/index.html in a browser. To force a clean rebuild, run make clean html. The build re-executes every tutorial notebook and every figure in the user guide, so it doubles as a smoke test of the public API and takes several minutes.