-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split positions_from_delta()
into individual functions
#413
Comments
Just to clarify on this, are you saying this is how you envisage the function being split up? Been trying to map the current function to this in my head, and it's not entirely clear to me. |
Yes, something along those lines. The functional split in the current Lines 229 to 240 in fa012ac
Figure out how many "populations" of objects we are dealing with, by broadcasting all inputs together. This is probably going to be the most tricky part to generalise neatly when not doing all subsequent steps in one function. Lines 242 to 243 in fa012ac
This loops over the leading dimensions ("populations") and processes each "population" independently. This will need some thought on how to do it without having this big loop over everything. For the time being, imagine we are dealing with just one population of objects. Lines 244 to 249 in fa012ac
Applies the bias model to Lines 251 to 257 in fa012ac
Computes the expected number of objects per pixel Lines 259 to 261 in fa012ac
Apply a visibility by multiplying it with the expected number count Lines 263 to 267 in fa012ac
Sample the actual number of galaxies in each pixel from the Poisson distribution. Lines 269 to 315 in fa012ac
Sample the individual galaxies in each pixel, randomly distributed over sub pixels, in batches. |
I have a similar local implementation of this which creates a new classes within The implementation adds two novel features:
I have documented and tested the code (incl. tests on the KiDS-1000). It seems stable and consistent with previous results, so I have created a pull request. Please provide any feedback on any additional functionalities and/or changes to make it fit within the rest of the GLASS code base. |
Add your issue here
The current
positions_from_delta()
function carries out a large number of steps:delta
map.delta
to mean number count in each map pixel.This structure is very rigid, and makes it difficult to implement things such as #136.
We should split this up into individual functions, so that they can be mixed and matched with different implementations:
This needs a bit of experimentation for multi-dimensional arrays, but in principle seems feasible.
The text was updated successfully, but these errors were encountered: