NburstFitterList

class sitelle.nburst.NburstFitterList(fitters)

This class is a wrapper to fit different spectra, having different fiting inputs (e.g. metallicities or age guess, different parameters…).

Because running a single NburstFitter means opening and closing IDL, it would be too fastidious to just build a loop. Instead, this Fitter list concatenates all the Fitters in a single script to run them at once. It works the same way a single NburstFitter does.

axis

1D ndarray – a regular wavelength axis in Angstroms

spectra

2 or 3D ndarray – spectra of shape [x,z] or [x,y,z], interpolated on the axis

error

2 or 3D ndarray – an error array of the same shape as spectra

fwhm

2 or 3D ndarray – an fwhm array of the same shape as spectra

fitted_spectra

1, 2 or 3D ndarray – The Nburst-fitted spectra. Same dimension as input spectra

idl_result

BinTableHDU – The table in which the parameters are found (returned by NBurst)

nburst_working_dir

Path – Class attribute. The working directory for nburst, where the library are stored. This is machine dependent and can be updated with the set_env() function.

idl_binary_path

str – Class attribute. Location of the idl binary. This is machine dependent and can be updated with the set_env() function.

idl_startup_script

str – Class attribute. Path of the script to be executed at startup of IDL, to compile the right libraries. This script should always be stored at ~/.idl/start.pro.

Attributes Summary

idl_binary_path
idl_startup_script
nburst_working_dir

Methods Summary

configure_fit(**kwargs) Configurator for the Nburst fit.
read_result([force]) Read the raw NBurst result and convert it to a more natural format, by populating the fitted_spectra and idl_result attributes of the NburstFitterList.
run_each([silent]) Runs the NburstFitterList, once properly configured.
set_env(machine) Sets the right value for nburst_working_dir and idl_binary_path, depending on the machine.

Attributes Documentation

idl_binary_path = '/usr/local/idl/idl/bin:/usr/local/idl/idl/bin/bin.darwin.x86_64:'
idl_startup_script = '~/.idl/start.pro'
nburst_working_dir = Path(u'/Users/blaunet/Documents/M31/nburst/')

Methods Documentation

configure_fit(**kwargs)

Configurator for the Nburst fit. The configuration will be applied to all the fitters present in the NburstFitterList. See NburstFitter.configure_fit() for details about the arguments.

read_result(force=False)

Read the raw NBurst result and convert it to a more natural format, by populating the fitted_spectra and idl_result attributes of the NburstFitterList.

Parameters:force (bool) – (Optional) If True, we recompute the fitted_spectra, idl_result and bin_table attributes even if they are already populated. Default = False.
run_each(silent=False)

Runs the NburstFitterList, once properly configured. Same procedure as NburstFitter.run_fit() but avoid the trouble to open and close idl each time.

Parameters:silent (bool) – (Optional) Default False. If True, the output of the subporocess is displayed.
classmethod set_env(machine)

Sets the right value for nburst_working_dir and idl_binary_path, depending on the machine. This has been specifically implemented for B. Launet and should be modified when used by others.

Parameters:machine (str) – hostname of the machine