The galaxy functions such as glass.galaxies.redshifts_from_nz() accept multi-dimensional array input where leading axes correspond to different galaxy populations.
However, the random point functions such as glass.points.positions_from_delta() only accepts a single dimension.
This currently leads to a slightly awkward conversion, where one has to sum the number density of each galaxy population before passing it to the points sampler:
ngal = np.sum(np.trapz(dndz, z))
I want to propose a change where the functions in glass.points also work on multi-dimensional inputs. For example, glass.points.positions_from_delta() could accept
a 1-D array of ngal values, positions are sampled with different number densities;
a 1-D array of delta fields, positions are sampled from different density contrasts;
a 1-D array of bias parameters, positions are sampled with different biases;
a 1-D array of vis maps, positions are sampled with different visibilities.
If inputs are given with array shape, the output arrays lon, lat would then be lists of the sampled points. Internally, the splitting can be handled by np.split(). Additionally, there could be support for a flat=True keyword argument that returns flat 1-D arrays of lon, lat and a 1-D array of population sizes, i.e. the inputs to np.split().
The galaxy functions such as
glass.galaxies.redshifts_from_nz()
accept multi-dimensional array input where leading axes correspond to different galaxy populations.However, the random point functions such as
glass.points.positions_from_delta()
only accepts a single dimension.This currently leads to a slightly awkward conversion, where one has to sum the number density of each galaxy population before passing it to the points sampler:
I want to propose a change where the functions in
glass.points
also work on multi-dimensional inputs. For example,glass.points.positions_from_delta()
could acceptngal
values, positions are sampled with different number densities;delta
fields, positions are sampled from different density contrasts;bias
parameters, positions are sampled with different biases;vis
maps, positions are sampled with different visibilities.If inputs are given with array shape, the output arrays
lon, lat
would then be lists of the sampled points. Internally, the splitting can be handled bynp.split()
. Additionally, there could be support for aflat=True
keyword argument that returns flat 1-D arrays oflon, lat
and a 1-D array of population sizes, i.e. the inputs tonp.split()
.