data#

Methods for loading data sets.

hsr4hci.data.get_field_rotation(parang)[source]#

Compute the field rotation from a given array of parallactic angles.

Parameters:

parang (ndarray) – A 1D numpy array of shape (n_frames,) that contains the parallactic angle for each frame in degree.

Returns:

The field rotation in degree.

Return type:

float

hsr4hci.data.load_dataset(name_or_path, binning_factor=1, frame_size=None, remove_planets=False)[source]#

Convenience wrapper to load the stack, the parallactic angles, the PSF template, the observing conditions and the metadata all at once.

Parameters:
  • name_or_path (Union[str, Path]) – Name of a data set (e.g., “beta_pictoris__lp”), or Path to an HDF file that contains the data set.

  • binning_factor (int) – Number of frames that should be temporally binned (“pre-stacked”) using a block-wise mean.

  • frame_size (Optional[Tuple[int, int]]) – Target frame size to which the stack should be (spatially) cropped.

  • remove_planets (bool) – If yes, negative fake planets are injected at the positions of the known planets to remove them from the stack. Useful for experiments with fake planets, for which a “clean” stack is required.

Returns:

The 5-tuple (stack, parang, psf_template, obs_con, metadata).

Return type:

Tuple[ndarray, ndarray, ndarray, ObservingConditions, Dict[str, Union[str, float]]]

hsr4hci.data.load_metadata(name_or_path, **_)[source]#

Load the metadata.

Parameters:
  • name_or_path (Union[str, Path]) – Name of a data set (e.g., “beta_pictoris__lp”), or Path to an HDF file that contains the data set.

  • _ (Any) –

Returns:

A dictionary containing the metadata.

Return type:

dict

hsr4hci.data.load_observing_conditions(name_or_path, binning_factor=1, **_)[source]#

Load the observing conditions.

Parameters:
  • name_or_path (Union[str, Path]) – Name of a data set (e.g., “beta_pictoris__lp”), or Path to an HDF file that contains the data set.

  • binning_factor (int) – Number of time steps that should be temporally binned (“pre-stacked”) using a block-wise mean.

  • _ (Any) –

Returns:

An object containing the observing conditions.

Return type:

ObservingConditions

hsr4hci.data.load_parang(name_or_path, binning_factor=1, **_)[source]#

Load the parallactic angles.

Parameters:
  • name_or_path (Union[str, Path]) – Name of a data set (e.g., “beta_pictoris__lp”), or Path to the HDF file that contains a data set.

  • binning_factor (int) – Number of time steps that should be temporally binned (“pre-stacked”) using a block-wise mean.

  • _ (Any) –

Returns:

A numpy array containing the parallactic angles.

Return type:

ndarray

hsr4hci.data.load_planets(name_or_path, **_)[source]#

Load information about the planets (i.e., positions and contrasts).

Parameters:
  • name_or_path (Union[str, Path]) – Name of a data set (e.g., “beta_pictoris__lp”), or Path to an HDF file that contains the data set.

  • _ (Any) –

Returns:

A dictionary containing the planet information.

Return type:

dict

hsr4hci.data.load_psf_template(name_or_path, **_)[source]#

Load the unsaturated PSF template.

Parameters:
  • name_or_path (Union[str, Path]) – Name of a data set (e.g., “beta_pictoris__lp”), or Path to an HDF file that contains the data set.

  • _ (Any) –

Returns:

A numpy array containing the unsaturated PSF template.

Return type:

ndarray

hsr4hci.data.load_stack(name_or_path, binning_factor=1, frame_size=None, remove_planets=False)[source]#

Load the stack.

Parameters:
  • name_or_path (Union[str, Path]) – Name of a data set (e.g., “beta_pictoris__lp”), or Path to an HDF file that contains the data set.

  • binning_factor (int) – Number of frames that should be temporally binned (“pre-stacked”) using a block-wise mean.

  • frame_size (Optional[Tuple[int, int]]) – Target frame size to which the stack should be (spatially) cropped.

  • remove_planets (bool) – If yes, negative fake planets are injected at the positions of the known planets to remove them from the stack. Useful for experiments with fake planets, for which a “clean” stack is required.

Returns:

A 3D numpy array of shape (n_frames, x_size, y_size) that contains the stack after cropping / binning / planet removal.

Return type:

ndarray