Skip to content

Commit

Permalink
Clarify that HPQ controllers means "is simulated"
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed May 27, 2022
1 parent 478b27b commit 0e607ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions python/lsst/obs/lsst/translators/lsst.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,5 +857,13 @@ def to_has_simulated_content(self):
if "SIMULATE" in k and v:
return True

# If the controller is H, P, or Q then the data are simulated.
ctrlr_key = "CONTRLLR"
if self.is_key_ok(ctrlr_key):
controller = self._header[ctrlr_key]
self._used_these_cards(ctrlr_key)
if controller in "HPQ":
return True

# No simulation flags set.
return False
4 changes: 2 additions & 2 deletions tests/test_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def test_phoSimLsstCam_translator(self):
exposure_time=15.0*u.s,
group_counter_end=32,
group_counter_start=32,
has_simulated_content=False, # Missing SIMULATE header.
has_simulated_content=True,
object="UNKNOWN",
observation_counter=32,
observation_id="MC_H_20000217_000032",
Expand Down Expand Up @@ -269,7 +269,7 @@ def test_phoSimComCam_translator(self):
exposure_time=1.0*u.s,
group_counter_end=6001,
group_counter_start=6001,
has_simulated_content=False, # Should be True but the SIMULATE header is missing.
has_simulated_content=True,
object="UNKNOWN",
observation_counter=6001,
observation_id="CC_H_20000217_006001",
Expand Down

0 comments on commit 0e607ea

Please sign in to comment.