Coverage for python/lsst/analysis/tools/atools/deltaSkyCorr.py: 28%

29 statements  

« prev     ^ index     » next       coverage.py v7.5.1, created at 2024-05-10 11:03 +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/>. 

21 

22__all__ = ("DeltaSkyCorrXYPlot",) 

23 

24from ..actions.plot.xyPlot import XYPlot 

25from ..actions.scalar.scalarActions import IqrHistAction, MedianHistAction 

26from ..actions.vector import ConstantValue, LoadVector 

27from ..interfaces import AnalysisTool 

28 

29 

30class DeltaSkyCorrXYPlot(AnalysisTool): 

31 parameterizedBand: bool = False 

32 

33 def setDefaults(self): 

34 super().setDefaults() 

35 self.process.buildActions.x = LoadVector() 

36 self.process.buildActions.y = LoadVector() 

37 self.process.buildActions.x.vectorKey = "bin_mid" 

38 self.process.buildActions.y.vectorKey = "hist" 

39 self.process.buildActions.xerr = ConstantValue(value=0) 

40 self.process.buildActions.yerr = ConstantValue(value=0) 

41 

42 self.process.calculateActions.median = MedianHistAction() 

43 self.process.calculateActions.median.histKey = "hist" 

44 self.process.calculateActions.median.midKey = "bin_mid" 

45 self.process.calculateActions.iqr = IqrHistAction() 

46 self.process.calculateActions.iqr.histKey = "hist" 

47 self.process.calculateActions.iqr.midKey = "bin_mid" 

48 

49 self.produce.plot = XYPlot() 

50 self.produce.plot.xAxisLabel = r"$\Delta$skyCorr Flux (nJy)" 

51 self.produce.plot.yAxisLabel = "Frequency" 

52 self.produce.plot.yScale = "log" 

53 self.produce.plot.xLine = 0 

54 self.produce.plot.strKwargs = { 

55 "fmt": "-", 

56 "color": "b", 

57 } 

58 

59 self.produce.metric.units = { 

60 "median": "nJy", 

61 "iqr": "nJy", 

62 } 

63 

64 self.produce.metric.newNames = { 

65 "median": "delta_skyCorr_median", 

66 "iqr": "delta_skyCorr_iqr", 

67 }