Skip to content

Commit

Permalink
Merge pull request #40 from lsst-sitcom/tickets/DM-43319
Browse files Browse the repository at this point in the history
DM-43319: Fix warnings
  • Loading branch information
mfisherlevine committed May 16, 2024
2 parents f383b3c + e9399ed commit 65ed0d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions python/lsst/summit/extras/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
from lsst.atmospec.utils import airMassFromRawMetadata, getTargetCentroidFromWcs
from lsst.pipe.tasks.quickFrameMeasurement import QuickFrameMeasurementTask, QuickFrameMeasurementTaskConfig
from lsst.summit.utils.butlerUtils import (
datasetExists,
getDayObs,
getExpRecordFromDataId,
getLatissOnSkyDataIds,
Expand Down Expand Up @@ -177,9 +176,7 @@ def preRun(self) -> None:

# check the datasets exist for the pngs which need remaking
missingData = [
d
for d in dIdsWithoutPngs
if not datasetExists(self.butler, self.dataProductToPlot, d, detector=0)
d for d in dIdsWithoutPngs if not self.butler.exists(self.dataProductToPlot, d, detector=0)
]

logger.info(f"Of the provided {len(self.dataIdList)} dataIds:")
Expand Down
4 changes: 1 addition & 3 deletions python/lsst/summit/extras/focusAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def getFocusData(self, dayObs: int, seqNums: list[int], doDisplay: bool = False)
arrowy, arrowx = centroid[0] - 400, centroid[1] # numpy is backwards
dx, dy = 0, 300
arrow = Arrow(arrowy, arrowx, dy, dx, width=200.0, color="red")
circle = Circle(centroid, radius=25, facecolor="none", color="red")
circle = Circle(centroid, radius=25, facecolor="none", edgecolor="red")
axes[0].add_patch(arrow)
axes[0].add_patch(circle)
for i, bbox in enumerate(spectrumSliceBboxes):
Expand Down Expand Up @@ -376,7 +376,6 @@ def fitDataAndPlot(self, hideFit: bool = False, hexapodZeroPoint: float = 0) ->
axes[0].legend(pointsForLegend, legendText, fontsize=legendFontSize)
axes[1].legend(pointsForLegend, legendText, fontsize=legendFontSize)
f.tight_layout(rect=(0, 0.03, 1, 0.95))
plt.show()

for i, bestFit in enumerate(bestFits):
print(f"Best fit for spectrum slice {i} = {bestFit:.4f}mm")
Expand Down Expand Up @@ -633,7 +632,6 @@ def fitDataAndPlot(self) -> dict:
ax1.legend()

plt.subplots_adjust(hspace=0.0)
plt.show()

results = {
"fwhmFitMin": fwhmFitMin,
Expand Down
2 changes: 2 additions & 0 deletions tests/test_focusAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

mpl.use("Agg")


import lsst.summit.utils.butlerUtils as butlerUtils # noqa: E402
from lsst.summit.extras import NonSpectralFocusAnalyzer, SpectralFocusAnalyzer # noqa: E402

Expand All @@ -54,6 +55,7 @@ def setUpClass(cls):
def test_run(self):
# we don't check the plots, but set doDisplay to True to check the
# plots are generated without error

self.focusAnalyzer.getFocusData(self.dayObs, self.seqNums, doDisplay=True)
result = self.focusAnalyzer.fitDataAndPlot()
self.assertIsInstance(result, Iterable)
Expand Down

0 comments on commit 65ed0d9

Please sign in to comment.