Coverage for python/lsst/analysis/tools/atools/deltaSkyCorr.py: 28%
29 statements
« prev ^ index » next coverage.py v7.4.4, created at 2024-04-04 04:14 -0700
« prev ^ index » next coverage.py v7.4.4, created at 2024-04-04 04:14 -0700
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/>.
22__all__ = ("DeltaSkyCorrXYPlot",)
24from ..actions.plot.xyPlot import XYPlot
25from ..actions.scalar.scalarActions import IqrHistAction, MedianHistAction
26from ..actions.vector import ConstantValue, LoadVector
27from ..interfaces import AnalysisTool
30class DeltaSkyCorrXYPlot(AnalysisTool):
31 parameterizedBand: bool = False
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)
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"
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 }
59 self.produce.metric.units = {
60 "median": "nJy",
61 "iqr": "nJy",
62 }
64 self.produce.metric.newNames = {
65 "median": "delta_skyCorr_median",
66 "iqr": "delta_skyCorr_iqr",
67 }