pdspy.utils

utils.load_config

pdspy.utils.load_config(path='')

Load a pdspy configuration file in as a module.

Args:
path (str):

The path to the directory where the information for the radiative transfer model is stored.

Returns:
config (module):

A python module containing the configuration information for pdspy modeling.

utils.load_data

pdspy.utils.load_data(config, model='disk', gridsize1D=20)

Loads the data, as specified by the configuration module.

Args:
config (module):

The configuration information for the model, as read in by the :code:utils.load_config function.

model (str, optional):

Are you running disk_model_* or flared_model_*. Default: “disk”

model (int or list-like, optional):

The number of bins to use when averaging the visibility data into 1D. Default: 40

Returns:
visibilities (dict):

A dictionary containing the visibility data and the information about it from the configuration module.

images (dict):

A dictionary containing the image data and the information about it from the configuration module.

spectra (dict):

A dictionary containing the spectra and the information about it from the configuration module.

utils.load_results

pdspy.utils.load_results(config, model_path='', code='dynesty', discard=100, best='median', unc='none', percentile=68, chisq_cut=False, trim=None, fix_log10=False, gas_mass=False, return_format='dict')

Load the results of a modeling run with pdspy.

Args:
config (module):

The configuration module for the fit. Typically from utils.load_config

model_path (str):

The path to the directory where the information for the radiative transfer model is stored.

code (str, optional):

Which code was used to run the radiative transfer modeling fit. Default: “dynesty”

discard (int, optional):

If using “emcee”, the number of burn-in steps to discard from the beginning of the chain. Default: 100

best (str, optional):

What method to use to determine the best-fit model parameters. Options include: “median”: Take the median of the posterior samples for each parameter. “peak”: Take the peak of the marginalized 1D posterior, as determined from a Kernel Density Estimator for each parameter. “kde”: Take the peak of the n x d posterior, as determined by a Kernel Density Estimator, i.e. the maximum likelihood model. Default: “median”

median (str, optional):

What method to use to get the uncertainty on the best fit parameters. Options include “std”, i.e. take the standard deviation of the samples, “percentile”, i.e. use the difference between best and supplied percentile values, or None, i.e. don’t return uncertainties. Default: None

percentile (float, optional):

What percentile to use to calculate the uncertainties. Default: 68

chisq_cut (bool, optional):

Use a chi-squared distribution to estimate from the number of parameters and samples a threshold below which samples are outliers from the distribution and trim those values. Default: False

trim (str, optional):

Can be used to supply conditions to use to cut samples from the posterior. e.g. “loga_max < 1.0,logR_disk > 3.5”. Parameters must be separated by a comma with no spaces. Default: None

fix_log10 (bool, optional):

By default, the parameters that were fit in log-space will be returned in log-space. If fix_log10=True, then those values will instead be returned in linear space. Default: False

gas_mass (bool, optional):

By default, due to its history as a dust radiative transfer modeling code, pdspy returns disk and envelope masses as dust masses. If you would like to get the estimated gas mass, assuming a gas-to-dust ratio of 100, use gas_mass=True. Default: False

return_format (str, optional):

Typically, this function will return the best-fit parameters and uncertainties as a dictionary, with each value given the parameter name as a key, e.g. {“logR_disk”:1.54}. It can also, however, return them as lists if return_format=”list”. Default: “dict”

Returns:
keys (list of str):

A list of the free parameter names from the model.

params (dict or list):

The best-fit parameter values as either a dictionary or list, depending on the value of return_format.

sigma (dict or list, optional):

The uncertainties if using the standard deviation. Only returned if unc=’std’”

sigma_up (dict or list, optional):

The upper uncertainties, if using percentiles. Only returned if unc=”percentile”

sigma_down (dict or list, optional):

The lower uncertainties, if using percentiles. Only returned if unc=”percentile”

samples (numpy.ndarray, n x d):

The posterior samples from the fit.