synthesizer.parametric.morphology

Classes

class synthesizer.parametric.morphology.MorphologyBase[source]

A base class holding common methods for parametric morphology descriptions

plot_density_grid()[source]

shows a plot of the model for a given resolution and npix

compute_density_grid_from_arrays(*args)[source]

Compute the density grid from coordinate grids.

This is a place holder method to be overwritten by child classes.

get_density_grid(resolution, npix)[source]

Get the density grid based on resolution and npix.

Parameters:
  • resolution (unyt_quantity) – The resolution of the grid.

  • npix (tuple, int) – The number of pixels in each dimension.

plot_density_grid(resolution, npix)[source]

A simple method to produce a quick density plot.

Arguments
resolution (float)

The resolution (in the same units provded to the child class).

npix (int)

The number of pixels.

Examples using synthesizer.parametric.morphology.MorphologyBase

Create image example

Create image example
class synthesizer.parametric.morphology.PointSource(offset=unyt_array([0., 0.], 'kpc'), cosmo=None, redshift=None)[source]

A class holding the Sersic2D profile. This is a wrapper around the astropy.models.Sersic2D class.

compute_density_grid_from_arrays(xx, yy, units=kpc)[source]

Compute the density grid defined by this morphology as a function of the input coordinate grids.

This acts as a wrapper to astropy functionality (defined above) which only work in units of kpc or milliarcseconds (mas)

Arguments
xx: array-like (float)

x values on a 2D grid.

yy: array-like (float)

y values on a 2D grid.

unitsunyt.unit

The units in which the coordinate grids are defined.

Returns
density_gridnp.ndarray

The density grid produced

class synthesizer.parametric.morphology.Sersic2D(r_eff=None, sersic_index=1, ellipticity=0, theta=0.0, cosmo=None, redshift=None)[source]

A class holding the Sersic2D profile. This is a wrapper around the astropy.models.Sersic2D class.

compute_density_grid_from_arrays(xx, yy, units=kpc)[source]

Compute the density grid defined by this morphology as a function of the input coordinate grids.

This acts as a wrapper to astropy functionality (defined above) which only work in units of kpc or milliarcseconds (mas)

Arguments
xx: array-like (float)

x values on a 2D grid.

yy: array-like (float)

y values on a 2D grid.

unitsunyt.unit

The units in which the coordinate grids are defined.

Returns
density_gridnp.ndarray

The density grid produced