find_line

acstools.utils_calib.find_line(scihdu, refhdu)

Obtain bin factors and corner location to extract and bin the appropriate subset of a reference image to match a science image.

If the science image has zero offset and is the same size and binning as the reference image, same_size will be set to True. Otherwise, the values of rx, ry, x0, and y0 will be assigned.

Normally the science image will be binned the same or more than the reference image. In that case, rx and ry will be the bin size of the science image divided by the bin size of the reference image.

If the binning of the reference image is greater than the binning of the science image, the ratios (rx and ry) of the bin sizes will be the reference image size divided by the science image bin size. This is not necessarily an error.

Note

Translated from calacs/lib/findbin.c.

Parameters:
  • scihdu (obj) – Extension HDU’s of the science and reference image, respectively.

  • refhdu (obj) – Extension HDU’s of the science and reference image, respectively.

Returns:

  • same_size (bool) – True if zero offset and same size and binning.

  • rx, ry (int) – Ratio of bin sizes.

  • x0, y0 (int) – Location of start of subimage in reference image.

Raises:

ValueError – Science and reference data size mismatch.