Skip to content

Commit

Permalink
Added furst_optics.feed_optics.FeedOptic.transformation_image prope…
Browse files Browse the repository at this point in the history
…rty.
  • Loading branch information
byrdie committed Sep 2, 2024
1 parent 38607a0 commit a60e3c6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
14 changes: 14 additions & 0 deletions furst_optics/feed_optics/_feed_optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,20 @@ def transformation(self) -> na.transformations.AbstractTransformation:
)
return t_img @ super().transformation @ t_yaw @ t_center

@property
def transformation_image(self):
"""
Coordinate transformation from the global coordinate system
and the virtual image of the Sun inside the feed optic.
"""

t_img = na.transformations.Cartesian3dTranslation(
x=0 * u.mm,
y=0 * u.mm,
z=self.radius / 2,
)
return t_img @ self.transformation

@property
def surface(self) -> optika.surfaces.Surface:
return optika.surfaces.Surface(
Expand Down
6 changes: 5 additions & 1 deletion furst_optics/feed_optics/_feed_optics_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
import astropy.units as u
import named_arrays as na
from optika._tests import test_mixins
import furst_optics._components_test

Expand All @@ -23,4 +24,7 @@ class TestFeedOptics(
test_mixins.AbstractTestTranslatable,
furst_optics._components_test.AbstractTestAbstractRowlandComponent,
):
pass

def test_transformation_image(self, a: furst_optics.feed_optics.FeedOptic):
result = a.transformation_image
assert isinstance(result, na.transformations.AbstractTransformation)

0 comments on commit a60e3c6

Please sign in to comment.