peakfind¶
- sofia_redux.instruments.forcast.peakfind.peakfind(coadded, newimage=None, refine=True, npeaks=4, fwhm=4.5, sharplo=0.2, sharphi=1.0, roundlo=-0.75, roundhi=0.75, silent=False, maxiter=1000, epsilon=5, eps=1e-07, ncut=30, chopnoddist=None, positive=False, smooth=True, return_object=False, coordinates=False)[source]¶
Find peaks (stars) in FORCAST images
Identifies the desired number of peaks in the image using the DAO search algorithm followed by optional (default=True) Levenberg- Marquardt least squares fitting of a gaussian psf to refine the fit.
- Parameters:
- coaddednumpy.ndarray
Reference image to find peak positions
- newimagenumpy.ndarray, optional
Secondary image to compare to coadded. If provided, the return value will be the shifts required to move the sources in newimage onto the sources in coadded. If not provided, the return value is the positions of the peaks in coadded
- refinebool, optional
If set, the x, y coordinates are fine tuned by fitting a Gaussian to the profile of each found center
- npeaksint, optional
Number of peaks to find; usually determined from the chop/nod mode
- fwhmfloat, optional
Expected FWHM in pixels
- roundlofloat, optional
The lower bound on roundness for object detection
- roundhifloat, optional
The upper bound on roundness for object detection
- sharplofloat, optional
The lower bound on sharpness for object detection
- sharphifloat, optional
The upper bound on sharpness for object detection
- silentbool, optional
If set, output will be suppressed
- maxiterint, optional
Maximum number of iterations for iteratefind
- epsilonint or float, optional
Maximum nod/chop deviation for exclusion in chopnod_sort
- epsfloat, optional
Precision to terminate iteration
- ncutint, optional
Positive integer cutout region used for Gaussian fitting (pixels)
- chopnoddist(list or tuple) of float, optional
If provided, will be used to identify the expected positions of the peaks and prioritize those that are nearest to where they should be. Format is [chop distance, nod distance]
- positivebool, optional
If set, only positive peaks will be returned.
- smoothbool, optional
If True, the data will be smoothed before searching for peaks.
- return_objectbool, optional
If set, return the PeakFinder object rather than the DataFrame
- coordinatesbool, optional
If set, return tuples of (x, y) coordinates as a list
- Returns:
- pandas.DataFrame or PeakFinder or list
The default DataFrame represents either shift_image distances to move newimage on top of coadded, or positions of the peaks in coadded if newimage was not supplied as an input parameter. The PeakFinder object contains lots of useful little attributes such as the fits, tables and models of coadded and newimage.
If coordinates=True, a list of (x, y) coordinates will be returned.