Hydrogen Lyman-alpha line-profile

class PyAstronomy.modelSuite.LyaTransmission(N=0.0, b=10.0, D_fraction=1.5e-05)

Lyman alpha transmission profile including Deuterium absorption.

The transmission is given by

\[e^{-\sigma N}\, ,\]

where N is the column density and \(\sigma\) is the wavelength-dependent cross-section.

Fit Parameters:

N

Hydrogen column density

/cm^2

b

Doppler parameter

km/s

Dfrac

Deuterium fraction

Parameters
Nfloat, optional

Hydrogen column density [/cm^2]. The default is 0.

bfloat, optional

The Doppler parameter (corresponds to sqrt(2) times the velocity dispersion) to model thermal line width [km/s]. The default is 10 km/s.

D_fractionfloat, optional

Fractional abundance of Deuterium with respect to Hydrogen. The default is 1.5e-5.

Methods

MCMCautoParameters(ranges[, picky, ...])

Convenience function to generate parameters for MCMC fit.

addConditionalRestriction(*args)

Define a conditional restriction.

assignValue(specval)

Assign new values to variables.

assignValues(specval)

Assign new values to variables.

autoFitMCMC(x, y, ranges[, picky, stepsize, ...])

Convenience function to using auto-generated sampling parameters in MCMC.

availableParameters()

Provides a list of existing parameters.

delRestriction(parName)

Delete restriction

description([parenthesis])

Returns a description of the model based on the names of the individual components.

errorConfInterval(par[, dstat, statTol, ...])

Calculate confidence interval for a parameter.

evaluate(x)

Evaluate the transmission profile.

fit(x, y[, yerr, X0, minAlgo, mAA, ...])

Carries out a fit.

fitEMCEE([x, y, yerr, nwalker, priors, ...])

MCMC sampling using emcee package.

fitMCMC(x, y, X0, Lims, Steps[, yerr, ...])

Carry out MCMC fit/error estimation.

freeParamNames()

Get the names of the free parameters.

freeParameters()

Get names and values of free parameters.

freeze(specifiers)

Consider variables free to float.

frozenParameters()

Get names and values of frozen parameters.

getRelationsOf(specifier)

Return relations of a variable.

getRestrictions()

Get all restrictions.

hasVariable(specifier)

Determine whether the variable exists.

numberOfFreeParams()

Get number of free parameters.

parameterSummary([toScreen, prefix, sorting])

Writes a summary of the parameters in text form.

parameters()

Obtain parameter names and values.

relate(dependentVar, independentVars[, func])

Define a relation.

removeConditionalRestriction(*args)

Remove an existing conditional constraint.

renameVariable(oldName, newName)

Change name of variable.

restoreState(resource)

Restores parameter values from file or dictionary.

saveState(*args, **kwargs)

Save the state of the fitting object.

setObjectiveFunction([miniFunc])

Define the objective function.

setPenaltyFactor(penalFac)

Change the penalty factor.

setRestriction(restricts)

Define restrictions.

setRootName(root[, rename])

Define the root name of the model.

showConditionalRestrictions(**kwargs)

Show conditional restrictions.

steppar(pars, ranges[, extractFctVal, quiet])

Allows to step a parameter through a specified range.

thaw(specifiers)

Consider variables fixed.

untie(parName[, forceFree])

Remove all relations of parameter parName, i.e., the parameter is not dependend on other parameters.

updateModel()

Recalculate the model using current settings.

evaluate(x)

Evaluate the transmission profile.

Parameters
xarray of floats

Contains the wavelength values in Angstrom.

Returns
Modelarray of floats

The line profile.

Example

from PyAstronomy import modelSuite as ms
import numpy as np
import matplotlib.pylab as plt

la = ms.LyaTransmission()
# Set some parameters
la["N"] = 5e17
la["b"] = 12.2
la["Dfrac"] = 1.9e-5

# Set up wavelength axis ...
wvl = np.linspace(1214., 1217., 1000)
# ... and evaluate model
m = la.evaluate(wvl)

# Plot the result
plt.plot(wvl, m, 'b.-')
plt.show()