scopesim.source.source_templates module¶
- scopesim.source.source_templates.empty_sky(flux=0)[source]¶
Returns an empty source so that instrumental fluxes can be simulated
- Returns:
- skySource
- scopesim.source.source_templates.star(x=0, y=0, flux=0)[source]¶
Source object for a single star in either vega, AB magnitudes, or Jansky
The star is associated with the reference spectrum for each photometric system, therefore a reference wavelength or filter does not need to be given
- Parameters:
- x, yfloat
[arcsec] position from centre of field of view
- fluxfloat
[vega mag, AB mag, Jy] Stellar brightness
- Returns:
- srcSource
A source object with a single entry table field and a reference spectrum
- scopesim.source.source_templates.star_field(n, mmin, mmax, width, height=None, use_grid=False)[source]¶
Creates a super basic field of stars with random positions and brightnesses
- Parameters:
- nint
number of stars
- mmin, mmaxfloat, astropy.Quantity
[mag, ABmag, Jy] min and max magnitudes/fluxes of the population stars. If floats, then assumed Quantity is vega magnitudes
- widthfloat
[arcsec] width of region to put stars in
- heightfloat, optional
[arcsec] if None, then height=width
- use_gridbool, optional
Place stars randomly or on a grid
- Returns:
- starsscopesim.Source object
A Source object with a field of stars that can be fed into the method: OpticalTrain.observe()
See also
OpticalTrain.observe
OpticalTrain.readout
- scopesim.source.source_templates.uniform_illumination(xs, ys, pixel_scale, flux=None, spectrum=None)[source]¶
Return a Source for a uniformly illuminated area
- Parameters:
- xs, yslist of float
[arcsec] min and max extent of each dimension relative to FOV centre E.g. xs=[-1, 1], ys=[5, 5.5]
- pixel_scalefloat
[arcsec]
- fluxastropy.Quantity
[mag, ABMag, Jy] Flux per arcsecond of the Source
- Returns:
- srcscopesim.Source
Examples
A 200x200 uniform illumination Source at 1 Jy/arcsec2
src = uniform_illumination(xs=[-1,1], ys=[-1, 1], pixel_scale=0.01, flux=1*u.Jy)
A source that extends just past the MICADO 15” slit dimensions with a flux of 10 mag/arcsec2
src = uniform_illumination(xs=[-8, 8], ys=[-0.03, 0.03], pixel_scale=0.004, flux=10*u.mag)
Using a self made frequency-comb spectrum with 1 Jy lines ever 0.1µm
import numpy as np from astropy import units as u from synphot import SourceSpectrum, Empirical1D wave = np.arange(0.7, 2.5, 0.001) * u.um flux = np.zeros(len(wave)) flux[::100] = 1 * u.Jy spec = SourceSpectrum(Empirical1D, points=wave, lookup_table=flux) src = uniform_illumination(xs=[-8, 8], ys=[-0.03, 0.03], pixel_scale=0.004, spectrum=spec)
- scopesim.source.source_templates.uniform_source(sp=None, extent=60)[source]¶
Simplified form of scopesim_templates.misc.uniform_source, mostly intended for testing
This function creates an image with extend^2 pixels with pixel size of 1 arcsec^2 so provided amplitudes are in flux or magnitudes per arcsec^2
It accepts any synphot.SourceSpectrum compatible object
- spsynphot.SourceSpectrum
defaults to vega_spectrum() with magnitude 0 mag/arcsec2
- extentint, default 60
extension of the field in arcsec, will always produce a square field. Default value produces a field of 60x60 arcsec