stack2d

interferopy.tools.stack2d(ras, decs, im, imhead, imrms=None, pathout=None, overwrite=False, naxis=100, interpol=True)[source]

Perform median and mean (optionally rms weighted) stacking of multiple sources in a single radio map. This function requires that the first index is the x coordinate, and the second one y. If the map was opened with the fits package, it likely has to be transposed first with im.T. Opening the map as interferopy.Cube object does this transposition automatically.

Parameters
  • ras – List of right ascentions.

  • decs – List of declinations.

  • im – 2D radio map indexed as im[ra,dec].

  • imhead – Image header.

  • imrms – 2D rms noise map; if provided the mean stack will be noise weigthed.

  • pathout – Filename for the output stacks, if None, no output is written to disk.

  • overwrite – Overwrites files when saving (pathout).

  • naxis – The size of the cutout square in pixels.

  • interpol – Perform subpixel inteprolation (bicubic spline)

Returns

stack_mean, stack_median, stack_head, cube - 2D map, 2D map, text header, 3D cube of cutouts