-
Notifications
You must be signed in to change notification settings - Fork 8
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
cone_coverage_approx - > unexpected results #14
Comments
Ok so it looks like if I take these results that appear to be at depth+1, get their ra/dec, then recompute the healpix at the requested depth, they are correct. So the main problem here is that one requests the healpix at order N, and gets them at order N+1. If I request them at N-1 to hopefully get the results I would expect for N, they are incorrect though. |
I extracted the logic from the cone search approx method and run that, I do find the right pixels that way. I wonder if it's once the resulting pixels gets passed as a BMOC builder object that something funky or undocumented happens? |
@Theodlz , A BMOC stores HEALPix cells at various depth/order. The method iter returns the raw values stored in the BMOC. A raw value encodes 3 values:
I have to check whether the methods to extract the 3 values from a raw BMOC value are public or not (and update the doc accordingly). The method to get the list of cell number at the BMOC maximum depth (the depth used in the Thus, if you replace |
thanks a lot for the detailed answer @fxpineau. And I see the flat_iter, that provides the healpix at the max depth right? That said I still don't get why just printing the bmoc shows me the healpix at max depth + 1. I edited the |
@Theodlz , Internally a BMOC is made of two attributes: its maximum depth and the list of raw encoded cells (at possibly various depth, see previous answer for more details). In your specific case, the raw encoded cell numbers are simply made of the cell numbers left shifted of two bits, with the LSB encoding the flag (0 in your case) and the 2nd LSB being a sentinel bit (set to 1) encoding the depth. |
I see, the Debug trait makes sense. What confused me @fxpineau is https://github.com/cds-astro/cds-healpix-rust/blob/master/src/nested/mod.rs#L3559, which converts the healpix found to the original depth, and then pushes the healpix to the bmoc builder https://github.com/cds-astro/cds-healpix-rust/blob/master/src/nested/mod.rs#L3566. By this logic, the healpix that are in there would be at the requested depth (I added a print in that loop adding them to the bmoc builder, and I can confirm that they are). So, is it somewhere in the bmoc builder that they are converted to healpix of another depth? Perhaps this is what is happening here? cds-healpix-rust/src/nested/bmoc.rs Lines 1800 to 1807 in ac75c51
Perhaps, the real "issue" here is that it is not immediately clear when reading the rust documentation that the Feel free to close that issue. |
Hi! I've been trying to use this crate for cone-search like operations. Here is an issue I ran into: I define my Layer at depth = 4, then use the
cone_coverage_approx()
methods to find the healpix that overlap with a cone at ra=291.319724, dec=-82.309285, radius = 300.0/3600.0 (300 arcsec). However, the pixels returned are erroneous, and not at the right depth.Here's a quick example:
This yields the error
Wrong hash value: too large.
, when I try to compute the ra/dec of the resulting healpix, which makes sense as the result of the cone search is [11274, 11298], which clearly isn't at depth 4! even if the result of the cone search says that the max depth is 4.I also tried doing
let n = get(3 as u8)
(3 instead of 4) to see if I could get the overlapping pixels at depth 4 this way, and I get [2818,2826], when the results should be [2818, 2824]. So it is indeed at depth + 1, but the results don't look quite right.I compared these results with healpy and astropy_healpix, and the
cdshealpix
ones appear incorrect, and to be at the requested depth + 1. Any idea what might be happening? I wonder if this error forward propagates into mocpy as well?The text was updated successfully, but these errors were encountered: