Model Capabilities¶
The MEModel is specific to the needs of fitting observed data with a
dust extinguished model. This model provides all the model parameters,
functions to predict the SED based on the input model grid, and functions
to fit the data (minimizer and sampler), and plotting functions.
Parameters¶
Each parameter is gives as a MEParameter object and each has the following properties.
value: The valueunc: Uncertainty in the fitting parameterbounds: The min/max value allowed (default=[None, None])pprior: The Gaussian prior as [mean, sigma] (default=None)fixed: True/False if the parameter is fixed in the fitting (default=False)
The parameters in the model are listed below. Some have priors by default, some are
fixed by default, all have default bounds set (expect norm).
Stellar
velocity: velocity of the star in km/slogTeff: log10 of the surface effective temperaturelogg: log10 of the surface gravitylogZ: log10 of the stellar metallicity divided by the solar metallicityvturb: stellar atmosphere turbulent velocitywindamp: wind amplitude, only affects 1 micron and longerwindalpha: powerlaw of the wind emission
Dust
A(V): dust column as the V band extinctionR(V): average dust size as R(V)=A(V)/E(B-V)C2: slope value of FM90 parameterizationB3: 2175 A bump amplitude of FM90 parameterizationC4: fuv-rise amplitude of FM90 parameterizationxo: 2175 A bump center wavelength in inverse micronsgamma: 2175 A bump width in inverse microns
Gas
vel_MW: velocity in km/s of the MW Ly-alpha absorptionlogHI_MW: log10 of the column density of MW HI Ly-alpha absorptionvel_exgal: velocity in km/s of the external galaxy Ly-alpha absorptionlog10HI_exgal: log10 of the column density of external galaxy HI Ly-alpha absorption
Fitting
norm: The model normalization that matches the observed data on average.
Other info¶
In addition to the above parameters, MEModel also includes ancillary info.
paramnames: names of the parameters as a listg23_all_ext: Instead of the usual FM90 for the UV and G23 for the longer wavelengths, use G23 for all wavelengths. (default=False)approx_band_ext: Approximate the band extinction using the pivot wavelength of the band instead of applying the extinction to a low resolution model spectrum and then integrating over the band response functions. (default=False)exclude_regions: Regions to exclude from the fitting. Given as a list with elements that are 2 element lists of inverse wavelengths with astropy units of inverse microns.lnp_bignum: Value of a very low probability. Not all fitters handle-np.infwell. (default=-np.inf)
Functions¶
There are MEModel functions that provide calculation of the model data, access to parameters,
plotting, and fitting.
General
parameters(): parameter values as a numpy arrayparameters_to_fit(): non-fixed parameter values as a numpy arrayfit_to_parameters(fit_params): non-fixed parameters toMEModelparameter valuespprint_paramters(): Print parameter names, values, and (if present) uncertainties tothe screen
Model SED
stellar_sed(moddata): Compute the stellar SED using the model grid and the stellar parameters.dust_extinguished_sed(moddata, sed): Compute the dust extinguished SED using the sed returned fromstellar_sed, the input model grid, and the dust parameters.hi_abs_sed(moddata, sed): Add the gas HI Ly-alpha absorption to the sed returned fromdust_extinguished_sedusing the model data and the gas parameters.
Fitting
check_param_limits(): Check that all the parameter values are within their boundsset_weights(obsdata): Set the weights based on the observed data uncertainties. Setweights to zero in all exclude regions. Weights are stored as the member dictonary variable
weights.
set_initial_norm(obsdata, moddata): Set thenormvalue based on the model parameters and the observed data.lnlike(): Compute the natural log of the likelihood assuming Gaussian uncertainties.lnprior(): Compute the natural log of the priors.lnprob(): Compute the natural log of the probability = sum of lnlike and lnprior.fit_minimizer(): Determine the best fit by minimizing the -1 * lnprob value using a scipy optimizer. Returns a model with the best fit parameters.fit_sampler(): Determine the nD probability function using theemceeMonte Carlo Markov Chain sampler. Returns a model with the p50 parameters and uncertainties based on the sample. Also returns the samples and the sampler object.
Plotting
plot(): Plot the data, stellar model, and extinguished stellar model in the top panel and the residuals to the fit in the bottom (smaller) panel.plot_sampler_chains(): Plot the sampler chains in a multi-panel plot.plot_sampler_corner(): Plot the 2D distributions of the samples using the starndard “corner” plot.