Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions autogalaxy/galaxy/galaxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def image_2d_list_from(
for galaxy in self
]

@aa.grid_dec.to_array
@aa.decorators.to_array
def image_2d_from(
self, grid: aa.type.Grid2DLike, xp=np, operated_only: Optional[bool] = None
) -> aa.Array2D:
Expand Down Expand Up @@ -175,7 +175,7 @@ def galaxy_image_2d_dict_from(

return galaxy_image_2d_dict

@aa.grid_dec.to_vector_yx
@aa.decorators.to_vector_yx
def deflections_yx_2d_from(
self, grid: aa.type.Grid2DLike, xp=np, **kwargs
) -> np.ndarray:
Expand All @@ -201,7 +201,7 @@ def deflections_yx_2d_from(
"""
return sum(map(lambda g: g.deflections_yx_2d_from(grid=grid, xp=xp), self))

@aa.grid_dec.to_grid
@aa.decorators.to_grid
def traced_grid_2d_from(
self, grid: aa.type.Grid2DLike, xp=np
) -> aa.type.Grid2DLike:
Expand All @@ -210,7 +210,7 @@ def traced_grid_2d_from(
"""
return grid - self.deflections_yx_2d_from(grid=grid, xp=xp)

@aa.grid_dec.to_array
@aa.decorators.to_array
def convergence_2d_from(
self, grid: aa.type.Grid2DLike, xp=np, **kwargs
) -> np.ndarray:
Expand All @@ -236,7 +236,7 @@ def convergence_2d_from(
"""
return sum(map(lambda g: g.convergence_2d_from(grid=grid, xp=xp), self))

@aa.grid_dec.to_array
@aa.decorators.to_array
def potential_2d_from(
self, grid: aa.type.Grid2DLike, xp=np, **kwargs
) -> np.ndarray:
Expand Down
10 changes: 5 additions & 5 deletions autogalaxy/galaxy/galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def image_2d_list_from(
)
]

@aa.grid_dec.to_array
@aa.decorators.to_array
def image_2d_from(
self,
grid: aa.type.Grid2DLike,
Expand Down Expand Up @@ -246,7 +246,7 @@ def image_2d_from(
)
return xp.zeros((grid.shape[0],))

@aa.grid_dec.to_vector_yx
@aa.decorators.to_vector_yx
def deflections_yx_2d_from(
self, grid: aa.type.Grid2DLike, xp=np, **kwargs
) -> np.ndarray:
Expand Down Expand Up @@ -277,7 +277,7 @@ def deflections_yx_2d_from(

return xp.zeros((grid.shape[0], 2))

@aa.grid_dec.to_array
@aa.decorators.to_array
def convergence_2d_from(
self, grid: aa.type.Grid2DLike, xp=np, **kwargs
) -> np.ndarray:
Expand Down Expand Up @@ -318,7 +318,7 @@ def half_light_radius(self):
"""
return None

@aa.grid_dec.to_grid
@aa.decorators.to_grid
def traced_grid_2d_from(
self, grid: aa.type.Grid2DLike, xp=np
) -> aa.type.Grid2DLike:
Expand Down Expand Up @@ -355,7 +355,7 @@ def traced_grid_2d_from(

return grid - self.deflections_yx_2d_from(grid=grid, xp=xp)

@aa.grid_dec.to_array
@aa.decorators.to_array
def potential_2d_from(
self, grid: aa.type.Grid2DLike, xp=np, **kwargs
) -> np.ndarray:
Expand Down
8 changes: 4 additions & 4 deletions autogalaxy/galaxy/mock/mock_galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ def __init__(self, value, shape=1):
self.value = value
self.shape = shape

@aa.grid_dec.to_array
@aa.decorators.to_array
def image_2d_from(self, grid):
return np.full(shape=self.shape, fill_value=self.value)

@aa.grid_dec.to_array
@aa.decorators.to_array
def convergence_2d_from(self, grid):
return np.full(shape=self.shape, fill_value=self.value)

@aa.grid_dec.to_array
@aa.decorators.to_array
def potential_2d_from(self, grid):
return np.full(shape=self.shape, fill_value=self.value)

@aa.grid_dec.to_vector_yx
@aa.decorators.to_vector_yx
def deflections_yx_2d_from(self, grid):
return np.full(shape=(self.shape, 2), fill_value=self.value)
18 changes: 9 additions & 9 deletions autogalaxy/profiles/geometry_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class SphProfile(GeometryProfile):
def __init__(self, centre: Tuple[float, float] = (0.0, 0.0)):
super().__init__(centre=centre)

@aa.grid_dec.to_array
@aa.decorators.to_array
def radial_grid_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs) -> np.ndarray:
"""
Convert a grid of (y, x) coordinates, to their radial distances from the profile
Expand All @@ -126,7 +126,7 @@ def angle_to_profile_grid_from(
"""
return xp.cos(grid_angles), xp.sin(grid_angles)

@aa.grid_dec.to_grid
@aa.decorators.to_grid
def _cartesian_grid_via_radial_from(
self,
grid: aa.type.Grid2DLike,
Expand All @@ -153,7 +153,7 @@ def _cartesian_grid_via_radial_from(

return xp.multiply(radius[:, None], xp.vstack((sin_theta, cos_theta)).T)

@aa.grid_dec.to_grid
@aa.decorators.to_grid
def transformed_to_reference_frame_grid_from(self, grid, xp=np, **kwargs):
"""
Transform a grid of (y,x) coordinates to the reference frame of the profile.
Expand All @@ -167,7 +167,7 @@ def transformed_to_reference_frame_grid_from(self, grid, xp=np, **kwargs):
"""
return xp.subtract(grid.array, xp.array(self.centre))

@aa.grid_dec.to_grid
@aa.decorators.to_grid
def transformed_from_reference_frame_grid_from(self, grid, xp=np, **kwargs):
"""
Transform a grid of (y,x) coordinates from the reference frame of the profile to the original observer
Expand Down Expand Up @@ -282,7 +282,7 @@ def angle_to_profile_grid_from(self, grid_angles, xp=np, **kwargs):
theta_coordinate_to_profile = xp.add(grid_angles, -self.angle_radians(xp=xp))
return xp.cos(theta_coordinate_to_profile), xp.sin(theta_coordinate_to_profile)

@aa.grid_dec.to_grid
@aa.decorators.to_grid
def rotated_grid_from_reference_frame_from(
self, grid, xp=np, angle: Optional[float] = None, **kwargs
):
Expand Down Expand Up @@ -313,7 +313,7 @@ def rotated_grid_from_reference_frame_from(
grid_2d=grid, centre=(0.0, 0.0), angle=angle, xp=xp
)

@aa.grid_dec.to_array
@aa.decorators.to_array
def elliptical_radii_grid_from(
self, grid: aa.type.Grid2DLike, xp=np, **kwargs
) -> np.ndarray:
Expand All @@ -332,7 +332,7 @@ def elliptical_radii_grid_from(
)
)

@aa.grid_dec.to_array
@aa.decorators.to_array
def eccentric_radii_grid_from(
self, grid: aa.type.Grid2DLike, xp=np, **kwargs
) -> np.ndarray:
Expand All @@ -354,7 +354,7 @@ def eccentric_radii_grid_from(

return xp.multiply(xp.sqrt(self.axis_ratio(xp)), grid_radii.array)

@aa.grid_dec.to_grid
@aa.decorators.to_grid
def transformed_to_reference_frame_grid_from(
self, grid: aa.type.Grid2DLike, xp=np, **kwargs
) -> np.ndarray:
Expand All @@ -374,7 +374,7 @@ def transformed_to_reference_frame_grid_from(
grid_2d=grid.array, centre=self.centre, angle=self.angle(xp), xp=xp
)

@aa.grid_dec.to_grid
@aa.decorators.to_grid
def transformed_from_reference_frame_grid_from(
self, grid: aa.type.Grid2DLike, xp=np, **kwargs
) -> aa.type.Grid2DLike:
Expand Down
2 changes: 1 addition & 1 deletion autogalaxy/profiles/light/mock/mock_light_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(
self.value = value
self.value1 = value1

@aa.grid_dec.to_array
@aa.decorators.to_array
@check_operated_only
def image_2d_from(
self, grid, xp=np, operated_only: Optional[bool] = None, **kwargs
Expand Down
4 changes: 2 additions & 2 deletions autogalaxy/profiles/light/standard/chameleon.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray, xp=np) -> np.ndarray:
)

@aa.over_sample
@aa.grid_dec.to_array
@aa.decorators.to_array
@check_operated_only
@aa.grid_dec.transform
@aa.decorators.transform
def image_2d_from(
self,
grid: aa.type.Grid2DLike,
Expand Down
4 changes: 2 additions & 2 deletions autogalaxy/profiles/light/standard/eff.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray, xp=np) -> np.ndarray:
)

@aa.over_sample
@aa.grid_dec.to_array
@aa.decorators.to_array
@check_operated_only
@aa.grid_dec.transform
@aa.decorators.transform
def image_2d_from(
self,
grid: aa.type.Grid2DLike,
Expand Down
4 changes: 2 additions & 2 deletions autogalaxy/profiles/light/standard/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray, xp=np) -> np.ndarray:
)

@aa.over_sample
@aa.grid_dec.to_array
@aa.decorators.to_array
@check_operated_only
@aa.grid_dec.transform
@aa.decorators.transform
def image_2d_from(
self,
grid: aa.type.Grid2DLike,
Expand Down
4 changes: 2 additions & 2 deletions autogalaxy/profiles/light/standard/moffat.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray, xp=np) -> np.ndarray:
)

@aa.over_sample
@aa.grid_dec.to_array
@aa.decorators.to_array
@check_operated_only
@aa.grid_dec.transform
@aa.decorators.transform
def image_2d_from(
self,
grid: aa.type.Grid2DLike,
Expand Down
4 changes: 2 additions & 2 deletions autogalaxy/profiles/light/standard/sersic.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ def image_2d_via_radii_from(
)

@aa.over_sample
@aa.grid_dec.to_array
@aa.decorators.to_array
@check_operated_only
@aa.grid_dec.transform
@aa.decorators.transform
def image_2d_from(
self,
grid: aa.type.Grid2DLike,
Expand Down
4 changes: 2 additions & 2 deletions autogalaxy/profiles/light/standard/shapelets/cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ def coefficient_tag(self) -> str:
return f"n_y_{self.n_y}_n_x_{self.n_x}"

@aa.over_sample
@aa.grid_dec.to_array
@aa.decorators.to_array
@check_operated_only
@aa.grid_dec.transform
@aa.decorators.transform
def image_2d_from(
self,
grid: aa.type.Grid2DLike,
Expand Down
4 changes: 2 additions & 2 deletions autogalaxy/profiles/light/standard/shapelets/exponential.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def coefficient_tag(self) -> str:
return f"n_{self.n}_m_{self.m}"

@aa.over_sample
@aa.grid_dec.to_array
@aa.decorators.to_array
@check_operated_only
@aa.grid_dec.transform
@aa.decorators.transform
def image_2d_from(
self,
grid: aa.type.Grid2DLike,
Expand Down
4 changes: 2 additions & 2 deletions autogalaxy/profiles/light/standard/shapelets/polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ def coefficient_tag(self) -> str:
return f"n_{self.n}_m_{self.m}"

@aa.over_sample
@aa.grid_dec.to_array
@aa.decorators.to_array
@check_operated_only
@aa.grid_dec.transform
@aa.decorators.transform
def image_2d_from(
self,
grid: aa.type.Grid2DLike,
Expand Down
8 changes: 4 additions & 4 deletions autogalaxy/profiles/mass/abstract/mge.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ def wofz(z, xp=np):

return w

@aa.grid_dec.to_vector_yx
@aa.grid_dec.transform
@aa.decorators.to_vector_yx
@aa.decorators.transform
def deflections_2d_via_mge_from(
self,
grid: aa.type.Grid2DLike,
Expand Down Expand Up @@ -298,8 +298,8 @@ def zeta_from(self, grid: aa.type.Grid2DLike, sigma_log_list, xp=np):
return xp.where(ind_pos_y[None, :], core, xp.conj(core))

@aa.over_sample
@aa.grid_dec.to_array
@aa.grid_dec.transform
@aa.decorators.to_array
@aa.decorators.transform
def convergence_2d_via_mge_from(
self,
grid: aa.type.Grid2DLike,
Expand Down
4 changes: 2 additions & 2 deletions autogalaxy/profiles/mass/dark/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def __init__(
self.inner_slope = inner_slope

@aa.over_sample
@aa.grid_dec.to_array
@aa.grid_dec.transform
@aa.decorators.to_array
@aa.decorators.transform
def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
"""Calculate the projected convergence at a given set of arc-second gridded coordinates.

Expand Down
12 changes: 6 additions & 6 deletions autogalaxy/profiles/mass/dark/cnfw.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ def density_3d_func(self, r, xp=np):
* (r.array + self.scale_radius) ** (-2.0)
)

@aa.grid_dec.to_array
@aa.decorators.to_array
def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
"""
Convergence (dimensionless surface mass density) for the cored NFW profile.
This is not yet implemented for `cNFW`.
"""
return xp.zeros(shape=grid.shape[0])

@aa.grid_dec.to_array
@aa.decorators.to_array
def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
"""
Lensing potential for the cored NFW profile.
Expand Down Expand Up @@ -122,8 +122,8 @@ def __init__(
self.scale_radius = scale_radius
self.core_radius = core_radius

@aa.grid_dec.to_vector_yx
@aa.grid_dec.transform
@aa.decorators.to_vector_yx
@aa.decorators.transform
def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
"""
Calculate the deflection angles on a grid of (y,x) arc-second coordinates.
Expand Down Expand Up @@ -235,15 +235,15 @@ def dev_F_func(self, theta, radius, xp=np):

return 2 * dev_F

@aa.grid_dec.to_array
@aa.decorators.to_array
def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
"""
Convergence (dimensionless surface mass density) for the cored NFW profile.
This is not yet implemented for `cNFWSph`.
"""
return xp.zeros(shape=grid.shape[0])

@aa.grid_dec.to_array
@aa.decorators.to_array
def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
"""
Lensing potential for the cored NFW profile.
Expand Down
Loading
Loading