Coverage for python / lsst / analysis / tools / atools / wholeTractImageTool.py: 47%

45 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-05-07 08:53 +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__ = ( 

24 "WholeTractImageTool", 

25 "WholeTractClippedMaskTool", 

26 "WholeTractPostageStampTool", 

27 "WholeTractNImageTool", 

28) 

29 

30from ..actions.plot.calculateRange import Linear, MinMax 

31from ..actions.plot.wholeTractImage import WholeTractImage 

32from ..interfaces import AnalysisTool 

33 

34 

35class WholeTractImageTool(AnalysisTool): 

36 """Makes a figure displaying all coadd images covering a whole tract.""" 

37 

38 propagateData = True 

39 parameterizedBand = False 

40 

41 def setDefaults(self): 

42 super().setDefaults() 

43 

44 self.prep.keysToLoad = ["image"] 

45 self.produce.plot = WholeTractImage() 

46 

47 

48class WholeTractClippedMaskTool(AnalysisTool): 

49 """Makes a figure displaying the pixels flagged as CLIPPED for a whole 

50 tract.""" 

51 

52 propagateData = True 

53 parameterizedBand = False 

54 

55 def setDefaults(self): 

56 super().setDefaults() 

57 

58 self.prep.keysToLoad = ["mask"] 

59 self.produce.plot = WholeTractImage() 

60 self.produce.plot.component = "mask" 

61 self.produce.plot.bitmaskPlanes = ["CLIPPED"] 

62 self.produce.plot.interval = MinMax() 

63 self.produce.plot.stretch = Linear() 

64 

65 

66class WholeTractPostageStampTool(AnalysisTool): 

67 """Makes a postage-stamp figure displaying all coadd images covering a 

68 whole tract.""" 

69 

70 propagateData = True 

71 parameterizedBand = False 

72 

73 def setDefaults(self): 

74 super().setDefaults() 

75 

76 self.prep.keysToLoad = ["image"] 

77 self.produce.plot = WholeTractImage() 

78 self.produce.plot.displayAsPostageStamp = True 

79 

80 

81class WholeTractNImageTool(AnalysisTool): 

82 

83 propagateData = True 

84 parameterizedBand = False 

85 

86 def setDefaults(self): 

87 super().setDefaults() 

88 

89 self.produce.plot = WholeTractImage() 

90 self.produce.plot.interval = MinMax 

91 self.produce.plot.stretch = Linear() 

92 self.produce.plot.showColorbar = True 

93 self.produce.plot.zAxisLabel = "Number of input images" 

94 self.produce.plot.colorbarCmap = "viridis" 

95 self.produce.plot.noDataColor = "white" 

96 self.produce.plot.noDataValue = 0 

97 self.produce.plot.vmaxFloor = 10