Coverage for python / lsst / analysis / tools / atools / ellipticityMagnitude.py: 45%
22 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-30 09:26 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-30 09:26 +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/>.
22from ..actions.vector import LoadVector
23from ..actions.vector.mathActions import ConstantValue, DivideVector, SubtractVector
24from .actionMagnitudeScatterPlot import ActionMagnitudeScatterPlot
26__all__ = (
27 "EllipticityMagnitudePlotBase",
28 "ExponentialEllipticityMagnitudePlot",
29 "SersicEllipticityMagnitudePlot",
30)
33class EllipticityMagnitudePlotBase(ActionMagnitudeScatterPlot):
34 def setDefaults(self):
35 super().setDefaults()
36 self.produce.plot.yLims = (0.0, 1.0)
37 self.produce.plot.legendLocation = "upper right"
40class ExponentialEllipticityMagnitudePlot(EllipticityMagnitudePlotBase):
41 def setDefaults(self):
42 super().setDefaults()
43 self.action_vector = SubtractVector(
44 actionA=ConstantValue(value=1),
45 actionB=DivideVector(
46 actionA=LoadVector(vectorKey="exponential_reff_minor"),
47 actionB=LoadVector(vectorKey="exponential_reff_major"),
48 ),
49 )
50 self.key_y = "axrat_exponential"
51 self.produce.plot.yAxisLabel = "Exponential ellipticity"
54class SersicEllipticityMagnitudePlot(EllipticityMagnitudePlotBase):
55 def setDefaults(self):
56 super().setDefaults()
57 self.action_vector = SubtractVector(
58 actionA=ConstantValue(value=1),
59 actionB=DivideVector(
60 actionA=LoadVector(vectorKey="sersic_reff_minor"),
61 actionB=LoadVector(vectorKey="sersic_reff_major"),
62 ),
63 )
64 self.key_y = "axrat_sersic"
65 self.produce.plot.yAxisLabel = "Sérsic ellipticity"
66 self.produce.plot.yLims = (0.0, 1.0)