diff --git a/reproject/healpix/core.py b/reproject/healpix/core.py index 6f8e76419..0b93ae267 100644 --- a/reproject/healpix/core.py +++ b/reproject/healpix/core.py @@ -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 @@ -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) diff --git a/reproject/spherical_intersect/core.py b/reproject/spherical_intersect/core.py index fc2e53536..e2beb5e24 100644 --- a/reproject/spherical_intersect/core.py +++ b/reproject/spherical_intersect/core.py @@ -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)