hierarc.Util package

Submodules

hierarc.Util.distribution_util module

class hierarc.Util.distribution_util.PDFSampling(bin_edges, pdf_array)[source]

Bases: object

class for approximations with a given pdf sample

draw(n=1)[source]
Returns

property draw_one
Returns

hierarc.Util.distribution_util.approx_cdf_1d(bin_edges, pdf_array)[source]
Parameters
  • bin_edges – bin edges of PDF values

  • pdf_array – pdf array of given bins (len(bin_edges)-1)

Returns

cdf, interp1d function of cdf, inverse interpolation function

hierarc.Util.ifu_util module

this file contains routines to process the data format of the SLACS IFU data set to be binned in radial annuli and for error estimates

hierarc.Util.ifu_util.binned_dispersion(dispersion_map, weight_map, flux_map, fiber_scale, r_bins)[source]
Parameters
  • dispersion_map – 2d array of measured velocity dispersion for each fiber

  • weight_map – uncertainty weight of the measurement (i.e. 1/sigma**2) for each fiber

  • flux_map – array of flux for each fiber

  • fiber_scale – separation of the fibers (map pixels)

  • r_bins – array, bins in radial directions

Returns

averaged velocity dispersion measurement for each radial bin and estimated uncertainty thereof

hierarc.Util.ifu_util.binned_total(dispersion_map, weight_map_disp, velocity_map, weight_map_v, flux_map, fiber_scale, r_bins)[source]
Parameters
  • dispersion_map – 2d array of measured velocity dispersion for each fiber

  • weight_map_disp – uncertainty weight of the measurement in velocity dispersion (i.e. 1/sigma**2) for each fiber

  • velocity_map – 2d array of measured velocity offset for each fiber

  • weight_map_v – uncertainty weight of the measurement in systemic velocity (i.e. 1/sigma**2) for each fiber

  • flux_map – array of flux for each fiber

  • fiber_scale – separation of the fibers (map pixels)

  • r_bins – array, bins in radial directions

Returns

sqrt(v^2 + sigma^2) averaged integrated line dispersion when averaged over azimuthal bins

hierarc.Util.ifu_util.binned_velocity(velocity_map, weight_map, flux_map, fiber_scale, r_bins)[source]
Parameters
  • velocity_map – 2d array of measured velocity offset for each fiber

  • weight_map – uncertainty weight of the velocity measurement (i.e. 1/sigma**2) for each fiber

  • flux_map – array of flux for each fiber

  • fiber_scale – separation of the fibers (map pixels)

  • r_bins – array, bins in radial directions

Returns

average velocity components with luminosity weights, weight on v^2 error

hierarc.Util.likelihood_util module

hierarc.Util.likelihood_util.cov_error_create(error_independent, error_covariance)[source]

generates an error covariance matrix from a set of independent uncertainties combined with a fully covariant term

Parameters
  • error_independent – array of Gaussian 1-sigma uncertainties

  • error_covariance – float, shared covariant error among all data points. So if all data points are off by 1-sigma, then the log likelihood is 1-sigma

Returns

error covariance matrix

hierarc.Util.likelihood_util.get_truncated_normal(mean=0, sd=1, low=0, upp=10, size=1)[source]
Parameters
  • mean – mean of normal distribution

  • sd – standard deviation

  • low – lower bound

  • upp – upper bound

Returns

float, draw of distribution

hierarc.Util.likelihood_util.log_likelihood_cov(data, model, cov_error)[source]

log likelihood of the data given a model

Parameters
  • data – data vector

  • model – model vector

  • cov_error – inverse covariance matrix

Returns

log likelihood

Module contents