pipecal_applyphot

sofia_redux.calibration.pipecal_applyphot.pipecal_applyphot(fitsfile, srcpos=None, fitsize=None, fwhm=None, profile='moffat', aprad=None, skyrad=None, runits=None, overwrite=True)[source]

Calculate photometry on a FITS image and store results to FITS header.

FITS images are expected to have been produced by either the HAWC+, FORCAST, or FLITECAM pipelines. For any other data format, call the pipecal_util.run_photometry function instead.

The procedure followed here is:

  1. Read the header, data, and variance from the FITS file.

  2. Call pipecal_photometry on the data.

  3. Add photometry keywords to header.

  4. Write file back to disk.

Defaults for all photometry parameters except srcpos are determined from the instrument configuration (pipecal_config) if possible. If not, they are set by pipecal_photometry instead.

Parameters:
fitsfilestring

Path to a FITS image file.

srcpos2d-array, optional

Initial guess at source position (x,y), zero-indexed. If not provided, will be read from FITS header keywords SRCPOSX, SRCPOSY if present.

fitsizefloat, optional

Size of subimage to fit.

fwhmfloat, optional

Initial guess at PSF fwhm.

profilestring, optional

Fit type (Moffat, Lorentzian, Gaussian).

apradfloat, optional

Aperture radius for aperture photometry.

skyradarray-like, optional

Sky radii (inner, outer) for aperture photometry.

runitsstring, optional

Raw data units, before flux calibration.

overwritebool, optional

If set, the input FITS file will be overwritten with the updated header. If not, a FITS file of the same base name and a ‘_new.fits` suffix will be written instead, to the same location as the input file.