-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add a 'dome' attribute to Observatory. #231
Merged
jamessynge
merged 3 commits into
panoptes:develop
from
jamessynge:issue-199-add-Observatory.dome
Dec 23, 2017
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
from astropy.coordinates import get_sun | ||
|
||
from . import PanBase | ||
import pocs.dome | ||
from .images import Image | ||
from .scheduler.constraint import Duration | ||
from .scheduler.constraint import MoonAvoidance | ||
|
@@ -49,6 +50,10 @@ def __init__(self, *args, **kwargs): | |
self._primary_camera = None | ||
self._create_cameras(**kwargs) | ||
|
||
# TODO(jamessynge): Discuss with Wilfred the serial port validation behavior | ||
# here compared to that for the mount. | ||
self.dome = pocs.dome.create_dome_from_config(self.config, logger=self.logger) | ||
|
||
self.logger.info('\tSetting up scheduler') | ||
self.scheduler = None | ||
self._create_scheduler() | ||
|
@@ -111,6 +116,8 @@ def power_down(self): | |
""" | ||
self.logger.debug("Shutting down observatory") | ||
self.mount.disconnect() | ||
if self.dome: | ||
self.dome.disconnect() | ||
|
||
def status(self): | ||
"""Get status information for various parts of the observatory | ||
|
@@ -128,6 +135,9 @@ def status(self): | |
status['mount']['mount_target_ha'] = self.observer.target_hour_angle( | ||
t, self.mount.get_target_coordinates()) | ||
|
||
if self.dome: | ||
status['dome'] = self.dome.status() | ||
|
||
if self.current_observation: | ||
status['observation'] = self.current_observation.status() | ||
status['observation']['field_ha'] = self.observer.target_hour_angle( | ||
|
@@ -488,6 +498,8 @@ def _create_mount(self, mount_info=None): | |
Note: | ||
This does not actually make a serial connection to the mount. To do so, | ||
call the 'mount.connect()' explicitly. | ||
TODO(jamessynge): Discuss this claim with Wilfred. SerialData automatically | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The claim is wrong as you point out and should be updated. |
||
opens the connection, but doesn't start using it. | ||
|
||
Args: | ||
mount_info (dict): Configuration items for the mount. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This already made it's way in, but this will fail if
dome
is in config butdriver
is not.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps that was intended but if so we should catch and warn.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. This is certainly a fatal error in terms of creating the dome instance, and will most likely keep POCS from working as intended. Probably we should just raise an exception.