Skip to content

Commit

Permalink
Add group_id to obs_metadata. Add group pairer to pipeline when runni…
Browse files Browse the repository at this point in the history
…ng science sensors.
  • Loading branch information
jbkalmbach committed Aug 8, 2024
1 parent a97c479 commit e954d2e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python/lsst/ts/imsim/closed_loop_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ def _run_sim(

# Generate the sky images and calculate the wavefront error
if cam_type == CamType.LsstCam:
obs_metadata.group_id = str(obs_metadata.seq_num)
self._generate_images(
obs_metadata,
cam_type=cam_type,
Expand All @@ -466,6 +467,7 @@ def _run_sim(
imsim_log_file=imsim_log_file,
)
elif cam_type in [CamType.LsstFamCam, CamType.ComCam]:
obs_metadata.group_id = str(obs_metadata.seq_num)
for focus_z in [-1.5, 1.5]:
obs_metadata.seq_num += 1
obs_metadata.focus_z = focus_z
Expand Down Expand Up @@ -951,8 +953,14 @@ def write_wep_configuration(
if cam_type in [CamType.LsstCam, CamType.LsstFamCam]:
if cam_type == CamType.LsstCam:
cut_out_task = "Cwfs"
cut_out_config = ""
else:
cut_out_task = "ScienceSensor"
cut_out_config = """config:
python: |
from lsst.ts.wep.task.pairTask import GroupPairer
config.pairer.retarget(GroupPairer)
"""
elif cam_type in [CamType.ComCam]:
cut_out_task = "ScienceSensor"

Expand Down Expand Up @@ -991,8 +999,11 @@ def write_wep_configuration(
python: OverscanCorrectionTask.ConfigClass.fitType = 'MEDIAN'
generateDonutCatalogWcsTask:
class: lsst.ts.wep.task.generateDonutCatalogWcsTask.GenerateDonutCatalogWcsTask
config:
maxRecenterDistance: 50
cutOutDonuts{cut_out_task}Task:
class: lsst.ts.wep.task.cutOutDonuts{cut_out_task}Task.CutOutDonuts{cut_out_task}Task
{cut_out_config}
calcZernikesTask:
class: lsst.ts.wep.task.calcZernikesTask.CalcZernikesTask
config:
Expand Down
1 change: 1 addition & 0 deletions python/lsst/ts/imsim/imsim_cmpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ def add_config_header(self, obs_metadata: ObsMetadata) -> str:
)
header_text += f" focusZ: {obs_metadata.focus_z}\n"
header_text += f" seeing: {obs_metadata.raw_seeing}\n"
header_text += f" group: {obs_metadata.group_id}"

return header_text

Expand Down
1 change: 1 addition & 0 deletions python/lsst/ts/imsim/obs_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class ObsMetadata:
parallactic_angle: float = field(init=False)
alt: float = field(init=False)
az: float = field(init=False)
group_id: str = "1"

def __post_init__(self) -> None:
"""Populate the zenith and parallactic angles
Expand Down
1 change: 1 addition & 0 deletions tests/test_obs_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def test_obs_metadata(self):
self.assertEqual(self.obs_meta_test.focus_z, 0.0)
self.assertAlmostEqual(self.obs_meta_test.zenith, 51.63121964610822)
self.assertAlmostEqual(self.obs_meta_test.parallactic_angle, -130.1781932025212)
self.assertEqual(self.obs_meta_test.group_id, '1')

def test_calc_parallactic_angle(self):
sirius = FixedTarget.from_name("sirius")
Expand Down

0 comments on commit e954d2e

Please sign in to comment.