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

Fix sleep when no change in spectrum is requested #126

Merged
merged 3 commits into from
Oct 20, 2023

Conversation

ehpor
Copy link
Collaborator

@ehpor ehpor commented Oct 17, 2023

Lets the VARIA return early when there is no change in filters. Fixes #125

Also raises an error when negative bandwidths are requested. Fixes https://github.com/spacetelescope/hicat-package2/issues/291

This PR supersedes PR #104.

@ehpor ehpor added the bugfix Fixing of a bug label Oct 17, 2023
@ehpor ehpor self-assigned this Oct 17, 2023
@ehpor ehpor requested a review from raphaelpclt October 18, 2023 00:00
@ehpor
Copy link
Collaborator Author

ehpor commented Oct 18, 2023

Untested on hardware, but imo this should be fine without testing.

@ehpor ehpor requested a review from steigersg October 18, 2023 00:00
@ehpor
Copy link
Collaborator Author

ehpor commented Oct 18, 2023

A slightly confusing part is that @raphaelpclt reported 0.19sec for a no-move set_spectrum() here. The base sleep for the proxy however is only 0.05sec (=50ms) for HiCAT, so I'm not sure where the other 140ms is coming from.

@raphaelpclt
Copy link
Collaborator

New test with IPython
image

Almost a factor of 2, but still a lot

@raphaelpclt
Copy link
Collaborator

Well I ran both methods from the same Jupyter notebook. They seem to give the same result. The result my depend on whether we are on a full moon day or not.

image

@ehpor
Copy link
Collaborator Author

ehpor commented Oct 19, 2023

Tested on hardware. Fixed one typo.

Setting the spectrum repeatedly now takes ~500us.

image

Copy link
Collaborator

@raphaelpclt raphaelpclt left a comment

Choose a reason for hiding this comment

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

Tested with @ehpor, all good

@ehpor ehpor force-pushed the bugfix/early_return_on_no_move branch from b80a7d2 to 7421ec2 Compare October 19, 2023 15:24
@ehpor ehpor merged commit 013be31 into develop Oct 20, 2023
6 checks passed
@ehpor ehpor deleted the bugfix/early_return_on_no_move branch October 20, 2023 17:36
@ehpor ehpor mentioned this pull request Oct 20, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixing of a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NKT VARIA still sleeps on repeated calls to set_spectrum() with the same parameters.
2 participants