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:
linesnumpy.array()

central wavelengths of the spectral lines

Kwargs:
linestrengthfloat (default: 100)

initial guess for the line strength

blendsstr (optional)

A file containing the a list of blended lines in the format: ** List is coming soon**

return:
guesseslist

lists containing the guesses

limitslist

lists containing the limits

limitedlist

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:
guessesnumpy.array()

The initial guesses for the the radial velocity fit guesses in the form [RV,sepctral_dispersion]

llimitslist

the limits for the wavelength fit as set in ppxf

line_idxstr

Name of the primary line

blendsascii-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

autoadjustbool

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_blockbool: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

Added in version 0.1.0: module created

Added in version 0.1.1: moved to pep-8

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

Added 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.

Added 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

Added in version 0.2.0: replaced pysynphot (discontinued) with synphot and stsynphot