Skip to content

Commit

Permalink
Add 'depth' parameters in 'MOC.from_healpix_cells' calls
Browse files Browse the repository at this point in the history
  • Loading branch information
fxpineau committed Feb 27, 2023
1 parent a2a0f34 commit 1378a67
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 120 deletions.
6 changes: 4 additions & 2 deletions docs/examples/cone_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
from cdshealpix import cone_search
from mocpy import MOC, WCS

max_depth = 10

ipix, depth, fully_covered = cone_search(
lon=Longitude(0, u.deg), lat=Latitude(0, u.deg), radius=10 * u.deg, depth=10
lon=Longitude(0, u.deg), lat=Latitude(0, u.deg), radius=10 * u.deg, depth=max_depth
)


moc = MOC.from_healpix_cells(ipix, depth, fully_covered)
moc = MOC.from_healpix_cells(ipix, depth, max_depth)
# Plot the MOC using matpl/Wordotlib


Expand Down
6 changes: 4 additions & 2 deletions docs/examples/elliptic_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@
from cdshealpix import elliptical_cone_search
from mocpy import MOC, WCS

max_depth = 10

ipix, depth, fully_covered = elliptical_cone_search(
lon=Longitude(0, u.deg),
lat=Latitude(0, u.deg),
a=Angle(50, unit="deg"),
b=Angle(5, unit="deg"),
pa=Angle(30, unit="deg"),
depth=10,
depth=max_depth,
)

moc = MOC.from_healpix_cells(ipix, depth, fully_covered)
moc = MOC.from_healpix_cells(ipix, depth, max_depth)
# Plot the MOC using matplotlib


Expand Down
10 changes: 6 additions & 4 deletions docs/examples/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,17 @@ of the galactic disc.
# For the HEALPix in equatorial coordinate system
low_extinction_index_equatorial = np.where((ext_map_equatorial_nested < 0.5))[0]
moc_low_extinction_equatorial = MOC.from_healpix_cells(
low_extinction_index_equatorial,
np.full((len(low_extinction_index_equatorial)),norder)
ipix = low_extinction_index_equatorial,
depth = np.full((len(low_extinction_index_equatorial)),norder),
max_depth = norder
)

# For the HEALPix in galactic coordinate system
low_extinction_index_galactic = np.where((extinction_values < 0.5))[0]
moc_low_extinction_galactic = MOC.from_healpix_cells(
low_extinction_index_galactic,
np.full((len(low_extinction_index_galactic)),norder)
ipix = low_extinction_index_galactic,
depth = np.full((len(low_extinction_index_galactic)),norder),
max_depth = norder
)

# Plot the MOCs using matplotlib
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/polygon_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
lon = Longitude([20, -20, -20, 20], u.deg)
lat = Latitude([20, 20, -20, -20], u.deg)

depth = 7
ipix, depth, fully_covered = polygon_search(lon, lat, depth)
max_depth = 7
ipix, depth, fully_covered = polygon_search(lon, lat, max_depth)


moc = MOC.from_healpix_cells(ipix, depth, fully_covered)
moc = MOC.from_healpix_cells(ipix, depth, max_depth)
# Plot the MOC using matplotlib


Expand Down
125 changes: 16 additions & 109 deletions notebooks/external_neighbours.ipynb

Large diffs are not rendered by default.

0 comments on commit 1378a67

Please sign in to comment.