brutus: a set of Python modules to process datacubes from integral field spectrographs.
Copyright (C) 2016, F.P.A. Vogt
This file contains functions to call ppxf to fit the continuum in a given spectra. It is based on the examples provided by M. Cappellari within ppxf istelf (e.g. ppxf_kinematics_example_sauron.py & ppxf_population_example_sdss.py), but has been modified to account for a wavelength dependant spectral resolution of the data.
Basically, this is designed with MUSE in mind.
Created February 2016, F.P.A. Vogt - firstname.lastname@example.org
ppxf_population(specerr, templates=None, velscale=None, start=None, goodpixels=None, plot=False, moments=4, degree=-1, vsyst=None, clean=False, mdegree=10, regul=None)¶
Function that calls ppxf, designed to be called from multiprocessing (i.e. only require 1 argument). Everything else is taken care of outside of this.
setup_spectral_library(velscale, inst, sl_name, fit_lims, z)¶
This prepares the set of stellar templates to be fed to ppxf.
Param: velscale - the velocity scale for the log-rebinning Param: inst - the instrument that took the data, e.g. ‘MUSE’ Param: sl_name - the name of the stellar library to use Param: fit_lims - the spectral range for the fit (data & templates overlap) Param: z - redshift of target - needed for correct reshaping of fwhm_target. Returns: ...lots of stuf...
sl_resample(fn, z=0, inst='MUSE', sl_name='MILES_ppxf_default', do_cap=True)¶
This function resamples a given spectrum (i.e. from a stellar library) to match theresolution of the instrument that took the data.
Param: fn: filename of stellar template Param: z: redshift of the target observations Param: inst: which instrument are we using Param: sl_name: which templates do we use ? Do_cap: do the convolution using M.Cappellari in-built function
Returns the convolved spectrum