Galaxy#

class silmaril.galaxy.Galaxy(filename, center, redshift, size, data_format='pos')#

Bases: object

Class representing a galaxy defined using particle data

Parameters:
  • filename (str) – name of the file containing the particle data

  • data_format (str) – format of the file containing particle data (options are “fid” and “pos”), defaults to “pos”

  • center (astropy.coordinates.SkyCoord) – coordinates of the center of the galaxy

  • redshift (float) – redshift of the galaxy

  • size (float) – physical size of the galaxy in pc

data#

particle data

data_format#

format of the file containing particle data

data_columns#

names of the columns of the particle data

ages#

array of ages in Myr

positions#

array of (x, y, z) coordinates for particle data

center#

coordinates of the center of the galaxy

redshift#

redshift of the galaxy

size#

physical size of the galaxy in pc

angular_size#

angular size of the galaxy in arcseconds

luminosity_distance#

luminosity distance of the galaxy in pc

__init__(filename, center, redshift, size, data_format='pos')#

Methods

__init__(filename, center, redshift, size[, ...])

create_image(resolution[, zoom_factor, ...])

Returns an image of the galaxy as a 2d array of fluxes in Jy.

grid(resolution[, zoom_factor])

Returns a grid of points on the sky at a given resolution and zoom factor.

pixel_scale(resolution[, zoom_factor])

Computes the pixel scale of an image of the galaxy at a given resolution and zoom factor.

plot(resolution[, norm, zoom_factor])

Plots the galaxy at a given resolution and zoom factor.

create_image(resolution, zoom_factor=1, filter_name='F200W')#

Returns an image of the galaxy as a 2d array of fluxes in Jy.

Parameters:
  • resolution (int) – number of pixels on each side of the image

  • filter_name (str) – name of the JWST filter to use (uses luminosity lookup table if set to None), defaults to “F200W”

  • zoom_factor (float, optional) – zoom factor of the image, defaults to 1

Returns:

image of the galaxy

Return type:

numpy.ndarray

grid(resolution, zoom_factor=1)#

Returns a grid of points on the sky at a given resolution and zoom factor.

Parameters:
  • resolution (int) – number of pixels on each side of the image

  • zoom_factor (float, optional) – zoom factor of the image, defaults to 1

Returns:

grid of points on the sky

Return type:

imaging.Grid

pixel_scale(resolution, zoom_factor=1)#

Computes the pixel scale of an image of the galaxy at a given resolution and zoom factor.

Parameters:
  • resolution (int) – number of pixels on each side of the image

  • zoom_factor (float, optional) – zoom factor of the image, defaults to 1

Returns:

pixel scale of the image

Return type:

float

plot(resolution, norm=None, zoom_factor=1)#

Plots the galaxy at a given resolution and zoom factor.

Parameters:
  • resolution (int) – number of pixels on each side of the image

  • norm (matplotlib.colors.Normalize, optional) – normalization of the image, defaults to None

  • zoom_factor (float, optional) – zoom factor of the image, defaults to 1

Returns:

figure and axes of the plot

Return type:

matplotlib.pyplot.figure, matplotlib.pyplot.axes