Skip to content

Fix sleep when no change in spectrum is requested#126

Merged
ehpor merged 3 commits into
developfrom
bugfix/early_return_on_no_move
Oct 20, 2023
Merged

Fix sleep when no change in spectrum is requested#126
ehpor merged 3 commits into
developfrom
bugfix/early_return_on_no_move

Conversation

@ehpor

@ehpor ehpor commented Oct 17, 2023

Copy link
Copy Markdown
Collaborator

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

ehpor commented Oct 18, 2023

Copy link
Copy Markdown
Collaborator Author

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

@ehpor ehpor requested a review from steigersg October 18, 2023 00:00
@ehpor

ehpor commented Oct 18, 2023

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
Collaborator

New test with IPython
image

Almost a factor of 2, but still a lot

@raphaelpclt

Copy link
Copy Markdown
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

ehpor commented Oct 19, 2023

Copy link
Copy Markdown
Collaborator Author

Tested on hardware. Fixed one typo.

Setting the spectrum repeatedly now takes ~500us.

image

@raphaelpclt raphaelpclt left a comment

Copy link
Copy Markdown
Collaborator

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
@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