Skip to content

Commit 44f54da

Browse files
committed
cache pixel area
1 parent 91c836d commit 44f54da

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

synthesizAR/instruments/base.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from astropy.coordinates import SkyCoord
1313
from dataclasses import dataclass
14+
from functools import cached_property
1415
from scipy.interpolate import interp1d
1516
from scipy.ndimage import gaussian_filter
1617
from sunpy.coordinates import HeliographicStonyhurst, Helioprojective
@@ -109,7 +110,7 @@ def resolution(self) -> u.arcsec/u.pix:
109110
def resolution(self, value):
110111
self._resolution = value
111112

112-
@property
113+
@cached_property
113114
def observer(self):
114115
return self._observer.transform_to(HeliographicStonyhurst)
115116

@@ -157,7 +158,7 @@ def calculate_intensity_kernel(self, *args, **kwargs):
157158
def projected_frame(self):
158159
return Helioprojective(observer=self.observer)
159160

160-
@property
161+
@cached_property
161162
@u.quantity_input
162163
def pixel_area(self) -> u.cm**2:
163164
"""

0 commit comments

Comments
 (0)