piXedfit_analysis

piXedfit.piXedfit_analysis.plot_SED(name_sampler_fits, logscale_x=True, logscale_y=True, xrange=None, yrange=None, wunit='micron', funit='erg/s/cm2/A', decompose=1, xticks=None, photo_color='red', residual_range=[- 1.0, 1.0], fontsize_tick=18, fontsize_label=25, show_legend=True, loc_legend=4, fontsize_legend=18, markersize=100, lw=2.0, name_plot=None)

Function for plotting best-fit model SED from a fitting result.

Parameters
  • name_sampler_fits – Name of input FITS file containing sampler chains from the MCMC fitting. This FITS file must be output of singleSEDfit() or SEDfit_from_binmap() functions.

  • logscale_x – (optional, default: True) Flag stating whether the x-axis is plotted in logarithmic scale (value: True) or not (value: False).

  • logscale_y – (optional, default: True) Flag stating whether the y-axis is plotted in logarithmic scale (value: True) or not (value: False).

  • xrange – (optional, default: None) Range in x-axis. The accepted format is: [xmin,xmax]. If xrange=None, the range will be defined based on the wavelength range covered by the observed photometric SED.

  • yrange – (optional, default: None) Range in y-axis. The accepted format is: [ymin,ymax]. If yrange=None, the range will be defined based on the fluxes range covered by the observed photometric SED.

  • wunit – (default: ‘micron’) Wavelength unit. Options are: (1)0 or ‘angstrom’ for Angstrom unit and (2)1 or ‘micron’ for micron unit.

  • funit – (default: ‘erg/s/cm2/A’) Flux unit. Options are: (1)0 or ‘erg/s/cm2/A’, (2)1 or ‘erg/s/cm2’, and (3)2 or ‘Jy’.

  • decompose – (default: 1) Flag stating whether the best-fit model SED is broken-down into its components (value: 1 or True) or not (value: 0 or False).

  • xticks – (optional, default: None) List of ticks values in x-axis. If None, the default from matplotlib is used. If xticks is not None, the accepted input is in list format xticks = []. The unit should be the same as the input wunit.

  • photo_color – (optional, default: ‘blue’) Color of photometric fluxes points (in string). The accepted input is the same as that available in matplotlib.

  • residual_range – (default: [-1.0,1.0]) Residuals between observed SED and the median posterior model SED. The residual in each band is defined as (f_D - f_M)/f_D, where f_D is flux in observed SED and f_M is flux in model SED.

  • fontsize_tick – (optional, default: 20) Fontsize for the tick. Only relevant if xticks is not None.

  • fontsize_label – (optional, default: 25) Fontsize for the x- and y-axis labels.

  • show_legend – (optional, default: True) Flag whether to show legend or not.

  • loc_legend – (optional, default: 2) Location of the legend.

  • fontsize_legend – (optional, default: 18) Fontsize for the legend.

  • markersize – (optional, default: 100) Size of the maarkers associated with the observed and model SEDs.

  • lw – (optional, default: 1) Line width of the model SEDs.

  • name_plot – (optional, default: None) Name of the output plot. This is optional parameter.

piXedfit.piXedfit_analysis.plot_corner(name_sampler_fits, params=['log_sfr', 'log_mass', 'log_dustmass', 'log_fagn', 'log_fagn_bol', 'log_tauagn', 'log_qpah', 'log_umin', 'log_gamma', 'dust1', 'dust2', 'dust_index', 'log_mw_age', 'log_age', 'log_t0', 'log_alpha', 'log_beta', 'log_tau', 'logzsol', 'z'], label_params={'dust1': '$\\hat \\tau_{1}$', 'dust2': '$\\hat \\tau_{2}$', 'dust_index': '$n$', 'log_age': 'log($\\mathrm{age}_{\\mathrm{sys}}$)', 'log_alpha': 'log($\\alpha$)', 'log_beta': 'log($\\beta$)', 'log_dustmass': 'log($M_{dust}$)', 'log_fagn': 'log($f_{AGN,*}$)', 'log_fagn_bol': 'log($f_{AGN,bol}$)', 'log_gamma': 'log($\\gamma_{e}$)', 'log_mass': 'log($M_{*}$)', 'log_mw_age': 'log($\\mathrm{age}_{\\mathrm{MW}}$)', 'log_qpah': 'log($Q_{PAH}$)', 'log_sfr': 'log(SFR)', 'log_t0': 'log($t_{0}$)', 'log_tau': 'log($\\tau$)', 'log_tauagn': 'log($\\tau_{AGN}$)', 'log_umin': 'log($U_{min}$)', 'logzsol': 'log($Z/Z_{\\odot}$)', 'z': 'z'}, params_ranges={'dust1': [0.0, 3.0], 'dust2': [0.0, 3.0], 'dust_index': [- 2.2, 0.4], 'log_age': [- 3.0, 1.14], 'log_alpha': [- 2.5, 2.5], 'log_beta': [- 2.5, 2.5], 'log_dustmass': [- 99.0, - 99.0], 'log_fagn': [- 5.0, 0.48], 'log_fagn_bol': [- 99.0, - 99.0], 'log_gamma': [- 3.0, - 0.824], 'log_mass': [- 99.0, - 99.0], 'log_mw_age': [- 99.0, - 99.0], 'log_qpah': [- 1.0, 0.845], 'log_sfr': [- 99.0, - 99.0], 'log_t0': [- 2.0, 1.14], 'log_tau': [- 2.5, 1.5], 'log_tauagn': [0.7, 2.18], 'log_umin': [- 1.0, 1.176], 'logzsol': [- 2.0, 0.5], 'z': [- 99.0, - 99.0]}, nbins=12, fontsize_label=20, fontsize_tick=14, name_plot=None)

