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

build_op: rewrap az when outside specified limits #97

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
12 changes: 12 additions & 0 deletions src/schedlib/policies/stages/build_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,18 @@ def get_safe_gaps(block0, block1):
az=block1.az, alt=block1.alt),
]

# go through the sequence and wrap az if falls outside limits
seq_ = []
for b in seq:
if b.az < self.az_limits[0] or b.az > self.az_limits[1]:
logger.info(f"block az ({b.az}) outside limits, unwrapping...")
az_unwrap = find_unwrap(b.az, az_limits=self.az_limits)[0]
logger.info(f"-> unwrapping az: {b.az} -> {az_unwrap}")
seq_ += [b.replace(az=az_unwrap)]
else:
seq_ += [b]
seq = seq_

seq_ = [seq[0]]
for i in range(1, len(seq)):
gaps = get_safe_gaps(seq[i-1], seq[i])
Expand Down