cabaret is a Python package to simulate astronomical images using the GAIA catalog of stars.
You can install cabaret in a Python (>=3.11
) environment with
pip install cabaret
or from a local clone
git clone https://github.com/ppp-one/cabaret
pip install -e cabaret
You can test the package has been properly installed with
python -c "import cabaret"
To generate an image from RA/DEC coordinates and a field of vue specified in degrees:
import cabaret
ra, dec = 12.3323, 30.4343 # in degrees
exposure_time = 10 # in seconds
image = cabaret.generate_image(ra, dec, exposure_time)
and to display the image (matplotlib
required here):
import matplotlib.pyplot as plt
plt.imshow(image)
To adjust the physical characteristics of the camera, you can define and pass a Camera
object. Similary, one can pass Telescope
and Site
objects to define the telescope and site characteristics, respectively.
import cabaret
from cabaret import Camera
camera = Camera(read_noise=10, gain=1)
ra, dec = 12.3323, 30.4343 # in degrees
exposure_time = 10 # in seconds
image = cabaret.generate_image(ra, dec, exposure_time, camera=camera)