hypotheses#

Methods for finding hypotheses of the form (Y, T), that is, pixel Y seems to contain a planet signal at time T.

hsr4hci.hypotheses.get_all_hypotheses(roi_mask, residuals, parang, n_signal_times, frame_size, psf_template, minimum_similarity=0.0, n_roi_splits=1, roi_split=0)[source]#

This is a convenience function which wraps the loop over the ROI to call get_hypothesis_for_position() for every spatial pixel. See there for a full documentation of all parameters.

Parameters:
Return type:

Tuple[ndarray, ndarray]

hsr4hci.hypotheses.get_hypothesis_for_position(residuals, position, parang, n_signal_times, frame_size, psf_template, minimum_similarity=0.0)[source]#

Take a dictionary containing the full training results and find, for a given spatial position, the time T at which we suspect there to be a planet at the position. If there is no time at which the residuals look like the contain a planet, return NaN.

Parameters:
  • residuals (Dict[str, ndarray]) – A dictionary containing the residuals of all models that we have trained. The keys should be β€œdefault”, β€œ0”, …, β€œN”, where the latter are the signal times of the temporal grid that was used during training, and each key should map to a 3D numpy array consisting of the residuals for the respective model.

  • position (Tuple[int, int]) – A tuple (x, y) specifying the position for which we want to find the best hypothesis (i.e., the best guess for the time at which this pixel contains a planet).

  • parang (ndarray) – A 1D numpy array of shape (n_frames, ) containing the parallactic angles for each frame.

  • n_signal_times (int) – An integer specifying the number of different signal times, that is, the size of the temporal grid that was used during training.

  • frame_size (Tuple[int, int]) – A tuple (x_size, y_size) specifying the size (in pixels) of the frames that we are working with.

  • psf_template (ndarray) – A 2D numpy array containing the unsaturated PSF template for the data set.

  • minimum_similarity (float) – Minimum cosine similarity between the expected and the observed signal for the signal to be counted as a hypothesis.

Returns:

A tuple (signal_time, similarity), where signal_time is the best guess for the signal_time of the planet signal in position, and score is the corresponding cosine similarity between the expected and the observed signal. If the position does not seem to contain a planet signal at any time, both of these values are NaN.

Return type:

Tuple[float, float]