Skip to content

Commit

Permalink
Deploying to gh-pages from @ 02940e9 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
ManonMarchand committed Nov 27, 2023
1 parent 8d00864 commit ef1198b
Show file tree
Hide file tree
Showing 79 changed files with 3,592 additions and 1,373 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: e4d7bcd7488393e6776e2cda040171e2
config: c0d013f64e11bbc1c80ec8243b6838fd
tags: 645f666f9bcd5a90fca523b33c5a78b7
437 changes: 437 additions & 0 deletions _collections/notebooks/coordinate_conversion.html

Large diffs are not rendered by default.

337 changes: 337 additions & 0 deletions _collections/notebooks/external_neighbours.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,337 @@
<!DOCTYPE html>

<html lang="en" data-content_root="../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<title>External Neighbours &#8212; cdshealpix 0.6.4 documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../_static/bootstrap-astropy.css?v=9d21690f" />
<link rel="stylesheet" type="text/css" href="../../_static/plot_directive.css" />
<link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../../_static/sg_gallery.css?v=61a4c737" />
<link rel="stylesheet" type="text/css" href="../../_static/nbsphinx-code-cells.css" />

<script src="../../_static/documentation_options.js?v=73d9a94e"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../../_static/copybutton.js?v=f281be69"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script>window.MathJax = {"tex": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}, "options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document", "processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script>
<script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script type="text/javascript" src="../../_static/sidebar.js"></script>
<script type="text/javascript" src="../../_static/copybutton.js"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="API" href="../../api.html" />
<link rel="prev" title="Coordinate conversion" href="coordinate_conversion.html" />
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,600' rel='stylesheet' type='text/css'/>

</head><body>
<div class="topbar">
<a class="brand" title="Documentation Home" href="../../index.html"><span id="logotext1">cds</span><span id="logotext2">healpix</span><span id="logotext3">:docs</span></a>
<ul>

<li><a class="homelink" title="Astropy Homepage" href="http://www.astropy.org"></a></li>
<li><a title="General Index" href="../../genindex.html">Index</a></li>
<li><a title="Module Index" href="../../py-modindex.html">Modules</a></li>
<li>


<form action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>

</li>
</ul>
</div>

<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right">
<a href="../../api.html" title="API">
next &raquo;
</a>
</li>
<li class="right">
<a href="coordinate_conversion.html" title="Coordinate conversion">
&laquo; previous
</a>
|
</li>
<li>
<a href="../../index.html">cdshealpix 0.6.4 documentation</a>
&#187;
</li>
<li><a href="../../examples/examples.html" accesskey="U">Examples</a> &#187;</li>

<li>External Neighbours</li>
</ul>
</div>


<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">

<section id="External-Neighbours">
<h1>External Neighbours<a class="headerlink" href="#External-Neighbours" title="Link to this heading"></a></h1>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[1]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre><span></span># Astropy tools
import astropy.units as u
from astropy.coordinates import Angle, SkyCoord

# Moc and HEALPix tools
import cdshealpix
import mocpy
from mocpy import MOC, WCS

# For plots
import matplotlib.pyplot as plt

import numpy as np

print(&quot;healpix version : &quot;, cdshealpix.__version__)
print(&quot;mocpy version : &quot;, mocpy.__version__)
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
healpix version : 0.6.4
mocpy version : 0.13.0
</pre></div></div>
</div>
<div class="nbinput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[2]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre><span></span>ipix = np.arange(12 * 4**3, dtype=np.uint64)
depth = 3
delta_depth = 2
</pre></div>
</div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[3]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre><span></span>help(cdshealpix.external_neighbours)
edges, corners = cdshealpix.external_neighbours(ipix, depth, delta_depth)
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Help on function external_neighbours in module cdshealpix.nested.healpix:

external_neighbours(ipix, depth, delta_depth, num_threads=0)
Get the neighbours of specific healpix cells.

This method returns two arrays. One containing the healpix cells
located on the external borders of the cells (at depth: `depth` + `delta_depth`).
The other containing the healpix cells located on the external corners of the cells
(at depth: `depth` + `delta_depth`). Please note that some pixels do not have 4 external corners
e.g. the 12 base pixels have each only 2 external corners.

Parameters
----------
ipix : `numpy.ndarray`
The healpix cells from which the external neighbours will be computed
depth : int
The depth of the input healpix cells
delta_depth : int
The depth of the returned external neighbours will be equal to: `depth` + `delta_depth`
num_threads : int, optional
Specifies the number of threads to use for the computation. Default to 0 means
it will choose the number of threads based on the RAYON_NUM_THREADS environment variable (if set),
or the number of logical CPUs (otherwise)

Returns
-------
external_border_cells, external_corner_cells : (`numpy.ndarray`, `numpy.ndarray`)
external_border_cells will store the pixels located at the external borders of `ipix`.
It will be of shape: (N, 4 * 2 ** (`delta_depth`)) for N input pixels and because each cells have 4 borders.
external_corner_cells will store the pixels located at the external corners of `ipix`
It will be of shape: (N, 4) for N input pixels. -1 values will be put in the array when the pixels have no corners for specific directions.

