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

Tracking error fixes #549

Merged
merged 8 commits into from
Aug 19, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions pocs/observatory.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,23 +342,49 @@ def update_tracking(self):
if self.current_offset_info is not None:
self.logger.debug("Updating the tracking")

# Get the pier side of pointing image
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add some more comments? I'm certainly ignorant about what is happening here, and the lack of problem description in the PR isn't helping.

pointing_ha = self.current_observation.pointing_image.header_ha

try:
pointing_ha = pointing_ha.value
except AttributeError:
pass

self.logger.debug("Pointing HA: {}".format(pointing_ha))

pier_side = 'east'
if pointing_ha <= 12:
pier_side = 'west'

self.logger.debug("Mount pier side: {}".format(pier_side))

# find the number of ms and direction for Dec axis
dec_offset = self.current_offset_info.delta_dec
dec_ms = self.mount.get_ms_offset(dec_offset, axis='dec')
if dec_offset >= 0:
dec_direction = 'north'
else:
dec_direction = 'south'

# find the number of ms and direction for RA axis
ra_offset = self.current_offset_info.delta_ra
ra_ms = self.mount.get_ms_offset(ra_offset, axis='ra')

# Determine which direction to move based on direction mount
# is moving (i.e. what side it started on).
if pier_side == 'east':
if dec_offset >= 0:
dec_direction = 'north'
else:
dec_direction = 'south'
else:
if dec_offset >= 0:
dec_direction = 'south'
else:
dec_direction = 'north'

if ra_offset >= 0:
ra_direction = 'west'
else:
ra_direction = 'east'

dec_ms = abs(dec_ms.value) * 1.5 # TODO(wtgee): Figure out why 1.5
dec_ms = abs(dec_ms.value) * 1.
ra_ms = abs(ra_ms.value) * 1.

# Ensure we don't try to move for too long
Expand Down