Science target templates¶
The companion python package ScopeSim-Templates contains a library of helper functions for generating ScopeSim-friendly Source
objects for various common astronomical sources.
For more information, please see the ScopeSim-Templates documentation
[1]:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
import scopesim_templates as sim_tp
A basic star cluster¶
[2]:
my_cluster = sim_tp.stellar.clusters.cluster(mass=1000.0, # [Msun]
distance=8000, # [pc]
core_radius=1) # [pc]
my_cluster.plot()
INFO - sample_imf: Setting maximum allowed mass to 1000
INFO - sample_imf: Loop 0 added 1.09e+03 Msun to previous total of 0.00e+00 Msun
A basic elliptical galaxy¶
[3]:
# See the docstring of `elliptical` for more keywords
my_elliptical = sim_tp.extragalactic.galaxies.elliptical(half_light_radius=30, # [arcsec]
pixel_scale=0.1, # [arcsec]
filter_name="Ks",
amplitude=10,
normalization="total", # [Ks=10 for integrated flux]
n=4, # Sersic index
ellipticity=0.5,
angle=30)
plt.figure(figsize=(12, 5))
plt.subplot(121)
plt.imshow(my_elliptical.fields[0].data, norm=LogNorm(), extent=[-25.6, 25.6, -25.6, 25.6])
plt.xlabel("[arcsec]")
plt.subplot(122)
wave = np.arange(5000, 25000) # [angstrom]
plt.plot(wave, my_elliptical.spectra[0](wave))
plt.xlabel("Wavelength [Angstrom]")
[3]:
Text(0.5, 0, 'Wavelength [Angstrom]')