PHRINGE

class phringe.main.PHRINGE(seed: Optional[int] = None, gpu_index: Optional[int] = None, device: Optional[device] = None, grid_size=40, time_step_size: Optional[float] = None, extra_memory: int = 1)

Main PHRINGE class.

Parameters:
  • seed (int or None) – Seed for the generation of random numbers. If None, a random seed is chosen.

  • gpu_index (int or None) – Index corresponding to the GPU that should be used. If None or if the index is not available, the CPU is used.

  • device (torch.device or None) – Device to use; alternatively to the index of the GPU. If None, the device is chosen based on the GPU index.

  • grid_size (int) – Grid size used for the calculations.

  • time_step_size (float) – Time step size used for the calculations. By default, this is the detector integration time. If it is smaller, the generated data will be rebinned to the detector integration times at the end of the calculations.

  • extra_memory (int) – Extra memory factor to use for the calculations. This might be required to handle large data sets.

_detector_time_steps

Detector time steps.

Type:

torch.Tensor

_device

Device.

Type:

torch.device

_extra_memory

Extra memory.

Type:

int

_grid_size

Grid size.

Type:

int

_instrument

Instrument.

Type:

Instrument

_observation

Observation.

Type:

Observation

_scene

Scene.

Type:

Scene

_simulation_time_steps

Simulation time steps.

Type:

torch.Tensor

_time_step_size

Time step size.

Type:

float

analysis

Analysis object adding additional functionality.

Type:

Analysis

seed

Seed.

Type:

int

get_collector_positions()

Return the collector positions of the instrument as a tensor of shape (2 x N_inputs x N_time).

Returns:

Collector positions.

Return type:

torch.Tensor

get_counts(kernels: bool = False) Tensor

Calculate and return the time-binned raw photoelectron counts for all outputs (N_outputs x N_wavelengths x N_time_steps) or for kernels (N_kernels x N_wavelengths x N_time_steps).

Parameters:

kernels (bool) – Whether to use kernels for the calculations. Default is True.

Returns:

Raw photoelectron counts.

Return type:

torch.Tensor

get_field_of_view() Tensor

Return the field of view.

Returns:

Field of view.

Return type:

torch.Tensor

get_instrument_response(fov: float = 7.27e-07, kernels=False, perturbations=True) Tensor

Get the empirical instrument response. This corresponds to an array of shape (n_out x n_wavelengths x n_time_steps x n_grid x n_grid) if kernels=False and (n_diff_out x n_wavelengths x n_time_steps x n_grid x n_grid) if kernels=True.

Parameters:
  • fov (float) – Field of view in rad for which to calculate the instrument response. Default is 7.27e-7 rad (150 mas).$

  • kernels (bool) – Whether to use kernels for the calculations. Default is False.

  • perturbations (bool) – Whether to include perturbations in the calculations. Default is True.

Returns:

Empirical instrument response.

Return type:

torch.Tensor

get_model_counts(spectral_energy_distribution: ndarray, x_position: float, y_position: float, kernels: bool = False) ndarray
get_model_counts(spectral_energy_distribution: ndarray, semi_major_axis: float, eccentricity: float, inclination: float, raan: float, argument_of_periapsis: float, true_anomaly: float, host_star_distance: float, host_star_mass: float, planet_mass: float, kernels: bool = False) ndarray

Return the planet template (model) counts for a given spectral energy distribution and either 1) sky coordinates or 2) orbital elements.The output array has shape (n_diff_out x n_wavelengths x n_time_steps) if kernels=True and (n_out x n_wavelengths x n_time_steps) if kernels=False.

Parameters:
  • spectral_energy_distribution (numpy.ndarray) – Spectral energy distribution in photons/(m^2 s m).

  • kernels (bool) – Whether to use kernels for the calculations. Default is False.

  • **kwargs – Either x_position and y_position (both float, in radians) or semi_major_axis (float, in meters), eccentricity (float), inclination (float, in radians), raan (float, in radians), argument_of_periapsis (float, in radians), true_anomaly (float, in radians), host_star_distance (float, in meters), host_star_mass (float, in kg) and planet_mass (float, in kg).

Returns:

Model counts.

Return type:

numpy.ndarray

get_null_depth() Tensor

Return the null depth as an array of shape (n_diff_out x n_wavelengths x n_time_steps).

Returns:

Null depth.

Return type:

torch.Tensor

get_nulling_baseline() float

Return the nulling baseline. If it has not been set manually, it is calculated using the observation and instrument parameters.

Returns:

Nulling baseline.

Return type:

float

Returns:

Indices of the time slices.

Return type:

torch.Tensor

get_source_spectrum(source_name: str) Tensor

Return the spectral energy distribution of a source.

Parameters:

source_name (str) – Name of the source.

Returns:

Spectral energy distribution of the source.

Return type:

torch.Tensor

get_time_steps() Tensor

Return the detector time steps.

Returns:

Detector time steps.

Return type:

torch.Tensor

get_wavelength_bin_centers() Tensor

Return the wavelength bin centers.

Returns:

Wavelength bin centers.

Return type:

torch.Tensor

get_wavelength_bin_edges() Tensor

Return the wavelength bin edges.

Returns:

Wavelength bin edges.

Return type:

torch.Tensor

get_wavelength_bin_widths() Tensor

Return the wavelength bin widths.

Returns:

Wavelength bin widths.

Return type:

torch.Tensor

set(entity: Union[Instrument, Observation, Scene, Configuration])

Set the instrument, observation, scene, or configuration.

Parameters:

entity (Instrument or Observation or Scene or Configuration) – Instrument, observation, scene, or configuration.