|
29 | 29 | import matplotlib.pyplot as plt |
30 | 30 | import numpy as np |
31 | 31 | from lsst.pex.config import Field, ListField |
| 32 | +from lsst.skymap import BaseSkyMap |
32 | 33 | from matplotlib.figure import Figure |
33 | 34 | from matplotlib.patches import Rectangle |
34 | 35 |
|
35 | 36 | from ...interfaces import KeyedData, KeyedDataSchema, PlotAction, Scalar, Vector |
36 | 37 | from ...statistics import nansigmaMad |
37 | | -from .plotUtils import addPlotInfo, mkColormap, plotProjectionWithBinning, sortAllArrays |
| 38 | +from .plotUtils import addPlotInfo, generateSummaryStats, mkColormap, plotProjectionWithBinning, sortAllArrays |
38 | 39 |
|
39 | 40 |
|
40 | 41 | class SkyPlot(PlotAction): |
@@ -92,6 +93,9 @@ def getInputSchema(self, **kwargs) -> KeyedDataSchema: |
92 | 93 | base.append(("z", Vector)) |
93 | 94 | base.append(("statMask", Vector)) |
94 | 95 |
|
| 96 | + if self.plotOutlines: |
| 97 | + base.append(("patch", Vector)) |
| 98 | + |
95 | 99 | return base |
96 | 100 |
|
97 | 101 | def __call__(self, data: KeyedData, **kwargs) -> Mapping[str, Figure] | Figure: |
@@ -136,6 +140,7 @@ def statsAndText(self, arr, mask=None): |
136 | 140 | def makePlot( |
137 | 141 | self, |
138 | 142 | data: KeyedData, |
| 143 | + skymap: BaseSkyMap, |
139 | 144 | plotInfo: Optional[Mapping[str, str]] = None, |
140 | 145 | sumStats: Optional[Mapping] = None, |
141 | 146 | **kwargs, |
@@ -204,8 +209,8 @@ def makePlot( |
204 | 209 | fig = plt.figure(dpi=300) |
205 | 210 | ax = fig.add_subplot(111) |
206 | 211 |
|
207 | | - if sumStats is None: |
208 | | - sumStats = {} |
| 212 | + if self.plotOutlines: |
| 213 | + sumStats = generateSummaryStats(data, skymap, plotInfo) |
209 | 214 |
|
210 | 215 | if plotInfo is None: |
211 | 216 | plotInfo = {} |
|
0 commit comments