Skip to content

Commit

Permalink
Merge pull request #34 from simonsobs/add-missing-source
Browse files Browse the repository at this point in the history
add source sequence in cal_targets by default
  • Loading branch information
guanyilun authored Nov 28, 2023
2 parents 3c247c3 + 456e647 commit 5cb13c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/schedlib/policies/sat.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ def construct_seq(loader_cfg):
raise ValueError(f"unknown sequence type: {loader_cfg['type']}")
blocks = tu.tree_map(construct_seq, self.blocks,
is_leaf=lambda x: isinstance(x, dict) and 'type' in x)
# by default add calibration blocks specified in cal_targets if not already specified
for cal_target in self.cal_targets:
source = cal_target[0]
if source not in blocks['calibration']:
blocks['calibration'][source] = src.source_gen_seq(source, t0, t1)
return core.seq_trim(blocks, t0, t1)

def apply(self, blocks: core.BlocksTree) -> core.BlocksTree:
Expand Down Expand Up @@ -235,6 +240,7 @@ def apply(self, blocks: core.BlocksTree) -> core.BlocksTree:
#########
# merge #
#########

seq = None
for query in self.merge_order[::-1]:
match, _ = core.seq_partition_with_query(query, blocks)
Expand Down

0 comments on commit 5cb13c8

Please sign in to comment.