ScopeSim-Targets logo

ScopeSim Targets#

Simplified, unified target description model for the ScopeSim observation simulation engine.

Getting started#

Installation#

Recommended way to install the package is to simply use pip:

pip install scopesim-targets

Basic usage#

In the most basic example, we will set up a simple point source and observe it with ScopeSim using METIS imaging mode:

from scopesim import Simulation
from scopesim_targets.point_source import Star

target = Star(
    position=(0, 0),
    spectrum="G2V",
    brightness=("K", 18)
)

simulation = Simulation("MICADO")
simulation(target.to_source())

Hide code cell output

py.warnings - WARNING: /home/docs/checkouts/readthedocs.org/user_builds/scopesim-targets/envs/latest/lib/python3.14/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm

astar.scopesim.commands.user_commands - WARNING: Package could not be found: /home/docs/checkouts/readthedocs.org/user_builds/scopesim-targets/envs/latest/lib/python3.14/site-packages/scopesim/tests/mocks/MORFEO
Downloading file 'libraries/bosz/lr/g2v.fits' from 'https://scopesim.univie.ac.at/spextra/database/libraries/bosz/lr/g2v.fits' to '/home/docs/.spextra_cache'.
  0%|                                               | 0.00/700k [00:00<?, ?B/s]
  1%|▍                                     | 7.17k/700k [00:00<00:11, 62.2kB/s]
  2%|▊                                     | 14.3k/700k [00:00<00:11, 60.9kB/s]
  4%|█▎                                    | 24.6k/700k [00:00<00:09, 72.3kB/s]
  6%|██▍                                    | 43.0k/700k [00:00<00:06, 105kB/s]
  9%|███▌                                   | 63.5k/700k [00:00<00:04, 129kB/s]
 11%|████▍                                  | 79.9k/700k [00:00<00:04, 132kB/s]
 16%|██████▏                                 | 109k/700k [00:00<00:03, 167kB/s]
 18%|███████▏                                | 126k/700k [00:00<00:03, 160kB/s]
 22%|████████▉                               | 157k/700k [00:01<00:02, 190kB/s]
 29%|███████████▊                            | 206k/700k [00:01<00:01, 259kB/s]
 34%|█████████████▋                          | 239k/700k [00:01<00:01, 263kB/s]
 41%|████████████████▍                       | 288k/700k [00:01<00:01, 308kB/s]
 48%|███████████████████▎                    | 337k/700k [00:01<00:01, 340kB/s]
 54%|█████████████████████▌                  | 378k/700k [00:01<00:00, 341kB/s]
 61%|████████████████████████▍               | 427k/700k [00:01<00:00, 362kB/s]
 68%|███████████████████████████▏            | 476k/700k [00:01<00:00, 377kB/s]
 75%|██████████████████████████████          | 525k/700k [00:02<00:00, 387kB/s]
 82%|████████████████████████████████▊       | 574k/700k [00:02<00:00, 395kB/s]
 88%|███████████████████████████████████     | 614k/700k [00:02<00:00, 376kB/s]
 95%|█████████████████████████████████████▊  | 662k/700k [00:02<00:00, 382kB/s]
  0%|                                               | 0.00/700k [00:00<?, ?B/s]
100%|████████████████████████████████████████| 700k/700k [00:00<00:00, 988MB/s]
Downloading file 'filter_systems/etc/K.dat' from 'https://scopesim.univie.ac.at/spextra/database/filter_systems/etc/K.dat' to '/home/docs/.spextra_cache'.
  0%|                                              | 0.00/17.4k [00:00<?, ?B/s]
 82%|███████████████████████████████▏      | 14.3k/17.4k [00:00<00:00, 122kB/s]
  0%|                                              | 0.00/17.4k [00:00<?, ?B/s]
100%|█████████████████████████████████████| 17.4k/17.4k [00:00<00:00, 15.5MB/s]

 FOVs:   0%|          | 0/3 [00:00<?, ?it/s]

 FOV effects:   0%|          | 0/2 [00:00<?, ?it/s]


 FOV effects: 100%|██████████| 2/2 [00:00<00:00, 12.92it/s]

 FOV effects: 100%|██████████| 2/2 [00:00<00:00, 12.64it/s]
 FOVs:  33%|███▎      | 1/3 [00:00<00:00,  4.07it/s]

 FOV effects:   0%|          | 0/2 [00:00<?, ?it/s]


 FOV effects: 100%|██████████| 2/2 [00:00<00:00, 14.35it/s]

 FOV effects: 100%|██████████| 2/2 [00:00<00:00, 14.12it/s]
 FOVs:  67%|██████▋   | 2/3 [00:00<00:00,  4.30it/s]

 FOV effects:   0%|          | 0/2 [00:00<?, ?it/s]


 FOV effects: 100%|██████████| 2/2 [00:00<00:00, 11.55it/s]

 FOV effects: 100%|██████████| 2/2 [00:00<00:00, 11.42it/s]

 FOVs: 100%|██████████| 3/3 [00:00<00:00,  4.08it/s]
 FOVs: 100%|██████████| 3/3 [00:00<00:00,  4.11it/s]
astar.scopesim.detector.detector_manager - Extracting from 1 detectors...
astar.scopesim.effects.electronic.electrons - Applying gain 1
astar.scopesim.effects.fits_headers - WARNING: #exposure_action.include not found

[<astropy.io.fits.hdu.image.PrimaryHDU object at 0x71b7d0299590>, <astropy.io.fits.hdu.image.ImageHDU object at 0x71b7d0298550>]
img_slice = slice(462, 562)  # only show center of image
simulation.plot(img_slice=(img_slice, img_slice))
(<Figure size 640x480 with 1 Axes>, [<Axes: xlabel='pixel', ylabel='pixel'>])
_images/634161a5fd9c01e2672dd7e3bf872e83f02e75f35fb317c9422b63b36e125d17.png

Contents#

API reference#

scopesim_targets.target

Contains main Target class.

scopesim_targets.point_source

Currently only Star and baseclass.

scopesim_targets.extended_source

Parametrized and discrete 2+1D and 3D target models.

scopesim_targets.cluster

Star cluster targets.

scopesim_targets.spectral_classes

Stellar parameters lookup table and related functionality.

scopesim_targets.yaml_constructors

Custom YAML class constructors (loading) and representations (dumping).

scopesim_targets.data_utils

Auxilliary functions for downloading and caching static data.

scopesim_targets.plot_utils

Plotting convenience functinality.

scopesim_targets.typing_utils

Custom composite types used in this package.

scopesim_targets.stellar

Point source stuff, e.g. populations and cluster.