Skip to content

Commit

Permalink
Merge pull request astropy#78 from astrofrog/ignore-numpy-warnings
Browse files Browse the repository at this point in the history
Ignore Numpy warnings in HEALPIX
  • Loading branch information
astrofrog committed May 7, 2015
2 parents 5927519 + 2a39d34 commit 707cf0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions reproject/healpix/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def healpix_to_image(healpix_data, coord_system_in, wcs_out, shape_out,

# Convert between celestial coordinates
coord_system_in = parse_coord_system(coord_system_in)
lon_in, lat_in = convert_world_coordinates(lon_out, lat_out, wcs_out, (coord_system_in, u.deg, u.deg))
with np.errstate(invalid='ignore'):
lon_in, lat_in = convert_world_coordinates(lon_out, lat_out, wcs_out, (coord_system_in, u.deg, u.deg))

# Convert from lon, lat in degrees to colatitude theta, longitude phi,
# in radians
Expand Down Expand Up @@ -159,7 +160,8 @@ def image_to_healpix(data, wcs_in, coord_system_out,

# Convert between celestial coordinates
coord_system_out = parse_coord_system(coord_system_out)
lon_in, lat_in = convert_world_coordinates(lon_out, lat_out, (coord_system_out, u.deg, u.deg), wcs_in)
with np.errstate(invalid='ignore'):
lon_in, lat_in = convert_world_coordinates(lon_out, lat_out, (coord_system_out, u.deg, u.deg), wcs_in)

# Look up pixels in input system
yinds, xinds = wcs_in.wcs_world2pix(lon_in, lat_in, 0)
Expand Down
5 changes: 4 additions & 1 deletion reproject/spherical_intersect/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ def parallel_impl(nproc):
pool.close()
pool.join()

return array_new / weights, weights
with np.errstate(invalid='ignore'):
array_new /= weights

return array_new, weights

if _method == "c" and (nproc is None or nproc > 1):
return parallel_impl(nproc)
Expand Down

0 comments on commit 707cf0c

Please sign in to comment.