-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathmock_light_profile.py
More file actions
43 lines (33 loc) · 1.03 KB
/
mock_light_profile.py
File metadata and controls
43 lines (33 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import numpy as np
from typing import Optional
import autoarray as aa
from autogalaxy.profiles.light.decorators import (
check_operated_only,
)
import autogalaxy as ag
class MockLightProfile(ag.LightProfile):
def __init__(
self,
image_2d=None,
image_2d_value=None,
image_2d_first_value=None,
value=None,
value1=None,
):
super().__init__()
self.image_2d = image_2d
self.image_2d_value = image_2d_value
self.image_2d_first_value = image_2d_first_value
self.value = value
self.value1 = value1
@aa.decorators.to_array
@check_operated_only
def image_2d_from(
self, grid, xp=np, operated_only: Optional[bool] = None, **kwargs
):
if self.image_2d is not None:
return self.image_2d
image_2d = np.ones(shape=(grid.shape[0]))
if self.image_2d_first_value is not None:
image_2d[0] = self.image_2d_first_value
return image_2d