caustics.light package#
Subpackages#
Submodules#
caustics.light.base module#
- class caustics.light.base.Source(name: str | None = None, **kwargs)[source]#
Bases:
ModuleThis is an abstract base class used to represent a source in a strong gravitational lensing system. It provides the basic structure and required methods that any derived source class should implement. The Source class inherits from the Module class, implying that it contains parameters that can be optimized or manipulated.
The class introduces one abstract method, brightness, that must be implemented in any concrete subclass. This method calculates the brightness of the source at given coordinates.
- abstract brightness(x: ArrayLike, y: ArrayLike, *args, **kwargs) ArrayLike[source]#
Abstract method that calculates the brightness of the source at the given coordinates. This method is expected to be implemented in any class that derives from Source.
- Parameters:
x (ArrayLike) –
The x-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
y (ArrayLike) –
The y-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
- Returns:
The brightness of the source at the given coordinate(s). The exact form of the output will depend on the specific implementation in the derived class.
- Return type:
ArrayLike
Notes
This method must be overridden in any class that inherits from Source.
Note that the source redshift z_s is not included as an argument since most sources don’t need to know their redshift, it is instead held by the lens object.
caustics.light.light_stack module#
- class caustics.light.light_stack.LightStack(light_models: Annotated[Tuple[Source], 'a list of light models to sum their brightnesses'], name: Annotated[str | None, 'Name of the source'] = None)[source]#
Bases:
SourceLightStackis a subclass of the abstract classSourcewhich takes the sum of multipleSourcemodels to make a single brightness model.- brightness(x, y, **kwargs)[source]#
Implements the brightness method for Sersic. The brightness at a given point is determined by the Sersic profile formula.
- Parameters:
x (ArrayLike) –
The x-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
y (ArrayLike) –
The y-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
- Returns:
The brightness of the source at the given point(s). The output tensor has the same shape as x and y.
Unit: flux
- Return type:
ArrayLike
caustics.light.pixelated module#
- class caustics.light.pixelated.Pixelated(image: Annotated[ArrayLike | None, 'The source image from which brightness values will be interpolated.', True, 'flux'] = None, x0: Annotated[ArrayLike | float | None, "The x-coordinate of the source image's center.", True] = None, y0: Annotated[ArrayLike | float | None, "The y-coordinate of the source image's center.", True] = None, pixelscale: Annotated[ArrayLike | float | None, 'The pixelscale of the source image in the lens plane', True, 'arcsec/pixel'] = None, scale: Annotated[ArrayLike | float | None, 'A scale factor to multiply by the image', True, 'flux'] = 1.0, shape: Annotated[tuple[int | None, ...], 'The shape of the source image.'] = (None, None), name: Annotated[str | None, 'Name of the source'] = None)[source]#
Bases:
SourcePixelatedis a subclass of the abstract classSource. It represents the brightness profile of source with a pixelated grid of intensity values.This class provides a concrete implementation of the
brightnessmethod required by theSourcesuperclass. In this implementation, brightness is determined by interpolating values from the provided source image.- x0#
The x-coordinate of the source image’s center.
Unit: arcsec
- Type:
ArrayLike, optional
- y0#
The y-coordinate of the source image’s center.
Unit: arcsec
- Type:
ArrayLike, optional
- image#
The source image from which brightness values will be interpolated.
Unit: flux
- Type:
ArrayLike, optional
- pixelscale#
The pixelscale of the source image in the lens plane.
Unit: arcsec/pixel
- Type:
ArrayLike, optional
- shape#
The shape of the source image.
- Type:
Tuple of ints, optional
- brightness(x, y, x0: Annotated[ArrayLike, 'Param'], y0: Annotated[ArrayLike, 'Param'], image: Annotated[ArrayLike, 'Param'], pixelscale: Annotated[ArrayLike, 'Param'], scale: Annotated[ArrayLike, 'Param'], padding_mode: str = 'zeros')[source]#
Implements the brightness method for Pixelated. The brightness at a given point is determined by interpolating values from the source image.
- Parameters:
x (ArrayLike) –
The x-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
y (ArrayLike) –
The y-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
- Returns:
The brightness of the source at the given coordinate(s). The brightness is determined by interpolating values from the source image.
Unit: flux
- Return type:
ArrayLike
caustics.light.pixelated_time module#
- class caustics.light.pixelated_time.PixelatedTime(cube: Annotated[ArrayLike | None, 'The source image cube from which brightness values will be interpolated.', True, 'flux'] = None, x0: Annotated[ArrayLike | float | None, "The x-coordinate of the source image's center.", True] = None, y0: Annotated[ArrayLike | float | None, "The y-coordinate of the source image's center.", True] = None, pixelscale: Annotated[ArrayLike | float | None, 'The pixelscale of the source image in the lens plane', False, 'arcsec/pixel'] = None, t_end: Annotated[ArrayLike | float | None, 'The end time of the source image cube.', False, 'seconds'] = None, scale: Annotated[ArrayLike | float | None, 'A scale factor to multiply by the image', True, 'flux'] = 1.0, shape: Annotated[tuple[int, ...] | None, 'The shape of the source image.'] = None, name: Annotated[str | None, 'Name of the source'] = None)[source]#
Bases:
SourcePixelatedTimeis a subclass of the abstract classSource. It represents the brightness profile of source with a pixelated grid of intensity values that also may vary over time.This class provides a concrete implementation of the
brightnessmethod required by theSourcesuperclass. In this implementation, brightness is determined by interpolating values from the provided source image.- x0#
The x-coordinate of the source image’s center.
Unit: arcsec
- Type:
ArrayLike, optional
- y0#
The y-coordinate of the source image’s center.
Unit: arcsec
- Type:
ArrayLike, optional
- cube#
The source image cube from which brightness values will be interpolated.
Unit: flux
- Type:
ArrayLike, optional
- pixelscale#
The pixelscale of the source image in the lens plane.
Unit: arcsec/pixel
- Type:
ArrayLike, optional
- t_end#
The end time of the source image cube. Time in the cube is assumed to be in the range (0, t_end) in seconds.
Unit: seconds
- Type:
ArrayLike, optional
- shape#
The shape of the source image and time dim.
- Type:
Tuple of ints, optional
- brightness(x, y, t, x0: Annotated[ArrayLike, 'Param'], y0: Annotated[ArrayLike, 'Param'], cube: Annotated[ArrayLike, 'Param'], scale: Annotated[ArrayLike, 'Param'])[source]#
Implements the brightness method for Pixelated. The brightness at a given point is determined by interpolating values from the source image.
- Parameters:
x (ArrayLike) –
The x-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
y (ArrayLike) –
The y-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
t (ArrayLike) –
The time coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: seconds
- Returns:
The brightness of the source at the given coordinate(s). The brightness is determined by interpolating values from the source image.
Unit: flux
- Return type:
ArrayLike
caustics.light.sersic module#
- class caustics.light.sersic.Sersic(x0: Annotated[ArrayLike | float | None, "The x-coordinate of the Sersic source's center", True] = None, y0: Annotated[ArrayLike | float | None, "The y-coordinate of the Sersic source's center", True] = None, q: Annotated[ArrayLike | float | None, 'The axis ratio of the Sersic source', True] = None, phi: Annotated[ArrayLike | float | None, 'The orientation of the Sersic source (position angle)', True] = None, n: Annotated[ArrayLike | float | None, 'The Sersic index, which describes the degree of concentration of the source', True] = None, Re: Annotated[ArrayLike | float | None, 'The scale length of the Sersic source', True] = None, Ie: Annotated[ArrayLike | float | None, 'The intensity at the effective radius', True] = None, s: Annotated[float, 'A small constant for numerical stability'] = 0.0, use_lenstronomy_k: Annotated[bool, 'A flag indicating whether to use lenstronomy to compute the value of k.'] = False, angle_system: str = 'q_phi', e1: ArrayLike | float | None = None, e2: ArrayLike | float | None = None, c1: ArrayLike | float | None = None, c2: ArrayLike | float | None = None, name: Annotated[str | None, 'Name of the source'] = None)[source]#
Bases:
Angle_Mixin,SourceSersic is a subclass of the abstract class Source. It represents a source in a strong gravitational lensing system that follows a Sersic profile, a mathematical function that describes how the intensity I of a galaxy varies with distance r from its center.
The Sersic profile is often used to describe elliptical galaxies and spiral galaxies’ bulges.
- x0#
The x-coordinate of the Sersic source’s center.
Unit: arcsec
- Type:
Optional[ArrayLike]
- y0#
The y-coordinate of the Sersic source’s center.
Unit: arcsec
- Type:
Optional[ArrayLike]
- q#
The axis ratio of the Sersic source.
Unit: unitless
- Type:
Optional[ArrayLike]
- phi#
The orientation of the Sersic source (position angle).
Unit: radians
- Type:
Optional[ArrayLike]
- n#
The Sersic index, which describes the degree of concentration of the source.
Unit: unitless
- Type:
Optional[ArrayLike]
- Re#
The scale length of the Sersic source.
Unit: arcsec
- Type:
Optional[ArrayLike]
- Ie#
The intensity at the effective radius.
Unit: flux
- Type:
Optional[ArrayLike]
- s#
A small constant for numerical stability.
Unit: arcsec
- Type:
float
- lenstronomy_k_mode#
A flag indicating whether to use lenstronomy to compute the value of k.
- Type:
bool
- brightness(x, y, x0: Annotated[ArrayLike, 'Param'], y0: Annotated[ArrayLike, 'Param'], q: Annotated[ArrayLike, 'Param'], phi: Annotated[ArrayLike, 'Param'], n: Annotated[ArrayLike, 'Param'], Re: Annotated[ArrayLike, 'Param'], Ie: Annotated[ArrayLike, 'Param'])[source]#
Implements the brightness method for Sersic. The brightness at a given point is determined by the Sersic profile formula.
- Parameters:
x (ArrayLike) –
The x-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
y (ArrayLike) –
The y-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
- Returns:
The brightness of the source at the given point(s). The output tensor has the same shape as x and y.
Unit: flux
- Return type:
ArrayLike
Notes
The Sersic profile is defined as: I(r) = Ie * exp(-k * ((r / r_e)^(1/n) - 1)), where Ie is the intensity at the effective radius r_e, n is the Sersic index that describes the concentration of the source, and k is a parameter that depends on n. In this implementation, we use elliptical coordinates ex and ey, and the transformation from Cartesian coordinates is handled by to_elliptical. The value of k can be calculated in two ways, controlled by lenstronomy_k_mode. If lenstronomy_k_mode is True, we use the approximation from Lenstronomy, otherwise, we use the approximation from Ciotti & Bertin (1999).
caustics.light.star_source module#
- class caustics.light.star_source.StarSource(x0: Annotated[ArrayLike | float | None, "The x-coordinate of the star source's center", True] = None, y0: Annotated[ArrayLike | float | None, "The y-coordinate of the star source's center", True] = None, theta_s: Annotated[ArrayLike | float | None, 'The radius of the star source', True] = None, Ie: Annotated[ArrayLike | float | None, 'The intensity at the effective radius', True] = None, gamma: Annotated[ArrayLike | float | None, 'The linear limb darkening coefficient', True] = None, name: Annotated[str | None, 'Name of the source'] = None)[source]#
Bases:
SourceStar is a subclass of the abstract class Source. It represents a star source in a gravitational lensing system.
The Star profile is meant to describe individual light sources.
- x0#
The x-coordinate of the Star source’s center.
Unit: arcsec
- Type:
Optional[ArrayLike]
- y0#
The y-coordinate of the Star source’s center.
Unit: arcsec
- Type:
Optional[ArrayLike]
- theta_s#
The radius of the star.
Unit: arcsec
- Type:
Optional[ArrayLike]
- Ie#
The intensity at the center of the star.
Unit: flux
- Type:
Optional[ArrayLike]
- gamma#
The linear limb darkening coefficient.
Unit: unitless
- Type:
Optional[ArrayLike]
- brightness(x, y, x0: Annotated[ArrayLike, 'Param'], y0: Annotated[ArrayLike, 'Param'], theta_s: Annotated[ArrayLike, 'Param'], Ie: Annotated[ArrayLike, 'Param'], gamma: Annotated[ArrayLike, 'Param'])[source]#
Implements the brightness method for star. This method calculates the brightness of the source at the given point(s).
- Parameters:
x (ArrayLike) –
The x-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
y (ArrayLike) –
The y-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
- Returns:
The brightness of the source at the given point(s). The output tensor has the same shape as x and y.
Unit: flux
- Return type:
ArrayLike
Module contents#
- class caustics.light.LightStack(light_models: Annotated[Tuple[Source], 'a list of light models to sum their brightnesses'], name: Annotated[str | None, 'Name of the source'] = None)[source]#
Bases:
SourceLightStackis a subclass of the abstract classSourcewhich takes the sum of multipleSourcemodels to make a single brightness model.- brightness(x, y, **kwargs)[source]#
Implements the brightness method for Sersic. The brightness at a given point is determined by the Sersic profile formula.
- Parameters:
x (ArrayLike) –
The x-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
y (ArrayLike) –
The y-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
- Returns:
The brightness of the source at the given point(s). The output tensor has the same shape as x and y.
Unit: flux
- Return type:
ArrayLike
- class caustics.light.Pixelated(image: Annotated[ArrayLike | None, 'The source image from which brightness values will be interpolated.', True, 'flux'] = None, x0: Annotated[ArrayLike | float | None, "The x-coordinate of the source image's center.", True] = None, y0: Annotated[ArrayLike | float | None, "The y-coordinate of the source image's center.", True] = None, pixelscale: Annotated[ArrayLike | float | None, 'The pixelscale of the source image in the lens plane', True, 'arcsec/pixel'] = None, scale: Annotated[ArrayLike | float | None, 'A scale factor to multiply by the image', True, 'flux'] = 1.0, shape: Annotated[tuple[int | None, ...], 'The shape of the source image.'] = (None, None), name: Annotated[str | None, 'Name of the source'] = None)[source]#
Bases:
SourcePixelatedis a subclass of the abstract classSource. It represents the brightness profile of source with a pixelated grid of intensity values.This class provides a concrete implementation of the
brightnessmethod required by theSourcesuperclass. In this implementation, brightness is determined by interpolating values from the provided source image.- x0#
The x-coordinate of the source image’s center.
Unit: arcsec
- Type:
ArrayLike, optional
- y0#
The y-coordinate of the source image’s center.
Unit: arcsec
- Type:
ArrayLike, optional
- image#
The source image from which brightness values will be interpolated.
Unit: flux
- Type:
ArrayLike, optional
- pixelscale#
The pixelscale of the source image in the lens plane.
Unit: arcsec/pixel
- Type:
ArrayLike, optional
- shape#
The shape of the source image.
- Type:
Tuple of ints, optional
- brightness(x, y, x0: Annotated[ArrayLike, 'Param'], y0: Annotated[ArrayLike, 'Param'], image: Annotated[ArrayLike, 'Param'], pixelscale: Annotated[ArrayLike, 'Param'], scale: Annotated[ArrayLike, 'Param'], padding_mode: str = 'zeros')[source]#
Implements the brightness method for Pixelated. The brightness at a given point is determined by interpolating values from the source image.
- Parameters:
x (ArrayLike) –
The x-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
y (ArrayLike) –
The y-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
- Returns:
The brightness of the source at the given coordinate(s). The brightness is determined by interpolating values from the source image.
Unit: flux
- Return type:
ArrayLike
- class caustics.light.PixelatedTime(cube: Annotated[ArrayLike | None, 'The source image cube from which brightness values will be interpolated.', True, 'flux'] = None, x0: Annotated[ArrayLike | float | None, "The x-coordinate of the source image's center.", True] = None, y0: Annotated[ArrayLike | float | None, "The y-coordinate of the source image's center.", True] = None, pixelscale: Annotated[ArrayLike | float | None, 'The pixelscale of the source image in the lens plane', False, 'arcsec/pixel'] = None, t_end: Annotated[ArrayLike | float | None, 'The end time of the source image cube.', False, 'seconds'] = None, scale: Annotated[ArrayLike | float | None, 'A scale factor to multiply by the image', True, 'flux'] = 1.0, shape: Annotated[tuple[int, ...] | None, 'The shape of the source image.'] = None, name: Annotated[str | None, 'Name of the source'] = None)[source]#
Bases:
SourcePixelatedTimeis a subclass of the abstract classSource. It represents the brightness profile of source with a pixelated grid of intensity values that also may vary over time.This class provides a concrete implementation of the
brightnessmethod required by theSourcesuperclass. In this implementation, brightness is determined by interpolating values from the provided source image.- x0#
The x-coordinate of the source image’s center.
Unit: arcsec
- Type:
ArrayLike, optional
- y0#
The y-coordinate of the source image’s center.
Unit: arcsec
- Type:
ArrayLike, optional
- cube#
The source image cube from which brightness values will be interpolated.
Unit: flux
- Type:
ArrayLike, optional
- pixelscale#
The pixelscale of the source image in the lens plane.
Unit: arcsec/pixel
- Type:
ArrayLike, optional
- t_end#
The end time of the source image cube. Time in the cube is assumed to be in the range (0, t_end) in seconds.
Unit: seconds
- Type:
ArrayLike, optional
- shape#
The shape of the source image and time dim.
- Type:
Tuple of ints, optional
- brightness(x, y, t, x0: Annotated[ArrayLike, 'Param'], y0: Annotated[ArrayLike, 'Param'], cube: Annotated[ArrayLike, 'Param'], scale: Annotated[ArrayLike, 'Param'])[source]#
Implements the brightness method for Pixelated. The brightness at a given point is determined by interpolating values from the source image.
- Parameters:
x (ArrayLike) –
The x-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
y (ArrayLike) –
The y-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
t (ArrayLike) –
The time coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: seconds
- Returns:
The brightness of the source at the given coordinate(s). The brightness is determined by interpolating values from the source image.
Unit: flux
- Return type:
ArrayLike
- class caustics.light.Sersic(x0: Annotated[ArrayLike | float | None, "The x-coordinate of the Sersic source's center", True] = None, y0: Annotated[ArrayLike | float | None, "The y-coordinate of the Sersic source's center", True] = None, q: Annotated[ArrayLike | float | None, 'The axis ratio of the Sersic source', True] = None, phi: Annotated[ArrayLike | float | None, 'The orientation of the Sersic source (position angle)', True] = None, n: Annotated[ArrayLike | float | None, 'The Sersic index, which describes the degree of concentration of the source', True] = None, Re: Annotated[ArrayLike | float | None, 'The scale length of the Sersic source', True] = None, Ie: Annotated[ArrayLike | float | None, 'The intensity at the effective radius', True] = None, s: Annotated[float, 'A small constant for numerical stability'] = 0.0, use_lenstronomy_k: Annotated[bool, 'A flag indicating whether to use lenstronomy to compute the value of k.'] = False, angle_system: str = 'q_phi', e1: ArrayLike | float | None = None, e2: ArrayLike | float | None = None, c1: ArrayLike | float | None = None, c2: ArrayLike | float | None = None, name: Annotated[str | None, 'Name of the source'] = None)[source]#
Bases:
Angle_Mixin,SourceSersic is a subclass of the abstract class Source. It represents a source in a strong gravitational lensing system that follows a Sersic profile, a mathematical function that describes how the intensity I of a galaxy varies with distance r from its center.
The Sersic profile is often used to describe elliptical galaxies and spiral galaxies’ bulges.
- x0#
The x-coordinate of the Sersic source’s center.
Unit: arcsec
- Type:
Optional[ArrayLike]
- y0#
The y-coordinate of the Sersic source’s center.
Unit: arcsec
- Type:
Optional[ArrayLike]
- q#
The axis ratio of the Sersic source.
Unit: unitless
- Type:
Optional[ArrayLike]
- phi#
The orientation of the Sersic source (position angle).
Unit: radians
- Type:
Optional[ArrayLike]
- n#
The Sersic index, which describes the degree of concentration of the source.
Unit: unitless
- Type:
Optional[ArrayLike]
- Re#
The scale length of the Sersic source.
Unit: arcsec
- Type:
Optional[ArrayLike]
- Ie#
The intensity at the effective radius.
Unit: flux
- Type:
Optional[ArrayLike]
- s#
A small constant for numerical stability.
Unit: arcsec
- Type:
float
- lenstronomy_k_mode#
A flag indicating whether to use lenstronomy to compute the value of k.
- Type:
bool
- brightness(x, y, x0: Annotated[ArrayLike, 'Param'], y0: Annotated[ArrayLike, 'Param'], q: Annotated[ArrayLike, 'Param'], phi: Annotated[ArrayLike, 'Param'], n: Annotated[ArrayLike, 'Param'], Re: Annotated[ArrayLike, 'Param'], Ie: Annotated[ArrayLike, 'Param'])[source]#
Implements the brightness method for Sersic. The brightness at a given point is determined by the Sersic profile formula.
- Parameters:
x (ArrayLike) –
The x-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
y (ArrayLike) –
The y-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
- Returns:
The brightness of the source at the given point(s). The output tensor has the same shape as x and y.
Unit: flux
- Return type:
ArrayLike
Notes
The Sersic profile is defined as: I(r) = Ie * exp(-k * ((r / r_e)^(1/n) - 1)), where Ie is the intensity at the effective radius r_e, n is the Sersic index that describes the concentration of the source, and k is a parameter that depends on n. In this implementation, we use elliptical coordinates ex and ey, and the transformation from Cartesian coordinates is handled by to_elliptical. The value of k can be calculated in two ways, controlled by lenstronomy_k_mode. If lenstronomy_k_mode is True, we use the approximation from Lenstronomy, otherwise, we use the approximation from Ciotti & Bertin (1999).
- class caustics.light.Source(name: str | None = None, **kwargs)[source]#
Bases:
ModuleThis is an abstract base class used to represent a source in a strong gravitational lensing system. It provides the basic structure and required methods that any derived source class should implement. The Source class inherits from the Module class, implying that it contains parameters that can be optimized or manipulated.
The class introduces one abstract method, brightness, that must be implemented in any concrete subclass. This method calculates the brightness of the source at given coordinates.
- abstract brightness(x: ArrayLike, y: ArrayLike, *args, **kwargs) ArrayLike[source]#
Abstract method that calculates the brightness of the source at the given coordinates. This method is expected to be implemented in any class that derives from Source.
- Parameters:
x (ArrayLike) –
The x-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
y (ArrayLike) –
The y-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
- Returns:
The brightness of the source at the given coordinate(s). The exact form of the output will depend on the specific implementation in the derived class.
- Return type:
ArrayLike
Notes
This method must be overridden in any class that inherits from Source.
Note that the source redshift z_s is not included as an argument since most sources don’t need to know their redshift, it is instead held by the lens object.
- class caustics.light.StarSource(x0: Annotated[ArrayLike | float | None, "The x-coordinate of the star source's center", True] = None, y0: Annotated[ArrayLike | float | None, "The y-coordinate of the star source's center", True] = None, theta_s: Annotated[ArrayLike | float | None, 'The radius of the star source', True] = None, Ie: Annotated[ArrayLike | float | None, 'The intensity at the effective radius', True] = None, gamma: Annotated[ArrayLike | float | None, 'The linear limb darkening coefficient', True] = None, name: Annotated[str | None, 'Name of the source'] = None)[source]#
Bases:
SourceStar is a subclass of the abstract class Source. It represents a star source in a gravitational lensing system.
The Star profile is meant to describe individual light sources.
- x0#
The x-coordinate of the Star source’s center.
Unit: arcsec
- Type:
Optional[ArrayLike]
- y0#
The y-coordinate of the Star source’s center.
Unit: arcsec
- Type:
Optional[ArrayLike]
- theta_s#
The radius of the star.
Unit: arcsec
- Type:
Optional[ArrayLike]
- Ie#
The intensity at the center of the star.
Unit: flux
- Type:
Optional[ArrayLike]
- gamma#
The linear limb darkening coefficient.
Unit: unitless
- Type:
Optional[ArrayLike]
- brightness(x, y, x0: Annotated[ArrayLike, 'Param'], y0: Annotated[ArrayLike, 'Param'], theta_s: Annotated[ArrayLike, 'Param'], Ie: Annotated[ArrayLike, 'Param'], gamma: Annotated[ArrayLike, 'Param'])[source]#
Implements the brightness method for star. This method calculates the brightness of the source at the given point(s).
- Parameters:
x (ArrayLike) –
The x-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
y (ArrayLike) –
The y-coordinate(s) at which to calculate the source brightness. This could be a single value or a tensor of values.
Unit: arcsec
- Returns:
The brightness of the source at the given point(s). The output tensor has the same shape as x and y.
Unit: flux
- Return type:
ArrayLike