enyo.etc.source module

Module defining source surface-brightness distributions.


License

Copyright © 2020, Kyle B. Westfall


#.. _pypi https://pypi.org/project/sdss-mangadap/

class enyo.etc.source.OnSkyConstant(surfbrightness, sampling=None, size=None)[source]

Bases: enyo.etc.source.Source

An 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().
minimum_sampling()[source]

Return the minimum sampling in arcseconds per pixels. Currently just set to 1.

minimum_size()[source]

The minimum size that should be used for the distribution map in arcseconds. Currently just set to 3.

class enyo.etc.source.OnSkyGaussian(fwhm, center=None, ellipticity=None, position_angle=None, sampling=None, size=None)[source]

Bases: astropy.modeling.functional_models.Gaussian2D, enyo.etc.source.Source

An on-sky Gaussian distribution.

Parameters:
  • fwhm (scalar-like) – The FWHM of the Gaussian in arcseconds.
  • center (scalar-like, optional) – The 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_ = {}
get_integral()[source]

Return the analytic integral of the source.

minimum_sampling()[source]

Return the minimum sampling in arcseconds per pixels. Currently \({\rm FWHM}/2\).

minimum_size()[source]

The minimum size that should be used for the distribution map in arcseconds. Currently \(2\ {\rm FWHM}\).

class enyo.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, enyo.etc.source.Source

An 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_ = {}
get_integral()[source]

The analytic integral of the Sersic profile projected on the sky.

minimum_sampling()[source]

Return the minimum sampling in arcseconds per pixels. Currently \(R_{\rm eff}/3\).

minimum_size()[source]

The minimum size that should be used for the distribution map in arcseconds. Currently \(3\ R_{\rm eff}\).

class enyo.etc.source.OnSkySource(seeing, intrinsic, sampling=None, size=None)[source]

Bases: enyo.etc.source.Source

Container class for an on-sky source convolved with the seeing disk.

Unlike the other Source objects, 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 by OnSkyGaussian.minimum_sampling() unless adjusted by the intrinsic source object or the sampling keyword. If a Source object, 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 a Source object, the object is used to generate a map of the source surface-brightness distribution.
  • 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().
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 by minimum_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 on sampling. If None, set by minimum_size().
minimum_sampling()[source]

Return the minimum sampling in arcseconds per pixels.

This is determined by the minimum of the seeing disk sampling (seeing) and the sampling for the intrinsic distribution (if the latter is defined).

minimum_size()[source]

Return the minimum size of the rendered source map in arcseconds.

This is determined by the maximum of the seeing disk map size (seeing) and the intrinsic source map size (if the latter is defined).

class enyo.etc.source.Source[source]

Bases: object

This 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 by minimum_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 on sampling. If None, set by minimum_size().
minimum_sampling()[source]
minimum_size()[source]
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())
shape

The shape of the current map.