Kernel Nuller#

class phise.SuperKN(
φ: ndarray[Quantity],
σ: ndarray[Quantity],
λ0: Quantity,
output_order: ndarray[int] = None,
input_attenuation: ndarray[float] = None,
input_opd: ndarray[Quantity] = None,
name: str = 'Unnamed Kernel-Nuller',
)[source]#

Bases: Chip

Kernel nuller representation for 4 telescopes.

Parameters:
  • φ (u.Quantity) – (14,) array of applied OPDs (length units).

  • σ (u.Quantity) – (14,) array of intrinsic OPD errors.

  • λ0 (u.Quantity) – Reference wavelength at which matrices are defined.

  • output_order (np.ndarray[int] | None) – Output ordering (6 elements) defining output pairs.

  • input_attenuation (np.ndarray[float] | None) – Attenuations on the 4 optical inputs.

  • input_opd (u.Quantity | None) – Relative OPDs applied to the 4 inputs.

  • name (str) – Descriptive name.

property φ#

Applied OPD/phase per nuller element.

Returns:

Shape (14,) in length units (e.g., meters).

Return type:

u.Quantity

property σ#

Intrinsic OPD errors of the nuller.

Returns:

Shape (14,) in same unit as φ.

Return type:

u.Quantity

property λ0#

Reference wavelength of the model.

Returns:

Reference wavelength (e.g., meters).

Return type:

u.Quantity

property output_order#

Output order of the nuller.

Returns:

Length-6 array describing the output order and

pair structure.

Return type:

np.ndarray[int]

rebind_outputs(λ)[source]#

Correct output ordering of the SuperKN object.

Successively obstruct two inputs and add a π/4 phase over one of the two remaining inputs to determine output pairing and ordering.

Parameters:

λ (u.Quantity) – Observation wavelength.

Returns:

Updates self.output_order in place.

Return type:

None

property input_attenuation#

Input attenuations.

Returns:

Length-4 multiplicative attenuation factors.

Return type:

np.ndarray[float]

property input_opd#

Relative OPD applied on each input.

Returns:

Shape (4,) in length units.

Return type:

u.Quantity

property name#

Descriptive instance name.

Returns:

Kernel nuller name.

Return type:

str

property parent_interferometer#

Parent interferometer associated with this kernel nuller.

Read-only property set during association with an Interferometer object.

property bright_shifters_indices: list[int]#

Indices of shifters primarily controlling bright outputs.

property kernel_shifters_indices: list[int]#

Indices of shifters primarily controlling kernel null depths.

property get_output_fields_jit#

Return the @njit function for computing SuperKN output fields.

property process_outputs_jit#

Return the @njit function for processing SuperKN outputs.

get_output_fields(
ψ: ndarray[complex],
λ: Quantity,
φ: Quantity | None = None,
σ: Quantity | None = None,
) Tuple[ndarray, ndarray, ndarray, float][source]#

Propagate input fields through the kernel nuller. :param ψ: Input complex fields for the 4 channels (shape (4,)). :type ψ: np.ndarray[complex] :param λ: Wavelength for propagation. :type λ: u.Quantity :param φ: Override for phase shifters OPDs. :type φ: Optional[u.Quantity] :param σ: Override for intrinsic OPD errors. :type σ: Optional[u.Quantity]

Returns:

Output complex fields (shape (7,)).

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray, float]

expected_outputs(
ψ: ndarray[complex],
) tuple[float, ndarray[float], ndarray[float]][source]#

Compute expected outputs from input fields using analytical model.

Parameters:

ψ (np.ndarray[complex]) – Input complex fields for the 4 channels (shape (4,)).

Returns:

  • bright (float): Bright output intensity.

  • darks (np.ndarray[float]): Dark outputs intensities (shape (6,)).

  • kernels (np.ndarray[float]): Kernel outputs intensities (shape (3,)).

Return type:

tuple

process_outputs(
out: ndarray[float],
) ndarray[float][source]#

Compute processed kernel outputs from raw output intensities. :param out: Raw output intensities (shape (7,)). :type out: np.ndarray[float]

Returns:

Processed kernel outputs (shape (4,)).

Return type:

np.ndarray[float]

plot_output_phase(
λ: Quantity,
ψ: ndarray | None = None,
plot: bool = True,
n_cols: int | None = None,
ref_input1: bool = True,
) Any | None[source]#

Plot output phases and amplitudes of the nuller.

Computes output responses for each isolated input and plots the phase and amplitude of null, dark, and bright outputs on polar diagrams.

Parameters:
  • λ (u.Quantity) – Wavelength for the simulation.

  • ψ (Optional[np.ndarray]) – Input complex amplitudes (default [0.5,…]).

  • plot (bool) – If True, display the figure; if False, return the image bytes.

  • n_cols (Optional[int]) – Number of columns for the plot grid. If None, all plots are on a single row.

  • ref_input1 (bool) – If True, use Input 1 (Bright output) as global phase reference (set to 0°).