Contfit

class pyplatefit.Contfit

Bases: object

This class is a python version of Platefit continuum fit

Initialise parameters for continuum fit

The following parameters are used:

  • Burst model file: BC03/bc_models_subset_cb08_milesx__bursts_extlam.fit

  • Model metallicity: [0.0001, 0.0004, 0.001, 0.004, 0.008, 0.017, 0.04, 0.07]

  • zsolar: 0.02

  • velocity dispersion of the models: 75 km/s

Returns:
cont: a Contfit object

Methods Summary

fit(spec, z[, vdisp])

Perform continuum fit on a mpdaf spectrum

info(res)

print continuum fit information

plot(ax, res)

plot continuum fit results

Methods Documentation

fit(spec, z, vdisp=80)

Perform continuum fit on a mpdaf spectrum

This is the python translation of “fiber_continfit.pro” (part of the IDL PLATEFIT - contact: jarle@strw.leidenuniv.nl).

Parameters:
spec: mpdaf.obj.Spectrum

input spectrum

z: float

redshift

vdisp: float

velocity dispersion in km/s, defaulted to 80 km/s

Returns:
res: dictionary
  • success : True if fit converged

  • status: fit status (string)

  • z: fitted metallicity

  • ebv: extinction

  • init_z: input metallicity

  • chi2: fit chi2

  • ages: fitted ages for each population (list)

  • weights: fitted weight for each population (list)

  • table_spec: astropy table with the following columns

    • RESTWL: rest frame wavelength (A)

    • AIRWL: observed wavelength (A)

    • FLUX: rest frame flux

    • ERR: rest frame flux std

    • CONTFIT: rest frame fitted continuum

    • CONTRESID: smoothed residuals left by the fit

    • CONT: CONTFIT + CONTRESID

    • LINE: FLUX - CONT

info(res)

print continuum fit information

Parameters:
res: dictionary

the results of fit()

plot(ax, res)

plot continuum fit results

Parameters:
ax: matplotlib.axes.Axes

Axes instance in which to draw the plot

res: dictionary

results of fit