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

Fixes in optics code #925

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Fixes in optics code #925

wants to merge 5 commits into from

Conversation

skhrg
Copy link
Member

@skhrg skhrg commented Aug 13, 2024

No description provided.

@skhrg skhrg requested a review from mhasself August 14, 2024 14:50
@@ -330,7 +330,7 @@ def LAT_optics(zemax_path):
x = LAT["x"][gi].ravel()
y = LAT["y"][gi].ravel()
xi = LAT["elev"][gi].ravel()
eta = LAT["eta"][gi].ravel()
eta = LAT["xel"][gi].ravel()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we making an approximation here when converting "elev, xel" into "xi, eta"? If so ... does that matter? Elevation and cross-elevation are similar to xi, eta, if you're near elevation 0... but when you get a few degrees away from that origin, the difference starts to matter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The zemax model defines the origin to be at the boresite (since it doesn't know anything about sky coordinates and is modeled at a fixed configuration). So I think in this case el/xel is the same as xi/eta. So the only elevation dependent effect here is the LOS rotation.

I think even if it was actual el/xel then it would still be OK since we could just compute the template at el=0 and rotate to get the correct orientation (which is basically what happens right now anyways).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point is that "el, xel" is not the same as "xi, eta", even stipulating that el=0. The coordinate conversion to get (xi, eta) from (el, xel) is easy to do with so3g.proj.quat functions -- I guess I am proposing that we do that properly instead of ignoring the difference.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sure, I see what you are saying. I suppose el/xel is actually a lonlat pair? As usually my quaternion brain is under developed so a check on the transforms is appreciated. I want to say that I should have a sign change when doing xel but I'm only 51% sure...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose el/xel is actually a lonlat pair?

That is the concern. Is it? If so, you'll want to do something like (depending on the sign convention for xel):

xi, eta, _ = quat.decompose_xieta(quat.euler(1, -np.pi/2) * quat.rotation_lonlat(-xel, el))

That takes, for example,

>>> el, xel = .01, .02
>>> xi, eta, _ = quat.decompose_xieta(quat.euler(1, -np.pi/2) * quat.rotation_lonlat(-xel, el))
>>> xi, eta
(0.019997666768331163, 0.009999833334166508)

Though it's also confusing to me that you associate (xi, eta) with (el, xel) ... rather than (xel, el). That will need to be sorted. Draw me a picture and we'll work it out...

Copy link
Member

@mhasself mhasself left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok -- I like what's in here for the SAT now but I still wonder about the LAT ... let's follow that up separately I guess. Thanks!

@skhrg
Copy link
Member Author

skhrg commented Nov 11, 2024

Ok I am reasonably confident in what is going on with these LAT updates (+ a unit test now exists).

@mhasself can you take another look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants