Skip to content

Source Parametrisations

This is a small module for converting from parametric source values (separation, position angle, mean flux, contrast, etc) to individual source properties (position, flux, etc).

fluxes_from_contrast

Computes the fluxes of a binary object given the mean flux and contrast.

Parameters:

Name Type Description Default
mean_flux float

The mean flux of the binary object.

required
contrast float

The contrast of the binary object.

required

Returns:

Name Type Description
fluxes Array

The flux (flux1, flux2) of the binary object.

Source code in src/dLux/utils/source.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
def fluxes_from_contrast(mean_flux: float, contrast: float) -> Array:
    """
    Computes the fluxes of a binary object given the mean flux and contrast.

    Parameters
    ----------
    mean_flux : float
        The mean flux of the binary object.
    contrast : float
        The contrast of the binary object.

    Returns
    -------
    fluxes : Array
        The flux (flux1, flux2) of the binary object.
    """
    return 2 * np.array([contrast * mean_flux, mean_flux]) / (1 + contrast)

positions_from_sep

Computes the on-sky positions of a binary object given the separation and position angle.

Parameters:

Name Type Description Default
position (Array, radians)

The on-sky position of the primary object.

required
separation (float, radians)

The separation of the binary object.

required
position_angle (float, radians)

The position angle of the binary object.

required

Returns:

Name Type Description
position (Array, radians)

The ((x, y), (x, y)) on-sky position of this object.

Source code in src/dLux/utils/source.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
def positions_from_sep(
    position: Array, separation: float, position_angle: float
) -> Array:
    """
    Computes the on-sky positions of a binary object given the separation and
    position angle.

    Parameters
    ----------
    position : Array, radians
        The on-sky position of the primary object.
    separation : float, radians
        The separation of the binary object.
    position_angle : float, radians
        The position angle of the binary object.

    Returns
    -------
    position : Array, radians
        The ((x, y), (x, y)) on-sky position of this object.
    """
    r, phi = separation / 2, position_angle
    sep_vec = np.array([r * np.sin(phi), r * np.cos(phi)])
    return np.array([position + sep_vec, position - sep_vec])