scopesim_templates.stellar.stars¶
- scopesim_templates.stellar.stars(filter_name, amplitudes, spec_types, x, y, library='pyckles', ra=0, dec=0)¶
Create a scopesim.Source object for a list of stars with given amplitudes.
Note
If amplitudes have no units, vega magnitudes are assumed
- Parameters:
- filter_namestr
For scaling the stars. Use either common names or Spanish-VO identifiers.
- amplitudeslist of Quanitity, float
[mag, Jy] amplitudes for the list of stars. Acceptable astropy.units: [u.mag, u.ABmag, u.Janksy]. If no units are given, Vega magnitudes are assumed
- spec_typeslist of strings
the spectral type(s) of the stars, e.g. “A0V”, “G5III”
- x, yarrays of float
[arcsec] x and y coordinates of the stars on the focal plane
- ra, decfloat
coordinates of the center of the field
- library: str
Library where the spectroscopic types are taken. By default are taken from the pickles library using the
pyckles
package. Other libraries available are kurucz, bosz/lr, bosz/mr, bosz/hr, etc for MIR coverage and different spectral resolutions. Please see thespextra
package for more information
- Returns:
- src
scopesim.Source
- src
Examples
Create a
Source
object for a random group of stars:>>> import numpy as np >>> import astropy.units as u >>> from scopesim_templates.stellar import stars >>> >>> n = 100 >>> spec_types = ["A0V", "G2V", "K0III", "M5III", "O8I"] >>> ids = np.random.randint(0, 5, size=n) >>> star_list = [spec_types[i] for i in ids] >>> mags = np.random.normal(loc=20, scale=3, size=n) * u.mag >>> x, y = np.random.random(size=(2, n)) >>> >>> src = stars("Ks", mags, spec_types, x, y)
The final positions table is kept in the
<Source>.fields
attribute:>>> src.fields[0]
Each star in this table has an associated spectrum kept in the
<Source>.spectra
attribute. These stars are connected to the spectra in the list by the “ref” column in the.fields
table:>>> src.spectra
The stars can be scaled in units of u.mag, u.ABmag or u.Jansky. Any filter listed on the spanish VO filter profile service can be used for the scaling (
http://svo2.cab.inta-csic.es/theory/fps/
). SVO filter names need to be in the following formatobservatory/instrument.filter
:>>> amplitudes = np.linspace(1, 3631, n) * u.Jansky >>> filter_name = "Paranal/HAWKI.Ks" >>> stars(filter_name, amplitudes, spec_types, x=x, y=y)