Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@
'contextlib.closing',
'h5py',
'hashlib',
'healpy',
'numpy',
'PIL',
'PIL.Image',
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ satisfied:
* :code:`numpy`
* :code:`scipy`
* :code:`astropy`
* :code:`astropy_healpix`
* :code:`h5py`
* :code:`healpy`
* :code:`requests`
* :code:`six`
* :code:`progressbar2`
Expand Down
6 changes: 3 additions & 3 deletions dustmaps/bayestar.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import astropy.coordinates as coordinates
import astropy.units as units
import h5py
import healpy as hp
from astropy_healpix.healpy import ang2pix

from .std_paths import *
from .map_base import DustMap, WebDustMap, ensure_flat_galactic
Expand Down Expand Up @@ -62,14 +62,14 @@ def lb2pix(nside, l, b, nest=True):
if (b < -90.) or (b > 90.):
return -1

pix_idx = hp.pixelfunc.ang2pix(nside, theta, phi, nest=nest)
pix_idx = ang2pix(nside, theta, phi, nest=nest)

return pix_idx

idx = (b >= -90.) & (b <= 90.)

pix_idx = np.empty(l.shape, dtype='i8')
pix_idx[idx] = hp.pixelfunc.ang2pix(nside, theta[idx], phi[idx], nest=nest)
pix_idx[idx] = ang2pix(nside, theta[idx], phi[idx], nest=nest)
pix_idx[~idx] = -1

return pix_idx
Expand Down
1 change: 0 additions & 1 deletion dustmaps/csfd.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import os
import numpy as np
import healpy as hp
import astropy.io.fits as fits
import astropy.units as units

Expand Down
2 changes: 1 addition & 1 deletion dustmaps/edenhofer2023.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _get_sphere(filepath):
def _interp_hpxr2lbd(data, radii, nside, nest, lon, lat, dist):
"""Interpolate a 3D map of HEALPix times radii to arbitrary longitude,
latitude, distance positions."""
from healpy.pixelfunc import get_interp_weights
from astropy_healpix.healpy import get_interp_weights

assert lon.shape == lat.shape == dist.shape
final_shape = data.shape[:-2] + lon.shape
Expand Down
1 change: 0 additions & 1 deletion dustmaps/gaia_tge.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import os
import numpy as np
import healpy as hp
from astropy.table import Table
import astropy.units as units

Expand Down
4 changes: 2 additions & 2 deletions dustmaps/healpix_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import six

import numpy as np
import healpy as hp
from astropy_healpix.healpy import npix2nside
import astropy.io.fits as fits

from .map_base import DustMap, coord2healpix
Expand All @@ -46,7 +46,7 @@ def __init__(self, pix_val, nest, coord_frame, flags=None):
coord_frame (str): The coordinate system that the HEALPix map is in.
Should be one of the frames supported by `astropy.coordinates`.
"""
self._nside = hp.pixelfunc.npix2nside(len(pix_val))
self._nside = npix2nside(len(pix_val))
self._pix_val = pix_val
self._nest = nest
self._frame = coord_frame
Expand Down
1 change: 0 additions & 1 deletion dustmaps/lenz2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import os
import numpy as np
import healpy as hp
import astropy.io.fits as fits
import astropy.units as units

Expand Down
10 changes: 5 additions & 5 deletions dustmaps/map_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from __future__ import print_function, division

import numpy as np
import healpy as hp
from astropy_healpix.healpy import ang2pix, vec2pix
import astropy.coordinates as coordinates
import astropy.units as units

Expand Down Expand Up @@ -65,17 +65,17 @@ def coord2healpix(coords, frame, nside, nest=True):
if hasattr(c, 'ra'):
phi = c.ra.rad
theta = 0.5*np.pi - c.dec.rad
return hp.pixelfunc.ang2pix(nside, theta, phi, nest=nest)
return ang2pix(nside, theta, phi, nest=nest)
elif hasattr(c, 'l'):
phi = c.l.rad
theta = 0.5*np.pi - c.b.rad
return hp.pixelfunc.ang2pix(nside, theta, phi, nest=nest)
return ang2pix(nside, theta, phi, nest=nest)
elif hasattr(c, 'x'):
x,y,z = [v.to('kpc').value for v in (c.x,c.y,c.z)]
return hp.pixelfunc.vec2pix(nside, x, y, z, nest=nest)
return vec2pix(nside, x, y, z, nest=nest)
elif hasattr(c, 'w'):
x,y,z = [v.to('kpc').value for v in (c.u,c.v,c.w)]
return hp.pixelfunc.vec2pix(nside, x, y, z, nest=nest)
return vec2pix(nside, x, y, z, nest=nest)
else:
raise dustexceptions.CoordFrameError(
'No method to transform from coordinate frame "{}" to HEALPix.'.format(
Expand Down
1 change: 0 additions & 1 deletion dustmaps/planck.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import os
import numpy as np
import healpy as hp
import astropy.io.fits as fits
import astropy.units as units

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def readme():
'scipy',
'astropy',
'h5py',
'healpy',
'astropy_healpix',
'requests',
'progressbar2',
'six'
Expand Down