LIGHTNING_MPFIT#
Name#
LIGHTNING_MPFIT
Purpose#
Fits an observed SED with the Lightning models using the IDL MPFIT package, which utilizes the Levenberg-Marquardt gradient decent algorithm. Initial parameter positions are randomly selected from the specified prior distribution.
Calling Sequence#
lightning_mpfit, input_dir, sed_data, config_nopriors, models, priors
Inputs#
input_dirstring scalarThe path to the file containing the input SED data.
sed_datastructureA structure containing the SED luminosities and uncertainties, filter labels, distances, redshifts, and optional X-ray data. (See
lightning_input.profor details and contents.)config_nopriorsstructureA Lightning configuration structure edited to remove the prior substructures for each parameter. (See
lightning_configure_defaults.profor details and contents.)modelsstructureA structure containing each model structure (stellar, dust, AGN, X-ray) as a substructure. (See
lightning_models.profor details and contents.)priorsstructureA structure containing the prior hyper-parameters. (See
generate_prior_struct.profor details and contents.)
Output#
An IDL save file saved to <input_dir>/lightning_output/output_sav_files/ named
lightning_output_<galaxy_id>.sav', containing the resulting MPFIT best fit
parameters and log probability for each set of parameter starting points, and the
convergence metrics of the fits.
References#
Modification History#
2022/01/01: Created (Rafael Eufrasio)
2022/08/15: Major update to include new implementation (e.g., prior, config, etc.) (Keith Doore)
2022/08/18: Added progress printing (Keith Doore)
2023/01/23: Fixed bug where if
status <= 0then the correspondinglnprob_mpfit = 0. Now havelnprob_mpfit = NaNifstatus <= 0(Keith Doore)