lenstronomy.PointSource.Types package

Submodules

lenstronomy.PointSource.Types.base_ps module

class PSBase(lens_model=None, fixed_magnification=False, additional_images=False, index_lens_model_list=None, point_source_frame_list=None)[source]

Bases: object

Base point source type class.

__init__(lens_model=None, fixed_magnification=False, additional_images=False, index_lens_model_list=None, point_source_frame_list=None)[source]
Parameters:
  • lens_model – instance of the LensModel() class

  • fixed_magnification – bool. If True, magnification ratio of point sources is fixed to the one given by the lens model

  • additional_images – bool. If True, search for additional images of the same source is conducted.

  • index_lens_model_list – list (length of different patches/bands) of integer lists, e.g., [[0, 1], [2, 3]]; evaluating a subset of the lens models per individual bands. If this keyword is set, the image positions need to have a specified band/frame assigned to it

  • point_source_frame_list – list of lists mirroring the structure of the image positions. Integers correspond to the i’th list entry of index_lens_model_list indicating in which frame/band the image is appearing

image_position(kwargs_ps, **kwargs)[source]

On-sky position.

Parameters:

kwargs_ps – keyword argument of point source model

Returns:

numpy array of x, y image positions

source_position(kwargs_ps, **kwargs)[source]

Original unlensed position.

Parameters:

kwargs_ps – keyword argument of point source model

Returns:

numpy array of x, y source positions

image_amplitude(kwargs_ps, *args, **kwargs)[source]

Amplitudes as observed on the sky.

Parameters:
  • kwargs_ps – keyword argument of point source model

  • kwargs – keyword arguments of function call

Returns:

numpy array of amplitudes

source_amplitude(kwargs_ps, **kwargs)[source]

Intrinsic source amplitudes (without lensing magnification, but still apparent)

