Skip to content

Commit

Permalink
Validate laser 488 or 633 line
Browse files Browse the repository at this point in the history
  • Loading branch information
bjhardcastle committed May 21, 2024
1 parent 03eafd1 commit ac17ed9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/npc_sync/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,16 @@ def validate(
if licks:
lines.append("lick_sensor")
if opto:
lines.append(self.get_line_for_stim_onset("opto"))
if self.start_time.date() >= FIRST_GALVO_ON_SYNC_DATE:
lines.append(self.get_line_for_stim_onset("galvo"))
has_laser_633_and_galvo = self.start_time.date() >= FIRST_GALVO_ON_SYNC_DATE
try:
self._check_line(a := self.get_line_for_stim_onset("laser_488"))
except AssertionError:
if has_laser_633_and_galvo:
self._check_line(b := self.get_line_for_stim_onset("laser_633"))
else:
raise AssertionError(f"Sync file has no events on opto lines {a = } or {b = }") from None
if has_laser_633_and_galvo:
self._check_line(self.get_line_for_stim_onset("galvo"))
if audio and self.start_time.date() >= FIRST_SOUND_ON_SYNC_DATE:
lines.append(self.get_line_for_stim_onset("audio"))

Expand Down

0 comments on commit ac17ed9

Please sign in to comment.