Skip to content

Commit

Permalink
update RISP timing logic and add additional milestones before waiting…
Browse files Browse the repository at this point in the history
… period
  • Loading branch information
RemDelaporteMathurin committed Jan 6, 2025
1 parent 1894a0a commit 395526e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/hisp/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,12 @@ def max_stepsize(self, t: float) -> float:
if pulse.pulse_type == "RISP":
# RISP has a special treatment
time_real_risp_starts = (
89 # (s) relative time at which the real RISP starts
100 # (s) relative time at which the real RISP starts
)
if relative_time < time_real_risp_starts:
if relative_time < time_real_risp_starts - 11:
value = 10 # s
elif relative_time < time_real_risp_starts + 1:
value = 0.01 # s
else:
value = 1 # s
else:
Expand Down Expand Up @@ -198,6 +200,12 @@ def make_milestones(self) -> List[float]:
# start of the next pulse
milestones.append(start_of_pulse + pulse.total_duration * (i + 1))

# add milestones 10 s before the end of the waiting period
assert pulse.total_duration - pulse.duration_no_waiting >= 10
milestones.append(start_of_pulse + pulse.total_duration * (i + 1) - 10)

# add milestones 2 s before the end of the waiting period
milestones.append(start_of_pulse + pulse.total_duration * (i + 1) - 2)
# start of the waiting period of this pulse
milestones.append(
start_of_pulse
Expand Down

0 comments on commit 395526e

Please sign in to comment.