Change the partition() function to return an array of weights such that the weighted sum of window functions approximates the given input function. This can be used to directly obtain e.g. the galaxy densities in each shell to match a target distribution $dN/dz$:
# the galaxy density in each shell to match dndz
ngal = partition(z, dndz, shells)
For overlapping window functions, there are in general many ways to combine shells to match a given function. The partition() function currently implements least-squares (method="lstsq") and the restriction of the target function to the shell, followed by integration (method="restrict"). The latter was previously the default procedure for tophat windows.
Closes: #121
Changed: The partition() function now returns an array of weights to approximate the given function by the windows.
Change the
partition()
function to return an array of weights such that the weighted sum of window functions approximates the given input function. This can be used to directly obtain e.g. the galaxy densities in each shell to match a target distribution $dN/dz$:For overlapping window functions, there are in general many ways to combine shells to match a given function. The
partition()
function currently implements least-squares (method="lstsq"
) and the restriction of the target function to the shell, followed by integration (method="restrict"
). The latter was previously the default procedure for tophat windows.Closes: #121 Changed: The
partition()
function now returns an array of weights to approximate the given function by the windows.