Source code for panoptes.pocs.state.states.default.observing
from panoptes.utils import error
[docs]
def on_enter(event_data):
"""Take an observation image.
This state is responsible for taking the actual observation image.
"""
pocs = event_data.model
current_obs = pocs.observatory.current_observation
pocs.say(f"ðŸ”🔠I'm observing {current_obs.field.field_name}! ðŸ”ðŸ”")
pocs.next_state = 'parking'
try:
pocs.observe_target()
except (error.Timeout, error.CameraNotFound):
pocs.logger.warning("Timeout waiting for images. Something wrong with cameras, parking.")
except Exception as e:
pocs.logger.warning(f"Problem with imaging: {e!r}")
pocs.say("Hmm, I'm not sure what happened with that exposure.")
else:
pocs.next_state = 'analyzing'
pocs.logger.debug('Finished with observing, going to {pocs.next_state}')