</pre></div></div>
</div>
<div class="nbinput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[4]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre><span></span>ipix_corner_cells = corners[corners &gt;= 0].ravel().astype(int)
ipix_border_cells = edges.ravel().astype(int)
</pre></div>
</div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[5]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre><span></span>help(MOC.from_healpix_cells)
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Help on method from_healpix_cells in module mocpy.moc.moc:

from_healpix_cells(ipix, depth, max_depth) method of builtins.type instance
Create a MOC from a set of HEALPix cells at various depths.

Parameters
----------
ipix : `numpy.ndarray`
HEALPix cell indices in the NESTED notation. dtype must be np.uint64
depth : `numpy.ndarray`
Depth of the HEALPix cells. Must be of the same size of `ipix`.
dtype must be np.uint8. Corresponds to the `level` of an HEALPix cell in astropy.healpix.
max_depth : int, The resolution of the MOC (degrades on the fly input cells if necessary)

Raises
------
IndexError
When `ipix` and `depth` do not have the same shape

Returns
-------
moc : `~mocpy.moc.MOC`
The MOC

</pre></div></div>
</div>
<div class="nbinput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[6]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre><span></span># Create the moc from corner cells
depth_corner_cells = np.ones(ipix_corner_cells.shape, dtype=np.uint8) * (
depth + delta_depth
)
moc_from_corner_cells = MOC.from_healpix_cells(
ipix=ipix_corner_cells, depth=depth_corner_cells, max_depth=depth + delta_depth
)
</pre></div>
</div>
</div>
<div class="nbinput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[7]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre><span></span># Create the moc from border cells
depth_border_cells = np.ones(ipix_border_cells.shape, dtype=np.uint8) * (
depth + delta_depth
)
moc_from_border_cells = MOC.from_healpix_cells(
ipix=ipix_border_cells, depth=depth_border_cells, max_depth=depth + delta_depth
)
</pre></div>
</div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[8]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre><span></span># Plot the MOC using matplotlib
fig = plt.figure(111, figsize=(10, 10))
# Define a astropy WCS from the mocpy.WCS class
with WCS(
fig,
fov=120 * u.deg,
center=SkyCoord(0, 0, unit=&quot;deg&quot;, frame=&quot;icrs&quot;),
coordsys=&quot;icrs&quot;,
rotation=Angle(0, u.degree),
projection=&quot;SIN&quot;,
) as wcs:
ax = fig.add_subplot(1, 1, 1, projection=wcs)

moc_from_corner_cells.fill(ax=ax, wcs=wcs, alpha=0.5, fill=True, color=&quot;green&quot;)
moc_from_border_cells.fill(ax=ax, wcs=wcs, alpha=0.5, fill=True, color=&quot;red&quot;)

plt.xlabel(&quot;ra&quot;)
plt.ylabel(&quot;dec&quot;)
plt.title(&quot;neighbours&quot;)
plt.grid(color=&quot;black&quot;, linestyle=&quot;dotted&quot;)
plt.show()
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<img alt="../../_images/_collections_notebooks_external_neighbours_8_0.png" src="../../_images/_collections_notebooks_external_neighbours_8_0.png" />
</div>
</div>
</section>


<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper"><h3>Page Contents</h3>
<ul>
<li><a class="reference internal" href="#">External Neighbours</a></li>
</ul>


<div>
<h4>Previous topic</h4>
<p class="topless"><a href="coordinate_conversion.html"
title="previous chapter">Coordinate conversion</a></p>
</div>
<div>
<h4>Next topic</h4>
<p class="topless"><a href="../../api.html"
title="next chapter">API</a></p>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/_collections/notebooks/external_neighbours.ipynb.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<form action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="clearer"></div>
</div>
<footer class="footer">
<p class="pull-right">
<a href="../../_sources/_collections/notebooks/external_neighbours.ipynb.txt"
rel="nofollow">Page Source</a> &nbsp;
<a href="#">Back to Top</a></p>
<p>
&copy; Copyright 2023, Matthieu Baumann &lt;[email protected]&gt; F.-X. Pineau &lt;[email protected]&gt;.<br/>
Created using <a href="http://www.sphinx-doc.org/en/stable/">Sphinx</a> 7.2.6. &nbsp;
</p>
</footer>
</body>
</html>
Binary file modified _downloads/39b3af9f4ee1495db4b09e7afaba97d9/cone_search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _downloads/4d432ba58fd65c55157b30a7f4568529/elliptic_search.pdf
Binary file not shown.
Binary file modified _downloads/94f64f5c1afdf49a78466aa6d8824f6d/polygon_search.pdf
Binary file not shown.
Binary file modified _downloads/c881ed5ce2829d8df608287b5b4e471e/elliptic_search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _downloads/d4dfe07011288b4cb33a28eeab641c25/cone_search.pdf
Binary file not shown.
Binary file modified _downloads/e4e096a4996f660425152a983d812744/polygon_search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/cone_search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/elliptic_search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _images/examples_8_0.png
Binary file not shown.
Binary file modified _images/polygon_search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ef1198b

Please sign in to comment.