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

Separate coarse autofocus from fine autofocus #659

Merged

Conversation

AnthonyHorton
Copy link
Collaborator

@AnthonyHorton AnthonyHorton commented Oct 2, 2018

Change in behaviour for autofocus so that a coarse focus is not automatically followed followed by a fine focus. This is required for the changes planned for AstroHuntsman/huntsman-pocs#69

Also incorporates some improvements to the autofocus tests (checking for created files), and fixes a bug introduced by #621 that prevented the final focus position image being taken when plotting was disabled, which is now the default.

Anthony Horton added 2 commits September 27, 2018 16:40
Remove automatic fine focus from coarse focus
Enhance tests
Fix bug preventing final FIT being kept if no plots
Copy link
Member

@wtgee wtgee left a comment

Choose a reason for hiding this comment

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

👍 A few suggestions but otherwise LGTM

default False
coarse (bool, optional): Whether to perform a coarse focus, otherwise will perform
a fine focus. Default False.
plots (bool, optional: Whether to write focus plots to images folder, default False.
Copy link
Member

Choose a reason for hiding this comment

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

Would prefer to see this called make_plots but we could make a separate issue to change things like that all at once.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK. Yes, there are probably quite a few of these sorts of terminology inconsistencies to be fixed.

if blocking:
fine_event.wait()
focus_event.wait()
Copy link
Member

Choose a reason for hiding this comment

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

Should include some ultimate timeout in the wait

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. Needs to be a rather conservative one though, as it's a bit involved to predict exactly how long it will take.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That might be a job for another PR actually. Want to add timeouts to the camera's threaded operations more generally to prevent the lock ups we sometimes get.

@@ -490,14 +463,13 @@ def _autofocus(self,

final_focus = self.move_to(best_focus)

final_fn = "{}_{}.{}".format(final_focus, "final", self._camera.file_extension)
Copy link
Member

Choose a reason for hiding this comment

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

Should this include the focus_type? I don't seem to see it set anywhere.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's a good idea. It should. I'll put that in.

@codecov
Copy link

codecov bot commented Oct 2, 2018

Codecov Report

Merging #659 into develop will increase coverage by 0.55%.
The diff coverage is 92.3%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #659      +/-   ##
===========================================
+ Coverage    69.99%   70.54%   +0.55%     
===========================================
  Files           64       64              
  Lines         5645     5633      -12     
  Branches       795      793       -2     
===========================================
+ Hits          3951     3974      +23     
+ Misses        1484     1447      -37     
- Partials       210      212       +2
Impacted Files Coverage Δ
pocs/camera/camera.py 92.02% <ø> (ø) ⬆️
pocs/focuser/focuser.py 75.74% <92.3%> (+13.39%) ⬆️
pocs/observatory.py 88.17% <0%> (-0.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a41e39...c0474ed. Read the comment docs.

@AnthonyHorton AnthonyHorton merged commit c2c289f into panoptes:develop Oct 2, 2018
@AnthonyHorton AnthonyHorton deleted the autofocus-improvements branch October 3, 2018 03:54
wtgee added a commit to wtgee/POCS that referenced this pull request Oct 17, 2018
@wtgee wtgee mentioned this pull request Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants