Skip to content
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

Add max_pixrad() function #48

Open
ntessore opened this issue Apr 16, 2024 · 1 comment
Open

Add max_pixrad() function #48

ntessore opened this issue Apr 16, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ntessore
Copy link
Owner

Add a function to return the maximum radius of HEALPix pixels at a given NSIDE.

@ntessore ntessore added the enhancement New feature or request label Apr 16, 2024
@ntessore
Copy link
Owner Author

ntessore commented Apr 16, 2024

Using the expressions for pixel boundaries from Gorski et al. (2005), I think it can be shown that the largest diagonal is just inside the northern polar region, next to the zero meridian. This appears to agree with Fig. 3.

According to Section 4.1, the ring index is $i = N_{\rm side}$, and the pixel-in-ring index is $j = 1$ (note that the stated bounds for $i$ appear to be incorrect, since $N_{\rm side} = 1$ cannot work). Using (4) and (5), the pixel centre is hence $z = \frac{2}{3}$ and $\phi = \frac{\pi}{4 N_{\rm side}}$.

According to Fig. 9, the northern vertex of said pixel is $v(k, k')$. Since $\phi_v(k, k') = 0$, it follows that $k = 0$ by (A8). Furthermore, since the eastern vertex $v(k+1, k')$ is due north of the pixel with $i = N_{\rm side} + 1, j = 1$, it follows that $\phi_v(k+1, k') = \frac{\pi}{2 N_{\rm side}}$, and hence $k' = N_{\rm side} - 1$ by (A8). Using (A7), the northern pixel vertex is hence at $z_v(k, k') = 1 - \frac{1}{3} \bigl(\frac{N_{\rm side} - 1}{N_{\rm side}}\bigr)^2$ and $\phi_v(k, k') = 0$. This holds even for $N_{\rm side} = 1$.

The maximum pixel radius is then the angular distance between $(z, \phi)$ and $(z_v, \phi_v)$.

@ntessore ntessore self-assigned this Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant