slsim.Sources package

Subpackages

Submodules

slsim.Sources.source module

class slsim.Sources.source.Source(extended_source_type=None, point_source_type=None, **source_dict)[source]

Bases: object

Class to manage an individual source.

property angular_size

Returns angular size of the extended source.

property ellipticity

Returns ellipticity components of extended source. Defined as:

\[e1 = \frac{1-q}{1+q} * cos(2 \phi) e2 = \frac{1-q}{1+q} * sin(2 \phi)\]

with q being the minor-to-major axis ratio.

extended_source_magnitude(band)[source]

Get the magnitude of the extended source in a specific band.

Parameters:

band (str) – Imaging band

Returns:

Magnitude of the extended source in the specified band

Return type:

float

property extended_source_position

Extended source position.

Returns:

[x_pos, y_pos]

kwargs_extended_light(band=None)[source]

Provides dictionary of keywords for the source light model(s). Keywords used are in lenstronomy conventions.

Parameters:

band – Imaging band

Returns:

dictionary of keywords for the source light model(s)

kwargs_point_source(band, image_observation_times=None, image_pos_x=None, image_pos_y=None, ps_mag=None)[source]
Parameters:
  • band (str) – Imaging band

  • image_observation_times – Images observation time for an image.

  • image_pos_x – pre-calculated image positions (solutions of the lens equation) RA [arcseconds]

  • image_pos_y – pre-calculated image positions (solutions of the lens equation) DEC [arcseconds]

  • ps_mag – magnitudes of images (or source)

Returns:

source type, list of dictionary in lenstronomy convention

property name

Meaningful name string of the source.

Returns:

name string

point_source_magnitude(band, image_observation_times=None)[source]

Get the magnitude of the point source in a specific band.

Parameters:
  • band (str) – Imaging band

  • image_observation_times – Images observation time for an image.

Returns:

Magnitude of the point source in the specified band

Return type:

float

property point_source_position

Point source position. point source could be at the center of the extended source, or it can be off from center of the extended source.

Returns:

[x_pos, y_pos]

point_source_type(image_positions=False)[source]

Type of point source model.

Parameters:

image_positions

Returns:

point source model string, or None

property redshift

Returns source redshift.

surface_brightness_reff(band=None)[source]

Calculate average surface brightness within half light radius of a galaxy.

Parameters:

band – Imaging band

Returns:

average surface brightness within half light radius [mag/arcsec^2]

update_center(area=None, reference_position=None, center_x=None, center_y=None)[source]

Overwrites the source center position.

Parameters:
  • reference_position (2d numpy array) – [RA, DEC] in arc-seconds of the reference from where within a circle the source position is being drawn from

  • area – area (in solid angle arc-seconds^2) to dither the center of the source

  • center_x – RA position [arc-seconds] (optional, otherwise renders within area)

  • center_y – DEC position [arc-seconds] (optional, otherwise renders within area)

Returns:

Source() instance updated with new center position

Module contents

class slsim.Sources.Galaxies(galaxy_list, kwargs_cut, cosmo, sky_area, list_type='astropy_table', catalog_type=None, downsample_to_dc2=False, source_size='Bernardi', extended_source_type='single_sersic', extendedsource_kwargs={})[source]

Bases: SourcePopBase

Class describing elliptical galaxies.

draw_source(z_max=None, z_min=None, galaxy_index=None)[source]

Choose source at random.

Parameters:
  • z_max – maximum redshift limit for the galaxy to be drawn. If no galaxy is found for this limit, None will be returned.

  • z_min – minimum redshift limit for the galaxy to be drawn. If no galaxy is found for this limit, None will be returned.

  • galaxy_index – index of galaxy to pic (if provided)

Returns:

instance of Source class

draw_source_dict(z_max=None, z_min=None, galaxy_index=None)[source]

Choose source at random.

Parameters:
  • z_max – maximum redshift limit for the galaxy to be drawn. If no galaxy is found for this limit, None will be returned.

  • z_min – minimum redshift limit for the galaxy to be drawn. If no galaxy is found for this limit, None will be returned.

  • galaxy_index – index of galaxy to pic (if provided)

Returns:

dictionary of source

property source_number

Number of sources registered (within given area on the sky)

Returns:

number of sources

property source_number_selected

Number of sources selected (within given area on the sky)

Returns:

number of sources passing the selection criteria

class slsim.Sources.PointPlusExtendedSources(point_plus_extended_sources_list, cosmo, sky_area, kwargs_cut, list_type='astropy_table', catalog_type=None, source_size='Bernadi', point_source_type=None, extended_source_type=None, point_source_kwargs={}, extendedsource_kwargs={})[source]

Bases: Galaxies, SourcePopBase

Class to describe point and extended sources.

draw_source(z_max=None)[source]

Choose source at random.

Parameters:

z_max – maximum redshift limit for the galaxy to be drawn. If no galaxy is found for this limit, None will be returned.

Returns:

instance of Source class

class slsim.Sources.PointSources(point_source_list, cosmo, sky_area, kwargs_cut, list_type='astropy_table', point_source_type=None, point_source_kwargs={})[source]

Bases: SourcePopBase

Class to describe point sources.

draw_source()[source]

Choose source at random with the selected range.

Returns:

dictionary of source

property source_number

Number of sources registered (within given area on the sky)

Returns:

number of sources

property source_number_selected

Number of sources selected (within given area on the sky)

Returns:

number of sources passing the selection criteria