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

Allow shifting a detector, in alternative to shifting a source #643

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

mperrin
Copy link
Collaborator

@mperrin mperrin commented Nov 22, 2024

Finish implementing the long-delayed option to shift a detector, rather than shifting the point source. This is implemented as an option for offsetting a detector relative to the nominal center of a beam. The underlying math for this has been implemented for years in the matrixDFT.py functions; this PR adds the small amount of code to the Detector class to pass through parameters to the matrix DFT functions.

Conceptually, shifting a source (+dX, +dY) should be equivalent to shifting the detector (-dX, -dY). There's a unit test implemented that verifies that is the case. (In fact, that unit test is >50% of the code in this PR)

This option may be used in certain future features that may be added to webbpsf/stpsf particularly in the context of coronagraph simulations. (We can already shift the source, and shift the coronagraph mask; this added the option to shift the detector also).

To Do:

  • add astropy units handling

@mperrin mperrin self-assigned this Nov 22, 2024
@mperrin mperrin marked this pull request as ready for review November 25, 2024 19:53
@mperrin
Copy link
Collaborator Author

mperrin commented Dec 6, 2024

@BradleySappington this one is a bit more technical optics in part, but hopefully the existence of a test function that passes should suffice to verify the physics part of this works as intended.

Copy link
Collaborator

@BradleySappington BradleySappington left a comment

Choose a reason for hiding this comment

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

Code is clean/commented and passing tests

@BradleySappington BradleySappington merged commit b058985 into spacetelescope:develop Dec 6, 2024
7 checks passed
@mperrin mperrin deleted the detector_offset branch December 6, 2024 20:20
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