piXedfit_analysis

piXedfit.piXedfit_analysis.plot_SED(name_sampler_fits, logscale_x=False, logscale_y=True, xrange=None, yrange=None, wunit='micron', funit='erg/s/cm2/A', decompose=0, xticks=None, photo_color='red', residual_range=[-1.0, 1.0], show_original_spec=False, 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 (i.e., median posterior) model SED from a result of SED fitting.

Parameters:
  • name_sampler_fits – Name of input FITS file containing result of an SED fitting.

  • logscale_x – Choice for plotting x-axis in logarithmic (True) or linear scale (False).

  • logscale_y – Choice for plotting y-axis in logarithmic (True) or linear scale (False).

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

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

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

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

  • decompose – Choice for showing best-fit (i.e., median posterior) model SED broken down into its components (1 or True) or just its total (0 or False).

  • xticks – xticks in list format.

  • photo_color – Color of photometric fluxes data points. The accepted colors are those available in the matplotlib.

  • residual_range – Residuals between observed SED and the median posterior model SED. The residual is defined as (D - M)/D, where D represents observed SED, while M is model SED.

  • show_original_spec – (default=False) Show original best-fit model spectrum before rescaling with polnomial correction. This is only relevant if the data is spectrophotometric.

  • fontsize_tick – Fontsize for the ticks.

  • fontsize_label – Fontsize for the labels in the x and y axes.

  • show_legend – Option for showing a legend.

  • loc_legend – Location of the legend.

  • fontsize_legend – Fontsize of the legend.

  • markersize – Size for the markers of the observed and model SEDs.

  • lw – (optional, default: 1) Line width for the best-fit (i.e., median posterior) model SED.

  • name_plot – Desired name for the output plot. This is optional. If None, a default name will be used.

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', 'gas_logu', 'gas_logz'], label_params={'dust1': '$\\hat \\tau_{1}$', 'dust2': '$\\hat \\tau_{2}$', 'dust_index': '$n$', 'gas_logu': 'log($U$)', 'gas_logz': 'log($Z_{gas}/Z_{\\odot}$)', '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{M}}$)', '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, 4.0], 'dust2': [0.0, 4.0], 'dust_index': [-2.2, 0.4], 'gas_logu': [-4.0, -1.0], 'gas_logz': [-2.0, 0.2], '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]}, factor=1.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 a fitting result with the MCMC method.

Parameters:
  • name_sampler_fits – Name of input FITS file containing result of an SED fitting.

  • params – List of parameters to be shown in the corner plot. This is optional. If default input is used, all the parameters incolved in the SED fitting will be shown in the corner plot.

  • label_params – Labels for the parameters. The accepted format is a python dictionary.

  • params_ranges – Desired ranges for the parameters.

  • factor – Multiplication factor to be applied to stellar mass, SFR, and dust mass.

  • nbins – Number of binning in the parameter space when calculating the joint posteriors.

  • fontsize_label – Fontsize of labels in the x and y axes.

  • fontsize_tick – Fontsize for the ticks.

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

Returns name_plot:

Desired name for the output plot. This is optional. If None, a default name will be used.

piXedfit.piXedfit_analysis.plot_sfh_mcmc(name_sampler_fits, nchains=200, del_t=0.05, lbacktime_max=None, yrange=None, factor=1.0, 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 a fitting result with the MCMC method. This is only applicable for fitting result that stores the full sampler chains, which is when we set store_full_samplers=1 in the SED fitting functions.

Parameters:
  • name_sampler_fits – Name of input FITS file containing result of an SED fitting.

  • nchains – Number of randomly chosen sampler chains (from the full samplers stored in the FITS file) to be used for calculating the inferred SFH.

  • del_t – Width of the look back time binning in unit of Gyr for sampling the star formation history (SFH).

  • lbacktime_max – 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 – Range in the y-axis.

  • factor – Multiplication factor to be applied to the SFH.

  • loc_legend – Where to locate the legend. This is the same as in the matplotlib.

  • fontsize_tick – Fontsize for the ticks.

  • fontsize_label – Fontsize of the labels in the x and y axes.

  • fontsize_legend – Fontsize of the legend.

  • logscale_x – Choice for plotting x-axis in logarithmic (True) or linear scale (False).

  • logscale_y – Choice for plotting y-axis in logarithmic (True) or linear scale (False).

Returns name_plot:

Desired name for the output plot. This is optional. If None, a default name will be used.

Returns grid_lbt:

Look-back times.

Return grid_sfr_p16:

16th percentile of the SFR(t).

Return grid_sfr_p50:

50th percentile of the SFR(t).

Return grid_sfr_p84:

84th percentile of the SFR(t).