derotating#
Methods for (de)-rotating stacks and computing residuals.
- hsr4hci.derotating.derotate_combine(stack, parang, mask=None, order=3, combine='mean', n_processes=4)[source]#
Derotate all frames in the stack and combine (= average) them.
- Parameters:
stack (ndarray) β A 3D numpy array of shape (n_frames, width, height) containing the stack of (residual) frames.
parang (ndarray) β A 1D numpy array of shape (n_frames, ) containing the respective parallactic angle for each frame.
mask (Optional[ndarray]) β Mask to apply after derotating. Usually, pixels for which there exist no values are set to NaN. However, for derotating, these have to be cast to zeros (otherwise the interpolation turns everything into a NaN). This mask here allows to restore these NaN values again.
order (int) β The order of the spline interpolation for the rotation. Has to be in the range [0, 5]; default is 3.
combine (str) β A string specifying how to combine the frames after derotating them. Options are βmeanβ or βmedianβ.
n_processes (int) β Number of parallel processes to be used to derotate the frames in parallel; default is 4.
- Returns:
A 2D numpy array of shape (width, height) containing the derotated and combined stack.
- Return type:
- hsr4hci.derotating.derotate_frames(stack, parang, mask=None, order=3, n_processes=4)[source]#
Derotate all frames in the stack by their parallactic angle.
- Parameters:
stack (ndarray) β Stack of frames to be de-rotated.
parang (ndarray) β Array of parallactic angles (one for each frame).
mask (Optional[ndarray]) β Mask to apply after derotating. Usually, pixels for which there exist no values are set to NaN. However, for derotating, these have to be cast to zeros (otherwise the interpolation turns everything into a NaN). This mask here allows to restore these NaN values again. Note that this mask selects the pixels that will be set to NaN; that means, for example, the usual ROI mask should be inverted before it is passed to this function.
order (int) β The order of the spline interpolation for the rotation. Has to be in the range [0, 5]; default is 3.
n_processes (int) β Number of parallel processes to be used to derotate the frames in parallel; default is 4.
- Returns:
The stack with every frame derotated by its parallactic angle.
- Return type: