A Python tool for fitting the 8--1000 micron dust emission of galaxies published in Drew et al. 2021 in preparation.
As of the time of writing, the main Python package we use for MCMC fitting, pymc3, will not work with Python 3.8 without a hack to the code. Hopefully this will change in the future. We recommend you follow the instructions here to create a new conda environment with Python 3.7.
- Python 3.7
- latest anaconda stable build
- pymc3
- libpython
- corner
- m2w64-toolchain (if using Windows)
For an example of how to use the code, run example_data.py to generate data for two galaxies. Next run example_fit_mcirsed.py. There are instructions in the comments of this script that will guide you through working with. We recommend you save a copy of example_fit_mcirsed.py before editing the inputs.
Required inputs to the code are wavelengths of observations in microns, flux densities and uncertainties in mJy, and a redshift.
Parameters that may be free or held fixed:
- Alpha (power law slope)
- Beta (dust emissivity)
- Lambda_0 (wavelength where dust opacity = 1. Referred to in the code as w0)
The code will output a pandas dataframe save as a .pkl file containing, in this order:
z
: redshiftfixAlphaValue
: value alpha was fixed to or None if free parameterfixBetaValue
: value beta was fixed to or None if free parameterfixW0Value
: value lambda_0 (W0) was fixed to or None if free parametertune
: how many tuning steps the sampling was run withMCSamples
: number of MC samplesCMBCorrection
: whether CMB was corrected fortrace_Norm1
: norm1 parameter for each MC sampletrace_Tdust
: dust temperature for each MC sampletrace_alpha
: alpha for each MC sampletrace_beta
: beta for each MC sampletrace_w0
: lambda_0 (w0) for each MC sampletrace_LIR
: log LIR for each MC sampletrace_lPeak
: peak wavelength for each MC samplemedian_Norm1
: median norm1 across all samplesmedian_Tdust
: median tdustmedian_alpha
: median alphamedian_beta
: median betamedian_w0
: median lambda_0 (w0)median_LIR
: median log LIRmedian_lPeak
: median peak wavelengthNorm1_16th
: 16th percentile for norm1 samplesTdust_16th
: 16th tdustalpha_16th
: 16th alphabeta_16th
: 16th betaw0_16th
: 16th lambda_0 (w0)LIR_16th
: 16th log LIRlPeak_16th
: 16th peak wavelengthNorm1_84th
: 84th percentile for norm1 samplesTdust_84th
: 84th tdustalpha_84th
: 84th alphabeta_84th
: 84th betaw0_84th
: 84th lambda_0 (w0)LIR_84th
: 84th log LIRlPeak_84th
: 84th peak wavelengthdataWave
: wavelengths of data used for each galaxy in micronsdataFlux
: fluxes in mJy used for each galaxy in micronsdataErr
: errors in mJy used for each galaxy in microns