brutus_elf module

brutus: a set of Python modules to process datacubes from integral field spectrographs.

Copyright (C) 2016, F.P.A. Vogt


This file contains several function and tools used by the brutus routines to fit emission line.

Created April 2016, F.P.A. Vogt - frederic.vogt@alumni.anu.edu.au

brutus_elf.els_mpfit(specerr, lams=None, be=None, params=None)[source]

The master function calling mpfit. Its construction implicitly assumes a single wavelength array over the entire cube !

brutus_elf.els_spec(x, p, method='gauss', be=None, inst='MUSE')[source]

Computes a pure emission line spectrum, given a set of parameters. ‘method’ allows to choose between gaussian profile or gauss-hermite profile (not yet supported). if gaussian profile: p = lam0 (no shift), I, v (km/s), sigma (km/s), etc ... if gauss-hermite : p = lam0 (no shift), I, v (km/s), sigma (km/s), h3, h4 etc ...

brutus_elf.gauss_hermite_hist(x, binedges, I, mu, sigma, h3, h4)[source]

Computes the histogram profile of a line, given a Gauss-Hermite profile, and certain binedges for each sampling point.

brutus_elf.gauss_hermite_profile(x, I, mu, sigma, h3, h4)[source]

Construct a Gauss-Hermite profile, following van der Marel (1993) and Riffel (2010) Set h2 = h1 = 0, h0 = 1 => it’s a gaussian plus h3 and h4 mu and sigma in Angstroem

brutus_elf.gauss_hist(x, binedges, I, mu, sigma)[source]

Computes the proper histogram of an emission line, given certain bin sizes.

The profile is normalized to peak.

Args:
x: float, 1-D numpy array

Locations to compute the Gaussian profile, assumed to be in Angstroem.

binedges: 1-D numpy array

Locations of the bin edges, with size of len(x)+1.

I: float

The profile peak intensity.

mu: float

The profile mean, in Angstroem.

sigma: float

The standard deviation of the profile, in Angstroem.

Returns:
out: float, 1-D numpy array

The profile evaluated at x

Notes:

This function is taking into account the finite bin sizes when observing a line with an intrinsic gaussian profile. I.e. each location shows the mean intensity over the bin, rather than the intensity of the gaussian profile at the bin center. This is the functional form to use when fitting an emission line in a spectra, rather than a simple gaussian profile.

brutus_elf.gauss_profile(x, I, mu, sigma)[source]

Computes a gaussian profile at x, normalized to peak.

Args:
x: float, 1-D numpy array

Locations to compute the Gaussian profile, assumed to be in Angstroem.

I: float

The profile peak intensity.

mu: float

The profile mean, in Angstroem.

sigma: float

The standard deviation of the profile, in Angstroem.

Returns:
out: float, 1-D numpy array

The profile evaluated at x.

brutus_elf.hermite_poly_scale(deg)[source]

Computes the scaling factor to be applied to Hermite polynomials, when using offcenter & broad gaussian line profiles (i.e. with mu !=0 and and sigma != 1). See footnote 3 on p. 555 of van der Marel (1993).

brutus_elf.line_fit_erf(p, fjac=None, x=None, y=None, err=None, method='gauss', be=None, inst='MUSE')[source]

Computes the residuals to be minimized by mpfit, given a model and data.

brutus_elf.obs_sigma(sigma, lam, inst='MUSE', in_errs=None)[source]

This function compute the observed sigma (in [A]) for an emission line, given a “real” sigma in km/s and the line position. Set ‘inst’=None to NOT account for the instrument dispersion.