Function for producing corner plot that shows 1D and joint 2D posterior probability distributions from the fitting results with MCMC method.

Parameters
  • name_sampler_fits – Name of the input FITS file containing sampler chains from the MCMC fitting. This FITS file must be output of singleSEDfit() or SEDfit_from_binmap() functions.

  • params – (optional) List of parameters that want to be included in the corner plot. This is optional parameter.

  • label_params – (optional) Labels for the parameters in a dictionary format.

  • params_ranges – (optional) Ranges for the parameters to be shown in the plot.

  • nbins – (default: 12) Number of bins to be made in a parameter space when examining the posterior probability function.

  • fontsize_label – (optional, default: 20) Fontsize for the x- and y-axis labels.

  • fontsize_tick – (optional, default: 14) Fontsize for the tick. Only relevant if xticks is not None.

  • name_plot – (optional, default: None) Desired name for the output plot.

Returns name_plot

Output plot.

piXedfit.piXedfit_analysis.plot_sfh_mcmc(name_sampler_fits, nchains=200, del_t=0.05, plot_true=0, true_params={'log_age': - 99.0, 'log_alpha': - 99.0, 'log_beta': - 99.0, 'log_mass': - 99.0, 'log_t0': - 99.0, 'log_tau': - 99.0}, true_SFH_lbt=[], true_SFH_sfr=[], lbacktime_max=None, yrange=None, loc_legend=2, fontsize_tick=18, fontsize_label=25, fontsize_legend=26, logscale_x=False, logscale_y=False, name_plot=None)

Function for producing SFH plot from fitting result obtained with the MCMC method.

Parameters
  • name_sampler_fits – Name of the input FITS file containing sampler chains from the MCMC fitting. This FITS file must be output of singleSEDfit() or SEDfit_from_binmap() functions.

  • nchains – (default: 200) Number of randomly-chosen sampler chains to be used for calculating the inferred SFH.

  • del_t – (default: 0.05) Increment in the look-back time (in Gyr) to be used in sampling the SFH.

  • plot_true – (default: 0) A flag stating whether to plot (value:1) the true SFH or not (value:0).

  • true_params – (optional) True values of the true parameters if available and the true SFH is intended to be shown. Only relevant if plot_true=1. This should be in dictionary format as shown in the default set.

  • true_SFH_lbt – (default: []) 1D array of the true (arbitrary) SFH -the time look-back time component. In case the true SFH is not represented by parametric form.

  • true_SFH_sfr – (default: []) 1D arrays of the true (arbitrary) SFH -the SFR component. In case the true SFH is not represented by parametric form.

  • lbacktime_max – (optional, default: None) Maximum look-back time in the SFH plot. If None, the maximum look-back time is defined from the age of universe at the redshift of the galaxy.

  • yrange – (optional, default: None) Range in the y-axis.

  • loc_legend – (optional, default: 2) Where to locate the legend. This is the same numbering as in the matplotlib.

  • fontsize_tick – (optional, default: 18) Fontsize for the tick. Only relevant if xticks is not None.

  • fontsize_label – (optional, default: 25) Fontsize for the x- and y-axis labels.

  • fontsize_legend – (optional, default: 26) Fontsize for the legend.

  • logscale_x – (optional, default: True) Flag stating whether the x-axis is plotted in logarithmic scale (value: True) or not (value: False).

  • logscale_y – (optional, default: True) Flag stating whether the y-axis is plotted in logarithmic scale (value: True) or not (value: False).

  • name_plot – Desired name for the output plot.

Returns name_plot

Name of the output plot.

Returns grid_lbt

Look-back time grids in the SFH.

Returns grid_sfr_p16

16th percentile of the SFH.

Returns grid_sfr_p50

Median of the SFH.

Returns grid_sfr_p84

84th percentile of the SFH.