Parameters:
  • kwargs_ps – keyword argument of point source model

  • kwargs – keyword arguments of function call (which are not used for this object

Returns:

numpy array of amplitudes

update_lens_model(lens_model_class)[source]

Update LensModel() and LensEquationSolver() instance.

Parameters:

lens_model_class – LensModel() class instance

Returns:

internal LensModel class updated

lenstronomy.PointSource.Types.lensed_position module

class LensedPositions(lens_model=None, fixed_magnification=False, additional_images=False, index_lens_model_list=None, point_source_frame_list=None)[source]

Bases: PSBase

class of a lensed point source parameterized as the (multiple) observed image positions Name within the PointSource module: ‘LENSED_POSITION’ parameters: ra_image, dec_image, point_amp If fixed_magnification=True, than ‘source_amp’ is a parameter instead of ‘point_amp’

image_position(kwargs_ps, kwargs_lens=None, magnification_limit=None, kwargs_lens_eqn_solver=None, additional_images=False)[source]

On-sky image positions.

Parameters:
  • kwargs_ps – keyword arguments of the point source model

  • kwargs_lens – keyword argument list of the lens model(s), only used when requiring the lens equation solver

  • magnification_limit – float >0 or None, if float is set and additional images are computed, only those images will be computed that exceed the lensing magnification (absolute value) limit

  • kwargs_lens_eqn_solver – keyword arguments specifying the numerical settings for the lens equation solver see LensEquationSolver() class for details

  • additional_images (bool) – if True, solves the lens equation for additional images

Returns:

image positions in x, y as arrays

source_position(kwargs_ps, kwargs_lens=None)[source]

Original source position (prior to lensing)

Parameters:
  • kwargs_ps – point source keyword arguments

  • kwargs_lens – lens model keyword argument list (required to ray-trace back in the source plane)

Returns:

x, y position (as numpy arrays)

image_amplitude(kwargs_ps, kwargs_lens=None, x_pos=None, y_pos=None, magnification_limit=None, kwargs_lens_eqn_solver=None)[source]

Image brightness amplitudes.

Parameters:
  • kwargs_ps – keyword arguments of the point source model

  • kwargs_lens – keyword argument list of the lens model(s), only used when requiring the lens equation solver

  • x_pos – pre-computed image position (no lens equation solver applied)

  • y_pos – pre-computed image position (no lens equation solver applied)

  • magnification_limit – float >0 or None, if float is set and additional images are computed, only those images will be computed that exceed the lensing magnification (absolute value) limit

  • kwargs_lens_eqn_solver – keyword arguments specifying the numerical settings for the lens equation solver see LensEquationSolver() class for details

Returns:

array of image amplitudes

source_amplitude(kwargs_ps, kwargs_lens=None)[source]

Intrinsic brightness amplitude of point source When brightnesses are defined in magnified on-sky positions, the intrinsic brightness is computed as the mean in the magnification corrected image position brightnesses.

Parameters:
  • kwargs_ps – keyword arguments of the point source model

  • kwargs_lens – keyword argument list of the lens model(s), used when brightness are defined in magnified on-sky positions

Returns:

brightness amplitude (as numpy array)

lenstronomy.PointSource.Types.source_position module

class SourcePositions(lens_model=None, fixed_magnification=False, additional_images=False, index_lens_model_list=None, point_source_frame_list=None)[source]

Bases: PSBase

Class of a single point source defined in the original source coordinate position that is lensed. The lens equation is solved to compute the image positions for the specified source position.

Name within the PointSource module: ‘SOURCE_POSITION’ parameters: ra_source, dec_source, source_amp, mag_pert (optional) If fixed_magnification=True, than ‘source_amp’ is a parameter instead of ‘point_amp’ mag_pert is a list of fractional magnification pertubations applied to point source images

image_position(kwargs_ps, kwargs_lens=None, magnification_limit=None, kwargs_lens_eqn_solver=None, **kwargs)[source]

On-sky image positions.

Parameters:
  • kwargs_ps – keyword arguments of the point source model

  • kwargs_lens – keyword argument list of the lens model(s), only used when requiring the lens equation solver

  • magnification_limit – float >0 or None, if float is set and additional images are computed, only those images will be computed that exceed the lensing magnification (absolute value) limit

  • kwargs_lens_eqn_solver – keyword arguments specifying the numerical settings for the lens equation solver see LensEquationSolver() class for details

Returns:

image positions in x, y as arrays

source_position(kwargs_ps, **kwargs)[source]

Original source position (prior to lensing)

Parameters:

kwargs_ps – point source keyword arguments

Returns:

x, y position (as numpy arrays)

image_amplitude(kwargs_ps, kwargs_lens=None, x_pos=None, y_pos=None, magnification_limit=None, kwargs_lens_eqn_solver=None)[source]

Image brightness amplitudes.

Parameters:
  • kwargs_ps – keyword arguments of the point source model

  • kwargs_lens – keyword argument list of the lens model(s), only ignored when providing image positions directly

  • x_pos – pre-computed image position (no lens equation solver applied)

  • y_pos – pre-computed image position (no lens equation solver applied)

  • magnification_limit – float >0 or None, if float is set and additional images are computed, only those images will be computed that exceed the lensing magnification (absolute value) limit

  • kwargs_lens_eqn_solver – keyword arguments specifying the numerical settings for the lens equation solver see LensEquationSolver() class for details

Returns:

array of image amplitudes

source_amplitude(kwargs_ps, kwargs_lens=None)[source]

Intrinsic brightness amplitude of point source When brightnesses are defined in magnified on-sky positions, the intrinsic brightness is computed as the mean in the magnification corrected image position brightnesses.

Parameters:
  • kwargs_ps – keyword arguments of the point source model

  • kwargs_lens – keyword argument list of the lens model(s), used when brightness are defined in magnified on-sky positions

Returns:

brightness amplitude (as numpy array)

lenstronomy.PointSource.Types.unlensed module

class Unlensed(lens_model=None, fixed_magnification=False, additional_images=False, index_lens_model_list=None, point_source_frame_list=None)[source]

Bases: PSBase

class of a single point source in the image plane, aka star Name within the PointSource module: ‘UNLENSED’ This model can deal with arrays of point sources. parameters: ra_image, dec_image, point_amp

image_position(kwargs_ps, **kwargs)[source]

On-sky position.

Parameters:

kwargs_ps – keyword argument of point source model

Returns:

numpy array of x, y image positions

source_position(kwargs_ps, **kwargs)[source]

Original physical position (identical for this object)

Parameters:

kwargs_ps – keyword argument of point source model

Returns:

numpy array of x, y source positions

image_amplitude(kwargs_ps, **kwargs)[source]

Amplitudes as observed on the sky.

Parameters:
  • kwargs_ps – keyword argument of point source model

  • kwargs – keyword arguments of function call (which are not used for this object

Returns:

numpy array of amplitudes

source_amplitude(kwargs_ps, **kwargs)[source]

Intrinsic source amplitudes.

Parameters:
  • kwargs_ps – keyword argument of point source model

  • kwargs – keyword arguments of function call (which are not used for this object

Returns:

numpy array of amplitudes

Module contents