synospec.etc.source module

Module defining source surface-brightness distributions.


License

Copyright © 2020, Kyle B. Westfall


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

Bases: synospec.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().

__call__(x, y)[source]

Return the surface brightness at a given location.

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 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.Source

An 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_ = {}
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 synospec.etc.source.OnSkyMoffat(fwhm, beta, center=None, sampling=None, size=None)[source]

Bases: astropy.modeling.functional_models.Moffat2D, synospec.etc.source.Source

An 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_ = {}
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 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.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 synospec.etc.source.OnSkySource(seeing, intrinsic, beta=None, sampling=None, size=None)[source]

Bases: synospec.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.

  • beta (float, optional) – The beta for the Moffat function. If None, use a Gaussian seeing distribution. If seeing is a Source object, 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 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 synospec.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

__getitem__(s)[source]

Slice the map.

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())
property shape

The shape of the current map.