demmap#
- demregpy.demmap(
- dd,
- ed,
- rmatrix,
- logt,
- dlogt,
- glc,
- reg_tweak=1.0,
- max_iter=10,
- rgt_fact=1.5,
- dem_norm0=None,
- nmu=42,
- warn=False,
- l_emd=False,
Recover DEMs for a stack of one-dimensional observations.
Each row of
ddis treated as an independent observation with the same temperature response matrix. This function is the lower-level workhorse used bydemregpy.dn2dem()after the input arrays have been reshaped.- Parameters:
dd (array_like) – Input counts with shape
(na, nf).ed (array_like) – Uncertainties on
ddwith the same shape.rmatrix (array_like) – Response matrix with shape
(nt, nf).logt (array_like) – Temperature-bin centres in log10(T).
dlogt (array_like) – Width of each temperature bin in log10(T).
glc (array_like) – Length-
nf0/1 mask selecting the filters used for EM loci weighting.reg_tweak (float, optional) – Initial chisq target. Default is 1.0.
max_iter (int, optional) – Maximum number of times to attempt the gsvd before giving up, returns the last attempt if max_iter reached. Default is 10.
rgt_fact (float, optional) – Scale factor for the increase in chi-sqaured target for each iteration. Default is 1.5.
dem_norm0 (array_like, optional) – Provides a “guess” dem as a starting point, if none is supplied one is created. Default is None.
nmu (int, optional) – Number of reg param samples to use. Default is 42.
warn (bool, optional) – Print out warnings. Default is False.
l_emd (bool, optional) – Remove sqrt from constraint matrix (best with EMD). Default is False.
- Returns:
dem (ndarray) – DEM values with shape
(na, nt).edem (ndarray) – Vertical uncertainties on
dem.elogt (ndarray) – Horizontal temperature resolution estimates in log10(T).
chisq (ndarray) – Reduced chi-squared values for each observation.
dn_reg (ndarray) – Reconstructed counts with shape
(na, nf).