-
Notifications
You must be signed in to change notification settings - Fork 50
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
Observation current_exp change #668
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
41c8544
Observation current_exp change
wtgee 79d2dd4
Merge branch 'develop' of https://github.com/panoptes/POCS into curre…
wtgee 6bce61b
Merge branch 'develop' of https://github.com/panoptes/POCS into curre…
wtgee 599b985
Merge branch 'develop' of https://github.com/panoptes/POCS into curre…
wtgee 54d1c3f
Merge branch 'develop' of https://github.com/panoptes/POCS into curre…
wtgee 458e8e6
Some work on the filename for camera simulator
wtgee f88c941
Merge branch 'develop' of https://github.com/panoptes/POCS into curre…
wtgee e435071
Merge branch 'develop' of https://github.com/panoptes/POCS into curre…
wtgee 1eefb5c
Merge branch 'develop' of https://github.com/panoptes/POCS into curre…
wtgee a8f1a8b
Adding a small addition to dome test to try and force coverage
wtgee cf0844d
Merge branch 'develop' of https://github.com/panoptes/POCS into curre…
wtgee a8ce53c
Fixing change from merge
wtgee a500ee5
Fixing directory test after #680 (not sure why failing here)
wtgee 8f69364
Add primary image identifier to camera string
wtgee 8f8f2d2
Remov
wtgee b7abb8f
Add a random number of seconds to a set POCSTIME
wtgee 87a8ff1
Add some random seconds to the POCSTIME. Helps with many filename issues
wtgee 2179bf3
Changing moon values for this test. Not sure why needed
wtgee ab0d6c4
Merge branch 'develop' of https://github.com/panoptes/POCS into curre…
wtgee 90296ac
Remove random seconds from current_time
wtgee 9b723d6
Skip exception for coverage
wtgee ac47678
Merge branch 'develop' of https://github.com/panoptes/POCS into curre…
wtgee 30fb42d
Reset observation at start so always in sync
wtgee 79ae630
Deal with pointing images in a smarter fashion
wtgee 620f10b
Don't try to assign pointing image.
wtgee e2f0e61
Store solved image object for pointing
wtgee 6bb3e8b
Properly get the pointing image
wtgee 9cb3da2
Test for lack of pointing image
wtgee cba763d
Properly fetch the pointing image
wtgee 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
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 |
---|---|---|
|
@@ -56,25 +56,24 @@ def __init__(self, field, exp_time=120 * u.second, min_nexp=60, | |
|
||
self.field = field | ||
|
||
self.current_exp = 0 | ||
|
||
self.exp_time = exp_time | ||
self.min_nexp = min_nexp | ||
self.exp_set_size = exp_set_size | ||
self.exposure_list = OrderedDict() | ||
self.pointing_images = OrderedDict() | ||
|
||
self.priority = float(priority) | ||
|
||
self._min_duration = self.exp_time * self.min_nexp | ||
self._set_duration = self.exp_time * self.exp_set_size | ||
|
||
self.pointing_image = None | ||
|
||
self._image_dir = self.config['directories']['images'] | ||
self._seq_time = None | ||
|
||
self.merit = 0.0 | ||
|
||
self.reset() | ||
|
||
self.logger.debug("Observation created: {}".format(self)) | ||
|
||
|
||
|
@@ -127,6 +126,15 @@ def directory(self): | |
self.field.field_name) | ||
return self._directory | ||
|
||
@property | ||
def current_exp_num(self): | ||
""" Return the current number of exposures. | ||
wtgee marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Returns: | ||
int: The size of `self.exposure_list`. | ||
""" | ||
return len(self.exposure_list) | ||
|
||
@property | ||
def first_exposure(self): | ||
""" Return the latest exposure information | ||
|
@@ -151,16 +159,29 @@ def last_exposure(self): | |
except IndexError: | ||
self.logger.warning("No exposure available") | ||
|
||
@property | ||
def pointing_image(self): | ||
"""Return the last pointing image. | ||
|
||
Returns: | ||
tuple: `image_id` and full path of most recent pointing image from | ||
the primary camera. | ||
""" | ||
try: | ||
return list(self.pointing_images.items())[-1] | ||
except IndexError: | ||
self.logger.warning("No pointing image available") | ||
|
||
|
||
################################################################################################## | ||
# Methods | ||
################################################################################################## | ||
|
||
def reset(self): | ||
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. It would be great if this method were called by |
||
"""Resets the exposure values for the observation """ | ||
"""Resets the exposure information for the observation """ | ||
self.logger.debug("Resetting observation {}".format(self)) | ||
|
||
self.current_exp = 0 | ||
self.exposure_list = OrderedDict() | ||
self.merit = 0.0 | ||
self.seq_time = None | ||
|
||
|
@@ -179,7 +200,7 @@ def status(self): | |
equinox = 'J2000' | ||
|
||
status = { | ||
'current_exp': self.current_exp, | ||
'current_exp': self.current_exp_num, | ||
'dec_mnt': self.field.coord.dec.value, | ||
'equinox': equinox, | ||
'exp_set_size': self.exp_set_size, | ||
|
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
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
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
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.
What if we're currently taking another exposure? Is that counted or 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.
This value will go up inside the
camera.take_observation
method but before the call totake_exposure
. So yes, the current_exp_num will reflect an image in the process of being taken.