Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tickets/DM-28584: Fix np.float alias bug #22

Merged
merged 1 commit into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions scarlet/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_pixel(self, sky_coord):
sky_coord: tuple, array
Coordinates on the sky
"""
sky = np.array(sky_coord, dtype=np.float).reshape(-1, 2)
sky = np.array(sky_coord, dtype=np.float64).reshape(-1, 2)

if self.wcs is not None:
wcs_ = self.wcs.celestial # only use celestial portion
Expand All @@ -111,7 +111,7 @@ def get_sky_coord(self, pixel):
pixel: tuple, array
Coordinates in the pixel space
"""
pix = np.array(pixel, dtype=np.float).reshape(-1, 2)
pix = np.array(pixel, dtype=np.float64).reshape(-1, 2)

if self.wcs is not None:
wcs_ = self.wcs.celestial # only use celestial portion
Expand Down Expand Up @@ -142,7 +142,7 @@ def convert_pixel_to(self, target, pixel=None):
coordinates at the location of `coord` in the target frame
"""
if pixel is None:
y, x = np.indices(self.shape[-2:], dtype=np.float)
y, x = np.indices(self.shape[-2:], dtype=np.float64)
pixel = np.stack((y.flatten(), x.flatten()), axis=1)

ra_dec = self.get_sky_coord(pixel)
Expand Down
2 changes: 1 addition & 1 deletion scarlet/measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def moments(component, N=2, centroid=None, weight=None):
if centroid is None:
centroid = np.array(model.shape) // 2

grid_x, grid_y = np.indices(model.shape[-2:], dtype=np.float)
grid_x, grid_y = np.indices(model.shape[-2:], dtype=np.float64)
if len(model.shape) == 3:
grid_y = grid_y[None, :, :]
grid_x = grid_x[None, :, :]
Expand Down