HealPixPrior (Resloves Issue #419)
Hi all, This MR introduces a HealPixMapPriorDist
object to be used to create a 2D or 3D joint prior in ra/dec (ra/dec/distance) according to a passed in HealPix map or .fits file to address and resolve issue #419 (closed).
This PriorObject inherits from BaseJointPriorDist and needs to overwrite three methods (_rescale(), _sample(), and _lnprob())
To illustrate this is working I sample 5000 samples from the prior and show below that these samples are distribvuted according to whats in the HealPix Map .fits file.
Here I show that the _rescale() method is also working by generating 5000 samples uniformly on [0,1] then rescale to the HealPixPrior which also matches with what is in the map file.
Merge request reports
Activity
- Resolved by Bruce Edelman
This looks amazing! I don't really understand the rescale method for the
HealPix
map. Do you know if it would be possible to add theHealPix
prior to the testing? Will that require another upgrade to the test suite?Also, it looks like the sampling ignores the prior bounds for the
HealPix
prior, or am I misunderstanding?
Hi @colm.talbot , So since we were not sure immediately how to create the rescale method for the HealPix, what we did (for now) and what is implemented currently in this branch is just rescaling from a uniform unit hypercube to uniform in ra and dec on ranges [0, 2pi] an [-pi/2, pi/2]. I am curious if you or others have an idea in mind to do this properly. You mentioned on the call today something about sampling a random pixel according to the map probabilities (which we do in the sample method) but I am not sure how that would transfer/relate to the rescale method. From that I imagine we could create the "inverse_cdf" for pixel the same as the
Interped
Prior does but then we are proposing a single value from the unit cube for pixel and rescale that onto 2 values (ra, dec) This seems like it may mess things up? Thanks for the input!added 1 commit
- e2fd11f4 - changed rescale method to use inverse_cdf of p(pixel) for HealPixMapPriors
added 1 commit
- 8f4c440f - remove some comments and change bound checking in sampling methods
added 9 commits
-
8f4c440f...8e54566f - 8 commits from branch
lscsoft:master
- c98091e5 - Merge branch 'master' into 'joint_prior'
-
8f4c440f...8e54566f - 8 commits from branch
added 2 commits
- 36a564a0 - remove ordered dict
- eb239390 - Merge branch 'joint_prior' of https://git.ligo.org/bruce.edelman/bilby into joint_prior
mentioned in merge request !654 (merged)
added Feature-request Priors + 1 deleted label
added 2 commits
added 1 commit
- f10ca006 - added some commenting and remove unecessary distance checks
- Resolved by Bruce Edelman
mentioned in merge request !668 (merged)
added 228 commits
-
c67aaf05...409dd851 - 214 commits from branch
lscsoft:master
- 1d0a223b - remove unecessary exception classes
- 2689d1fd - change to except all errors / exceptions when checking import of healpy
- 9beb868a - branch to merge joint_prior infrastructure
- 4fae07fe - remove old stuff:
- cf7c3983 - readd blank line
- 46291564 - fixed checking base classes for multiple inheritences
- 2eb59665 - Update .gitignore
- 9f634c75 - fix PriorDict to_file() method and some typos
- 1d83fc88 - fixed priordict to file saving
- ec709f98 - Merge branch 'joint_prior_only' of https://git.ligo.org/bruce.edelman/bilby into joint_prior_only
- 1dd86d34 - update joint_prior_only branch with new master
- 2566f615 - formatting
- afaef1be - fix conflicts with latest master
- 834493b5 - fixed instantiation_dict method naming
Toggle commit list-
c67aaf05...409dd851 - 214 commits from branch
added 1 commit
- b81b6be3 - updated joint_prior branch (includes healpy map prior) to match with...
added 1 commit
- cda39f7f - fixed 9/10 of failing prior tests. STILL NEED TO FIGURE OUT JSON ENCODING
added 2 commits
added 15 commits
-
d402d097...bd7abac5 - 14 commits from branch
lscsoft:master
- 1acee00f - Merge branch 'master' into 'joint_prior'
-
d402d097...bd7abac5 - 14 commits from branch
added 2 commits
- 9c0d1769 - fix some bugs
- 1e67614b - Merge branch 'joint_prior' of https://git.ligo.org/bruce.edelman/bilby into joint_prior
added 23 commits
-
41d50a38...6391fe87 - 22 commits from branch
lscsoft:master
- 099ce8e3 - Merge branch 'master' into 'joint_prior'
-
41d50a38...6391fe87 - 22 commits from branch
- Resolved by Bruce Edelman
@bruce.edelman @colm.talbot Is this ready to be merged? I am asking because this is going to collide with my other MR !688 (merged). It may be easier to merge this one first.
added 25 commits
-
6c81650f...29a34a34 - 24 commits from branch
lscsoft:master
- 532d2432 - Merge branch 'master' of https://git.ligo.org/lscsoft/bilby into joint_prior
-
6c81650f...29a34a34 - 24 commits from branch
added 1 commit
- edbe0001 - fixed distance sampling, still need to fix distance rescale / ppf
changed title from HealPixPrior / JointPrior (Issue #419 (closed)) to HealPixPrior (Resloves Issue #419 (closed))
added 1 commit
- 79ae7608 - fixed the distance sampling so we always get positive and not NaN or None distances