Source

class specsim.source.Source(name, type_name, wavelength_out, wavelength_in, flux_in, disk_fraction, bulge_fraction, disk_shape, bulge_shape, focal_xy, sky_position, z_in=None, z_out=None, filter_name=None, ab_magnitude_out=None)[source] [edit on github]

Bases: object

Source model used for simulation.

A source is defined on both an input and output wavelength grid. The input grid represents the best knowledge of the source over the widest possible wavelength range, to allow for redshift transforms and filter calculations via get_flux_out(). The output grid is determined by the simulation and represents observed wavelengths in the instrument.

All parameters except for wavelength_out can be modified using update_in() and update_out(). A simulation uses only the attribute flux_out for its calculations.

The simulation needs to locate a source in the focal plane. This is either done by specifying (x,y) coordinates in the focal plane, or else by specifying the sky position of the source and calculating its focal plane coordinates from the observing time, pointing and atmospheric conditions.

Parameters:
namestr

Brief descriptive name of this model.

type_namestr

Name of the instrument fiber acceptance model that should be used to simulate this source.

wavelength_outastropy.units.Quantity

Array of increasing output wavelengths with units.

wavelength_inastropy.units.Quantity

Array of increasing input wavelengths with units.

flux_inastropy.units.Quantity

Array of input flux values tabulated at wavelength_in.

disk_fractionfloat

Fraction of flux in disk (Sersic n=1) component. Must be between 0 and 1, and sum of disk_fraction and bulge_fraction must be <= 1. If sum is < 1, the remainder is point like.

bulge_fractionfloat

Fraction of flux in bulge (Sersic n=4) component. Must be between 0 and 1, and sum of disk_fraction and bulge_fraction must be <= 1. If sum is < 1, the remainder is point like.

disk_shapeProfile

Transverse profile of disk component with Sersic n=1. Ignored when disk_fraction is 0.

bulge_shapeProfile

Transverse profile of bulge component with Sersic n=4. Ignored when disk_fraction is 1.

focal_xyastropy.units.Quantity or None

Astropy quantity of shape (nfiber, 2) giving the focal plane coordinates where this source is observed. When None, the focal plane position is calculated from the sky_position and observing conditions.

sky_positionastropy.coordinates.SkyCoord or None

Location of this source in the sky. A source will not be visible unless its location is within the instrument field of view. Used to determine the location of this source on the focal plane, using the observing time, pointing and atmospheric conditions. Ignored when focal_xy is not None.

z_infloat or None

Redshift of (wavelength_in, flux_in) to assume for redshift transforms. Ignored unless z_out is set and must be set when z_out is set.

z_outfloat or None

When this parameter is set, (wavelength_in, flux_in) are redshifted from z_in to this value to obtain flux_out.

filter_namestr or None

Name of the speclite filter response to use for normalizing flux_out. Ignored when ab_magnitude_out is None.

ab_magnitude_outfloat or None

AB magnitude to use for normalizing flux_out. Note that any redshift transform is applied before normalizing.

Attributes Summary

flux_in

astropy.units.Quantity: Flux values tabulated at wavelength_in.

flux_out

astropy.units.Quantity: Flux values tabulated at wavelength_out.

name

str: Brief descriptive name of this model.

type_name

str: Name of this source's instrument fiber acceptance model.

wavelength_in

astropy.units.Quantity: Array of input wavelengths with units.

wavelength_out

astropy.units.Quantity: Array of output wavelengths with units.

Methods Summary

update_in(name, type_name, wavelength_in, ...)

Update this source model.

update_out([z_out, filter_name, ...])

Calculate the flux on the output wavelength grid.

Attributes Documentation

flux_in

astropy.units.Quantity: Flux values tabulated at wavelength_in.

Use update_in() to change this attribute’s value.

flux_out

astropy.units.Quantity: Flux values tabulated at wavelength_out.

This attribute is read only and updated by update_out().

name

str: Brief descriptive name of this model.

Use update_in() to change this attribute’s value.

type_name

str: Name of this source’s instrument fiber acceptance model.

Use update_in() to change this attribute’s value.

wavelength_in

astropy.units.Quantity: Array of input wavelengths with units.

Use update_in() to change this attribute’s value.

wavelength_out

astropy.units.Quantity: Array of output wavelengths with units.

This attribute is read only and fixed by the constructor.

Methods Documentation

update_in(name, type_name, wavelength_in, flux_in, z_in=None)[source] [edit on github]

Update this source model.

All parameters have the same meaning as in the constructor. A call to this method must be followed by a call to update_out(), otherwise an attempt to access flux_out will raise a RuntimeError.

Parameters:
namestr

See constructor.

type_namestr

See constructor.

wavelength_inastropy.units.Quantity

See constructor.

flux_inastropy.units.Quantity

See constructor.

z_infloat or None

See constructor.

update_out(z_out=None, filter_name=None, ab_magnitude_out=None)[source] [edit on github]

Calculate the flux on the output wavelength grid.

All parameters have the same meaning as in the constructor. The result is accessible as flux_out.

Parameters:
z_outfloat or None

See constructor. Use update_in() to change the assumed initial redshift.

filter_namestr or None

See constructor.

ab_magnitude_outfloat or None

See constructor.