Skip to content

Support "non-linear" / "roll-dependent" focal plane distortions - #1741

Open
mhasself wants to merge 12 commits into
masterfrom
mhasself/focal-plane-distortions
Open

mhasself wants to merge 12 commits into
masterfrom
mhasself/focal-plane-distortions

Conversation

@mhasself

@mhasself mhasself commented Sep 9, 2026

Copy link
Copy Markdown
Member

These changes are needed to account for the non-linear distortions due
to the LAT's off-axis mirrors; otherwise only a single value of the
"roll" can be treated in the existing framework.

Introduces the idea of "focal_plane_template", a TOD member like
focal_plane that will be used as the source to compute the
(model-corrected) focal_plane.

This changes the apply_pointing_model interface a bit but probably not
in a way that users will notice.

This framework can also be used to support detailed refraction corrections, in the future.

These changes are needed to account for the non-linear distortions due
to the LAT's off-axis mirrors; otherwise only a single value of the
"roll" can be treated in the existing framework.

Introduces the idea of "focal_plane_template", a TOD member like
focal_plane that will be used as the source to compute the
(model-corrected) focal_plane.

This changes the apply_pointing_model interface a bit but probably not
in a way that users will notice.
@mhasself
mhasself marked this pull request as ready for review September 11, 2026 17:31
@mhasself
mhasself requested review from amaurea and skhrg September 11, 2026 17:31

@amaurea amaurea left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks fine. I checked the arc implementation, and it matches mine. Thanks for impementing this. Is the zemax model updated, or does it still just cover the central tube?

@mhasself

Copy link
Copy Markdown
Member Author

Looks fine. I checked the arc implementation, and it matches mine. Thanks for impementing this. Is the zemax model updated, or does it still just cover the central tube?

Thanks. The zemax version applies to the full focal plane.

Also @amaurea mentioned elsewhere that I should probably not import private functions from other submodules, and that roll_dist_model should perhaps be a string instead of an int (which makes sense to me). So I may apply those changes before merging.

@skhrg

skhrg commented Sep 16, 2026

Copy link
Copy Markdown
Member

Looks good to me. Two nitpicky comments:

  1. Seems like we make a ton of copies of the the focal plane? Is this strictly needed? I know you have the in_place arg for the distortion but it would be nice if I could just keep the same buffer the and modify it in place always (but copy over the template before distorting or something). I suppose this only really matters when we fit the pointing mode so I can always work around it somehow.
  2. dist_model‎ needs to be an int, but it seems inevitable that its going to get cast to float somewhere by someone, can we cast it to be safe? Also why not do dist_model = params.get('roll_dist_model', 0)?

@mhasself

Copy link
Copy Markdown
Member Author

Looks good to me. Two nitpicky comments:

1. Seems like we make a ton of copies of the the focal plane? Is this strictly needed? I know you have the `in_place` arg for the distortion but it would be nice if I could just keep the same buffer the and modify it in place always (but copy over the template before distorting or something). I suppose this only really matters when we fit the pointing mode so I can always work around it somehow.

Ah, ya I can probably remove a bunch of that. This was sort of left over from when I hadn't figured out how I wanted to do the _template handling. The "in_place" option is not worth the complexity it adds.

2. `dist_model‎` needs to be an int, but it seems inevitable that its going to get cast to float somewhere by someone, can we cast it to be safe? Also why not do `dist_model = params.get('roll_dist_model', 0)`?

Ok, latest code has this as a string. How do you feel about that? And I'll change it to dist_model = params['roll_dist_model']. The default val of "none" is included in the lat_v1 and lat_v2 defaults.

@skhrg

skhrg commented Sep 16, 2026

Copy link
Copy Markdown
Member

Ok, latest code has this as a string. How do you feel about that? And I'll change it to dist_model = params['roll_dist_model']. The default val of "none" is included in the lat_v1 and lat_v2 defaults.

I think an int is preferable to a string, if only because then when you pass this to an optimizer and int can just be left fixed but a string will require a wrapper that splices the value in.

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.

3 participants