5. Utility module

This modules contains a variety of functions to support MUSEpack. Many of these functions may be useful for other purposes.

Todo

The documentation of all of the utility modules will follow soon

utils.initial_guesses(self, lines, blends=None, linestrength=100.0, llimits=[-2.0, 2.0])[source]

Creates the initial guesses for the line fitter

Args:
lines : numpy.array()
central wavelengths of the spectral lines
Kwargs:
linestrength : float (default: 100)
initial guess for the line strength
blends : str (optional)
A file containing the a list of blended lines in the format: ** List is coming soon**
return:
guesses : list
lists containing the guesses
limits : list
lists containing the limits
limited : list
lists containing the limited
utils.update_parinfo(self, guesses, llimits, line_idx, blends, parinfo, autoadjust, fwhm_block)[source]

Updates the parinfo file, created by pyspeckit.

Args:
guesses : numpy.array()
The initial guesses for the the radial velocity fit guesses in the form [RV,sepctral_dispersion]
llimits : list
the limits for the wavelength fit as set in ppxf
line_idx : str
Name of the primary line
blends : ascii-file or None
A file with primary lines that contain blends to provide a maximum amplitude ratio of the primary and the blend to prevent that the blend becomes the dominant line in the fit.
parinfo: dict
the parinfo file created by pyspeckit, which contains the fitted parameters for all input lines
autoadjust : bool

True: the wavelength limits llimit will be adjusted to the fit of the previous iteration. All other wavelength range are adjusted accordingly taking into account the proper velocity corrected shift \(\Delta \lambda/\lambda\). This is especially important to detect hyper-velocity stars.

False: no adjustment to the limits done

fwhm_block : bool:obj:

True: The minimum fwhm of the voigt profiles of the fitted lines is the instrument’s dispersion

False: The minimum fwhm of the voigt profiles of the fitted lines is zero

5.1. History

New in version 0.1.0: module created

New in version 0.1.1: moved to pep-8

New in version 0.1.2: now handles absorption and emission lines emission not tested yet, though

New in version 0.1.3: The util.Line_clipping was adjusted in how the two outliers are clipped before the MAD is calculated. It now keeps the \(N-2\)-lines that have the smaller deviation from each other.

New in version 0.1.4: adding rv_sys, to compensate for larger systematic RV shifts or redshifts for the line and RV fitter. The util.lambda_rv_shift was introduced