find_apertures

sofia_redux.spectroscopy.findapertures.find_apertures(profiles, npeaks=1, orders=None, positions=None, fwhm=1.0, fix=False, **kwargs)[source]

Determine the position of the aperture(s) in a spatial profile.

Profiles expected are the median profiles produced by sofia_redux.spectroscopy.mkspatprof. Peaks are fit using a Gaussian model, with initial estimates optionally provided by the user.

Any additional keyword arguments provided are passed to the sofia_redux.toolkit.fitting.fitpeaks1d algorithm, used to fit the Gaussian model to the profile.

Parameters:
profilesdict
order (int) -> profile (numpy.ndarray)

(n_spatial, 2) spatial profile where profile[:, 0] = spatial coordinate and profile[:, 1] = median spatial profile.

npeaksint, optional

Number of peaks to find in each profile.

orderslist of int, optional

Orders to extract. If not present, all orders in profiles will be extracted.

positionsdict, optional
order (int) -> list of float

Up to (npeaks) positions to use as the starting point(s) for the fit.

fwhmfloat, optional

Starting estimate for Gaussian FWHM of the spatial peak, in arcsec up the slit.

fixbool, optional

If set, apertures will be fixed to the input positions. If input positions are not specified, they will be fixed to the center of the slit.

Returns:
aperturesdict
order (int) -> list of dict
Keys and values are as follows:

position : float fwhm : float sign : {1, -1}