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

Tickets/DM-48567: add S11 mode to FAM #22

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions doc/versionHistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
##################
Version History
##################
.._lsst.ts.donut.viz-1.4.0

-------------
1.4.0
-------------

* Add S11-only mode for LsstCam Full Array Mode

.._lsst.ts.donut.viz-1.3.0

Expand Down
32 changes: 22 additions & 10 deletions python/lsst/donut/viz/plot_aos_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ class PlotDonutTaskConfig(
doc="Upload to RubinTV",
default=False,
)
doS11only = pexConfig.Field(
dtype=bool, doc="Use only S11 in FAM mode", default=False
)


class PlotDonutTask(pipeBase.PipelineTask):
Expand Down Expand Up @@ -309,17 +312,27 @@ def run(
q = donutStampsExtra.metadata["BORESIGHT_PAR_ANGLE_RAD"]
rotAngle = donutStampsExtra.metadata["BORESIGHT_ROT_ANGLE_RAD"]
rtp = q - rotAngle - np.pi / 2

# Default multiplication factor and offset
factor = 3
offset = 7

match inst:
case "LSSTCam" | "LSSTCamSim":
nacross = 15
fp_size = 0.55 # 55% of horizontal space
if self.config.doS11only:
factor = 1
offset = 3
nacross = 5
case "LSSTComCam" | "LSSTComCamSim":
nacross = 3
fp_size = 0.50 # 50% of horizontal space
case _:
raise ValueError(f"Unknown instrument {inst}")
det_size = fp_size / nacross
fp_center = 0.5, 0.475

fig_dict = dict()

for donutStampSet, visit in zip(
Expand All @@ -330,16 +343,15 @@ def run(
aspect = fig.get_size_inches()[0] / fig.get_size_inches()[1]
for donut in donutStampSet:
det_name = donut.detector_name
# if 'R30' in det_name:
# continue
# if 'S00' in det_name:
# continue
# if 'S01' in det_name:
# continue
i = 3 * int(det_name[1]) + int(det_name[5])
j = 3 * int(det_name[2]) + int(det_name[6])
x = i - 7
y = 7 - j
# For FAM mode, if plotting only S11 corner, do not
# plot anything else
if self.config.doS11only:
if det_name[-2:] != "11":
continue
i = factor * int(det_name[1]) + int(det_name[5])
j = factor * int(det_name[2]) + int(det_name[6])
x = i - offset
y = offset - j
xp = np.cos(rtp) * x + np.sin(rtp) * y
yp = -np.sin(rtp) * x + np.cos(rtp) * y
ax, aux_ax = add_rotated_axis(
Expand Down