guess_source_position

sofia_redux.calibration.pipecal_util.guess_source_position(header, image, srcpos=None)[source]

Estimate the position of a standard source in the image.

The following information sources are checked in order:

  1. The srcpos parameter

  2. SRCPOSX and SRCPOSY keywords in the header

  3. The brightest peak found by photutils.find_peaks.

  4. CRPIX1 and CRPIX2 keywords in the header.

If a successful value is found at any stage, no further checks are done.

Parameters:
headerastropy.io.fits.header.Header

FITS header corresponding to the image.

imagearray

2D image data to check for peaks.

srcposlist or tuple, optional

If provided, should be the desired source position, listed as (x,y), indexed from 0.

Returns:
list, or None

The estimated source position, as (x,y), zero-indexed. None is returned if no valid source positions could be found.