webbpsf_ext.image_manip.rotate_shift_image

webbpsf_ext.image_manip.rotate_shift_image(hdul, index=0, angle=0, delx_asec=0, dely_asec=0, shift_func=<function fshift>, **kwargs)[source]

Rotate/Shift image

Rotate then offset image by some amount. Positive angles rotate the image counter-clockwise.

Parameters
  • hdul (HDUList) – Input HDUList

  • index (int) – Specify HDU index, usually 0

  • angle (float) – Rotate entire scene by some angle. Positive angles rotate counter-clockwise.

  • delx_asec (float) – Offset in x direction (specified in arcsec). Pixel scale should be included in header keyword ‘PIXELSCL’.

  • dely_asec (float) – Offset in x direction (specified in arcsec). Pixel scale should be included in header keyword ‘PIXELSCL’.

  • shift_func (function) – Function to use for shifting. Usually either fshift or fourier_imshift.

Keyword Arguments
  • order (int, optional) – The order of the spline interpolation, default is 3. The order has to be in the range 0-5.

  • mode ({'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional) –

    The mode parameter determines how the input array is extended beyond its boundaries. Default is ‘constant’. Behavior for each valid value is as follows:

    ’reflect’ (d c b a | a b c d | d c b a)

    The input is extended by reflecting about the edge of the last pixel.

    ’constant’ (k k k k | a b c d | k k k k)

    The input is extended by filling all values beyond the edge with the same constant value, defined by the cval parameter.

    ’nearest’ (a a a a | a b c d | d d d d)

    The input is extended by replicating the last pixel.

    ’mirror’ (d c b | a b c d | c b a)

    The input is extended by reflecting about the center of the last pixel.

    ’wrap’ (a b c d | a b c d | a b c d)

    The input is extended by wrapping around to the opposite edge.

  • cval (scalar, optional) – Value to fill past edges of input if mode is ‘constant’. Default is 0.0.

  • prefilter (bool, optional) – Determines if the input array is prefiltered with spline_filter before interpolation. The default is True, which will create a temporary float64 array of filtered values if order > 1. If setting this to False, the output will be slightly blurred if order > 1, unless the input is prefiltered, i.e. it is the result of calling spline_filter on the original input.