Skip to content

Commit

Permalink
Add additional checks before exposure begins
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jul 18, 2023
1 parent 97ba07d commit 8fe9dcc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/gort/devices/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,21 @@ async def expose(
"""

# Check that all specs are idle and not errored.
status = await self.spec_set.status(simple=True)
for spec_status in status.values():
if "IDLE" not in spec_status["status_names"]:
raise GortSpecError(
"Some spectrographs are not IDLE.",
error_code=ErrorCodes.SECTROGRAPH_NOT_IDLE,
)
if "ERROR" in spec_status["status_names"]:
raise GortSpecError(
"Some spectrographs have ERROR status. "
"Solve this manually before exposing.",
error_code=ErrorCodes.SECTROGRAPH_NOT_IDLE,
)

if show_progress:
await self.start_timer(exposure_time or 0.0)

Expand Down

0 comments on commit 8fe9dcc

Please sign in to comment.