Coverage for python / lsst / analysis / tools / atools / wholeSkyPlotTool.py: 48%

23 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-22 09:08 +0000

1# This file is part of analysis_tools. 

2# 

3# Developed for the LSST Data Management System. 

4# This product includes software developed by the LSST Project 

5# (https://www.lsst.org). 

6# See the COPYRIGHT file at the top-level directory of this distribution 

7# for details of code ownership. 

8# 

9# This program is free software: you can redistribute it and/or modify 

10# it under the terms of the GNU General Public License as published by 

11# the Free Software Foundation, either version 3 of the License, or 

12# (at your option) any later version. 

13# 

14# This program is distributed in the hope that it will be useful, 

15# but WITHOUT ANY WARRANTY; without even the implied warranty of 

16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

17# GNU General Public License for more details. 

18# 

19# You should have received a copy of the GNU General Public License 

20# along with this program. If not, see <https://www.gnu.org/licenses/>. 

21from __future__ import annotations 

22 

23__all__ = ("WholeSkyPlotTool",) 

24 

25 

26from lsst.pex.config import Field 

27 

28from ..actions.keyedData import KeyedDataUnitAccessAction 

29from ..actions.plot.wholeSkyPlot import WholeSkyPlot 

30from ..actions.vector import LoadVector 

31from ..interfaces import AnalysisTool 

32 

33 

34class WholeSkyPlotTool(AnalysisTool): 

35 """ 

36 WholeSkyPlot of per-tract metric values. 

37 

38 x and y axes are Right Ascension and Declination, respectively. 

39 The z-axis colorbar indicates the metric value. 

40 """ 

41 

42 parameterizedBand = Field[bool]( 

43 doc="Does this AnalysisTool support band as a name parameter?", default=True 

44 ) 

45 

46 metric = Field[str]( 

47 doc="The name of the metric to plot.", 

48 default="e1Diff_{band}_highSNStars_median", 

49 ) 

50 

51 def setDefaults(self): 

52 super().setDefaults() 

53 

54 self.process.buildActions.tract = LoadVector() 

55 self.process.buildActions.tract.vectorKey = "tract" 

56 self.produce.plot = WholeSkyPlot() 

57 

58 def finalize(self): 

59 self.process.buildActions.z = LoadVector(vectorKey=self.metric) 

60 self.process.buildActions.zUnit = KeyedDataUnitAccessAction(key=self.metric) 

61 self.produce.plot.zAxisLabel = self.metric 

62 sequentialMetrics = ["count", "ean", "edian", "num", "igma", "tdev", "Repeat"] 

63 if any(sequentialMetric in self.metric for sequentialMetric in sequentialMetrics): 

64 self.produce.plot.colorMapType = "sequential" 

65 super().finalize()