Installation
Requirements
Python 3.11 or newer.
wcc_etc0.1.0 or newer, the WCC exposure time calculator. It is on PyPI and is installed automatically as a dependency.The scientific stack pulled in automatically as dependencies:
numpy,scipy,astropy,astroquery,synphot,photutils,dust_extinctionandmatplotlib.
Install from PyPI
pip install wcc-sim
Install from source
Install wcc-sim in editable mode so local changes to src/ are
picked up immediately; wcc_etc comes from PyPI with it:
git clone https://github.com/schmidt-observatories/wcc-sim.git
cd wcc-sim
pip install -e .
Optional extras add the test tools and the documentation toolchain:
pip install -e ".[test]" # pytest, ruff
pip install -e ".[docs]" # Sphinx, nbsphinx, the theme
Using a conda environment
The synphot / astropy / astroquery stack is happiest in a dedicated environment:
conda create -n wcc-sim python=3.13
conda activate wcc-sim
pip install -e <path-to-wcc-etc>
pip install -e .
Verify the installation
The quickest check runs a tiny noiseless simulation with a hand-made catalog (no network needed):
import numpy as np
from astropy.table import Table
from wcc_sim import simulate_field
cat = Table({
"source_id": [1], "ra": [150.1], "dec": [2.2],
"phot_g_mean_mag": [12.0], "phot_bp_mean_mag": [12.3],
"phot_rp_mean_mag": [11.6],
})
field = simulate_field(150.1, 2.2, catalog=cat, shape=(512, 512),
add_noise=False)
print(field.image_e.sum()) # total source electrons
If that prints a large positive number, you are ready to go. Continue with Quick start. (The first real simulation also needs network access for the Gaia DR3 cone search. Gaia catalogs describes the on-disk cache.)
Running the test suite
The package ships with a pytest suite (no network required, the Gaia
queries are mocked):
pip install -e ".[test]"
pytest
Building the documentation locally
The documentation you are reading is built with Sphinx and the Read the Docs theme. The tutorial pages are rendered from the Jupyter notebooks via nbsphinx, which requires pandoc to be 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.