get_rotated_column_average

grizli.prep.get_rotated_column_average(data, mask, theta, axis=1, statfunc=<function nanmedian>, order=0)[source]

Get median along an image axis after rotating by and angle theta, e.g., for long NIRcam diffraction spikes

Parameters
dataarray-like

Science data

maskarray-like

Mask for valid data

thetafloat

Rotation angle passed to scipy.ndimage.rotate (degrees)

axisint

Image axis along which to compute statfunc

statfuncfunction

Statistic to calculate. Should be nan-safe as masked pixels are filled with nan

orderint

Interpolation order for scipy.ndimage.rotate. Default order=0 is nearest-neighbor interpolation and fastest

Returns
backarray-like

Filled array of statfunc rotated back to the original frame