kinextract.true_losvd_on_grid
- kinextract.true_losvd_on_grid(xl: ndarray, v_true: float, sigma_true: float, h3: float = 0.0, h4: float = 0.0) ndarray[source]
Ground-truth LOSVD histogram on xl, normalized so
sum(b) == 1.Uses kinextract’s own
kinextract.losvd.gauss_hermite_losvd_model()(legacy Fortran H3/H4 convention) so an injected truth is directly comparable tokinextract.losvd.fit_losvd_gauss_hermite()’s recovered moments – a synthetic truth built from an independent GH polynomial basis would make any measured “bias” partly an artifact of mismatched normalizations, not a real recovery error.Normalizing by
sum(b)(a Riemann-sum/histogram-weight convention), nottrapz(b, xl)(a continuous-density convention), matters here: the fit’s own LOSVD parameter vectorbis a set of per-bin weights constrained by the objective’s own normalization penalty (0.1 * |sum(b) - 1|, seekinextract.numerics.objective_map()) to sum to 1, not to integrate to 1 – on a xl grid that isn’t unit spacing (the typical case), the two conventions differ by a factor of the bin spacing and feeding a trapz-normalized truth in as if it were an actual b vector silently injects a spectrum with the wrong overall flux level.