-
Notifications
You must be signed in to change notification settings - Fork 33
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
MOC overlap with a MRM: calculation of proba in the intersection #125
Comments
Hi @mcoughlin, thank you for your message. So far, there is no way to do this. If I understand correctly, you want to perform the intersection between a MOC and a MultiResolution HEALPix Map (MRM) What about a method: |
@fxpineau exactly. I think it should probably take in a table assuming you already loaded the fits file into memory as you will likely do this many times for different fields, but that is a minor nitpick. Thanks! |
additional TODO:document |
@mcoughlin what kind of table do you have? Is it an |
@ManonMarchand Yeah. After you have read in the skymap with read_sky_map from ligo.skymap.io import read_sky_map, as skymap = read_sky_map(filename, moc=True, distances=True), for example. |
I just added the functionality in MOC Lib Rust (see this commit) and in moc-cli (see this commit) but it is not released yet (only pushed in the main branch). We will try to integrate the functionality in MOCPy next week (we are in holidays for the rest of the week). |
Thanks @fxpineau. We look forward to the integration in mocpy! |
@ManonMarchand for the Rust part, as a starting point, see the new branch mom_sum. |
Hi, We added two methods (not yet merged but available in PR #127):
Is it what you needed? |
Thanks @ManonMarchand! I would guess you have confirmed that you get the same answer with your function as when you flatten both the skymap and the moc and do the sum that way? One idea (for the sake of potential speed up) is for a function that takes many MOCs and a skymap and returns an array of probabilities (one for each MOC). I suspect most folks will need to be looping over many fields so giving them a function where you do that internally is likely to be very useful. |
Thank you for your feedback @mcoughlin.
We basically checked that the value returned by the function applied to a MOC created from a multi-order map + a probability threshold, and taking as parameter the same input multi-order map, fit with the probability threshold.
From my point-of-view, this should be a method of the multi-order map object, thus in the multi-order map library (I also wonder if the Let first test and see if performances have to be improved for multiple MOCs. |
@fxpineau @ManonMarchand Awesome. I would be happy to test this ASAP, especially if you could get a version up on pypi. |
Thanks for the pypi release. Is the same planned for conda? |
Yep, done: https://anaconda.org/conda-forge/mocpy |
Given a MOC representing a telescope field, such as:
6/32777
7/131083 131085-131087 131096 131098 131105-131107 131112-131113 131120 131122
180241 180243-180244 180246 180249
8/524319 524327 524331 524337-524339 524362-524364 524366 524388 524390 524396
524398 524417-524419 524456-524458 524460 524464-524465 524468 524484 524486
524492 524494-524495 720961 720963 720969 720971 720980-720982 720988
721004-721005 721007-721008 721010 721016 721093 721095
...
and a gravitational-wave localization in multi-order coverage of the form:
UNIQ PROBDENSITY DISTMU DISTSIGMA DISTNORM
1 / sr Mpc Mpc 1 / Mpc2
1024 0.0018000524306513587 626.1008456818951 176.9447332144471 2.3623295578298845e-06
1025 0.0022572306351681714 599.5277708633371 184.2451449021805 2.5420891568905436e-06
1026 0.001742950980628719 618.5493307656486 179.67464089457215 2.4103058564805825e-06
1027 0.0021450711199728343 592.2768943296091 186.86994636222323 2.5926309212560773e-06
1028 0.0018645197302460666 612.6289458821037 180.04067149941744 2.4526183970504135e-06
...
Is there a fast way with mocpy to compute the integrated probability in that MOC? This is the same problem healpix-alchemy solves but for postgres: https://github.com/skyportal/healpix-alchemy.
An example for how this works would be useful in the docs for interacting with gravitational-wave skymaps, and I suspect greatly speed-up the python-based codes performing calculations of this kind.
The text was updated successfully, but these errors were encountered: