synospec.etc.source module
Module defining source surface-brightness distributions.
Copyright © 2020, Kyle B. Westfall
- class synospec.etc.source.OnSkyConstant(surfbrightness, sampling=None, size=None)[source]
Bases:
synospec.etc.source.SourceAn on-sky constant surface brightness.
- Parameters
surfbrightness (scalar-like) – The constant surface brightness for the source in linear flux units per square arcsecond.
sampling (scalar-like, optional) – Sampling of a generated map in arcseconds per pixel. Default is set by
minimum_sampling().size (scalar-like, optional) – Size of the image to generate of the distribution in arceconds along one of the axes. The map is square. Default is defined by
minimum_size().
- class synospec.etc.source.OnSkyGaussian(fwhm, center=None, ellipticity=None, position_angle=None, sampling=None, size=None)[source]
Bases:
astropy.modeling.functional_models.Gaussian2D,synospec.etc.source.SourceAn on-sky Gaussian distribution.
- Parameters
fwhm (scalar-like) – The FWHM of the Gaussian in arcseconds.
center (array-like, optional) – The two coordinates of the Gaussian center in arcseconds.
ellipticity (scalar-like, optional) – The ellipticity (1-b/a) of an elliptical Gaussian distribution.
position_angle (scalar-like, optional) – The position angle for the elliptical Gaussian distribution, defined as the angle from N through E. The coordinate system is defined with positive offsets (in RA) toward the east, meaning lower pixel indices.
sampling (scalar-like, optional) – Sampling of a generated map in arcseconds per pixel. Default is set by
minimum_sampling().size (scalar-like, optional) – Size of the image to generate of the distribution in arceconds along one of the axes. The map is square. Default is defined by
minimum_size().
- _abc_impl = <_abc_data object>
- _fix_inputs(right)
- _is_dynamic = False
- _parameters_ = {}
- class synospec.etc.source.OnSkyMoffat(fwhm, beta, center=None, sampling=None, size=None)[source]
Bases:
astropy.modeling.functional_models.Moffat2D,synospec.etc.source.SourceAn on-sky Moffat distribution.
- Parameters
fwhm (scalar-like) – The FWHM of the Moffat in arcseconds.
beta (scalar-like) – The power-law index for the Moffat tails (called alpha by astropy)
center (array-like, optional) – The two coordinates of the Moffat center in arcseconds.
sampling (scalar-like, optional) – Sampling of a generated map in arcseconds per pixel. Default is set by
minimum_sampling().size (scalar-like, optional) – Size of the image to generate of the distribution in arceconds along one of the axes. The map is square. Default is defined by
minimum_size().
- _abc_impl = <_abc_data object>
- _fix_inputs(right)
- _is_dynamic = False
- _parameters_ = {}
- class synospec.etc.source.OnSkySersic(sb_eff, r_eff, n, center=None, ellipticity=None, position_angle=None, sampling=None, size=None, unity_integral=False)[source]
Bases:
astropy.modeling.functional_models.Sersic2D,synospec.etc.source.SourceAn on-sky Sersic distribution.
- Parameters
sb_eff (scalar-like) – The surface brightness at 1 effective (half-light) radius.
r_eff (scalar-like) – The effective (half-light) radius in arcseconds.
n (scalar-like) – The Sersic index.
center (scalar-like, optional) – The coordinates of the Sersic center in arcseconds relative to the image center.
ellipticity (scalar-like, optional) – The ellipticity (1-b/a) of an elliptical Sersic distribution.
position_angle (scalar-like, optional) – The position angle for the elliptical Sersic distribution, defined as the angle from N through E. The coordinate system is defined with positive offsets (in RA) toward the east, meaning lower pixel indices.
sampling (scalar-like, optional) – Sampling of a generated map in arcseconds per pixel. Default is set by
minimum_sampling().size (scalar-like, optional) – Size of the image to generate of the distribution in arceconds along one of the axes. The map is square. Default is defined by
minimum_size().unity_integral (
bool, optional) – Renormalize the distribution so that the integral is unity.
- _abc_impl = <_abc_data object>
- _fix_inputs(right)
- _is_dynamic = False
- _parameters_ = {}
- class synospec.etc.source.OnSkySource(seeing, intrinsic, beta=None, sampling=None, size=None)[source]
Bases:
synospec.etc.source.SourceContainer class for an on-sky source convolved with the seeing disk.
Unlike the other
Sourceobjects, this requires a map to work.- Parameters
seeing (
float,Source) – The FWHM of a Gaussian seeing distribution in arcseconds or an object used to define the seeing kernel directly. If a float is provided, the sampling of the Gaussian seeing kernel is set byOnSkyGaussian.minimum_sampling()unless adjusted by the intrinsic source object or thesamplingkeyword. If aSourceobject, the object is used to generate a map of the source surface brightness distribution. The integral of the seeing kernel should be unity!intrinsic (
float,Source) – The intrinsic surface brightness distribution of the source. Can be the total flux of a point source (in, e.g., 10^-17 erg/s/cm^2/angstrom) or an object. If aSourceobject, the object is used to generate a map of the source surface-brightness distribution.beta (
float, optional) – The beta for the Moffat function. If None, use a Gaussian seeing distribution. If seeing is aSourceobject, this is ignored.sampling (scalar-like, optional) – Sampling of a generated map in arcseconds per pixel. Default is set by
minimum_sampling().size (scalar-like, optional) – Size of the image to generate of the distribution in arceconds along one of the axes. The map is square. Default is defined by
minimum_size().
- __call__(x, y)[source]
Sample the source.
This interpolates the pre-calculated source at the requested coordinate. A ValueError will be thrown (see scipy.interpolate.interp2d) if the coordinate is outside the bounds of the calculated map.
- Parameters
x (
float) – The position in arcsec relative to the field center. Positive x is toward the East (positive RA, smaller pixel number).y (
float) – The position in arcsec relative to the field center. Positive x is toward the North (larger pixel number).
- Returns
The surface brightness at (x,y).
- Return type
float
- make_map(sampling=None, size=None)[source]
Generate a square map of the source surface-brightness distribution.
Object is modified internally with the constructed map saved to
data.- Parameters
sampling (
float, optional) – The size of each pixel in the map in arcsec per pixel. If None, sampling will be set byminimum_sampling().size (
float, optional) – Length of one axis of the square map in arcsec. Will be adjusted to ensure an integer number of pixels in the map based onsampling. If None, set byminimum_size().
- class synospec.etc.source.Source[source]
Bases:
objectThis is an abstract class and should not be instantiated on it’s own!
- x
1D vector with x coordinates
- Type
vector
- X
2D map of x coordinates
- Type
array
- y
1D vector with y coordinates
- Type
vector
- Y
2D map of y coordinates
- Type
array
- data
Map of the surface brightness distribution
- Type
array
- sampling
Sampling of the square map in arcsec/pixel.
- Type
float
- size
Size of the square map in arcsec.
- Type
float
- make_map(sampling=None, size=None)[source]
Generate a square map of the surface-brightness distribution.
Object is modified internally with the constructed map saved to
data.- Parameters
sampling (
float, optional) – The size of each pixel in the map, typically in arcsec per pixel. If None, sampling will be set byminimum_sampling().size (
float, optional) – Length of one axis of the square map, typically in arcsec. Will be adjusted to ensure an integer number of pixels in the map based onsampling. If None, set byminimum_size().
- reset_map()[source]
Reset mapping attributes for a fresh determination of the sampling, size, and surface-brightness map.
This is mainly used for resetting the internals when using the default sampling and size to set the map. To reconstruct the map after calling this method, run
make_map(). This:self.reset_map() self.make_map()
is equivalent to this:
self.make_map(sampling=self.minimum_sampling(), size=self.minimum_size())
- property shape
The shape of the current map.