pipecal_photometry

sofia_redux.calibration.pipecal_photometry.pipecal_photometry(image, variance, srcpos=None, fitsize=138, stampsize='auto', fwhm=5.0, profile='moffat', aprad=12.0, skyrad=None, runits='Me/s', stamp_center=True, allow_badfit=False)[source]

Perform aperture photometry and profile fits on image data.

Procedure:
  1. Take a small stamp image near the source position and fit a profile to it to get a centroid position of the source. The fit is performed by pipecal_fitpeak.

  2. Refit a larger subimage (set by fitsize) with pipecal_fitpeak to get fit parameters with associated errors.

  3. Call photutils to perform aperture photometry at the centroid position.

  4. Return calculated values in list of dictionaries.

Parameters:
imagearray

2D image array containing an object to perform photometry on.

variancearray

2D variance array corresponding to image values.

srcposarray-like, optional

Initial guess at source position (x,y), zero-indexed. Defaults to the center of the image if not provided.

fitsizeint, optional

Size of subimage to fit.

stampsize‘auto’, int, or float, optional

Size of initial stamp, for peak location. If ‘auto’, the stamp will be derived from the fitsize.

fwhmfloat, optional

Initial guess at PSF FWHM.

profile{‘moffat’, ‘gaussian’, ‘lorentzian’}, optional

Type of profile to fit to image.

apradfloat, optional

Aperture radius for aperture photometry.

skyradarray-like, optional

Sky radii (inner, outer) for aperture photometry. Defaults to [15.,25.] if not provided.

runitsstring, optional

Raw data units, before flux calibration. Used in comment strings for some output keywords.

stamp_centerbool, optional

If True, the initial centroid position will be adjusted by the centroid in the stamp fit. This is usually desirable, but may sometimes result in the fit being pulled away from the intended target, in the case of crowded fields. If False, the starting source position is not adjusted by the centroid in the stamp fit before doing the full image profile fit.

allow_badfitbool, optional

If False, failed profile fits will raise PipeCalErrors. If True, an error will be logged, but an exception will not be raised, and aperture photometry will still be attempted at the initial source position.

Returns:
photlist

List containing photometric measurements values. Each value stored in a dictionary with fields ‘key’, ‘value’, and ‘comment’. If the value has an associated error, it is stored in ‘value’ as a two-element array, where the first element is the value and the second element is the error.

Raises:
PipeCalError

For any improperly set parameters or for failed fit.