Skip to content

Commit

Permalink
Fix flake 8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophie Reed authored and Sophie Reed committed Apr 20, 2023
1 parent ab00e22 commit bccd06c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
12 changes: 8 additions & 4 deletions python/lsst/analysis/tools/actions/plot/colorColorFitPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def makePlot(
The data to plot the points from, for more information
please see the notes section.
plotInfo : `dict`
A dictionary of information about the data being plotted with keys:
A dictionary of information about the data being plotted
with keys:
* ``"run"``
The output run for the plots (`str`).
Expand Down Expand Up @@ -188,9 +189,11 @@ def makePlot(
The gradient of the line perpendicular to the line from
the second ODR fit.
* ``"bPerpMin"``
The intercept of the perpendicular line that goes through xMin.
The intercept of the perpendicular line that goes through
xMin.
* ``"bPerpMax"``
The intercept of the perpendicular line that goes through xMax.
The intercept of the perpendicular line that goes through
xMax.
* The main inputs to plot:
x, y, mag
Expand All @@ -202,7 +205,8 @@ def makePlot(
.. image:: /_static/analysis_tools/stellarLocusExample.png
For a detailed example of how to make a plot from the command line
please see the :ref:`getting started guide<analysis-tools-getting-started>`.
please see the
:ref:`getting started guide<analysis-tools-getting-started>`.
"""

# Define a new colormap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ def makePlot(
.. image:: /_static/analysis_tools/scatterPlotExample.png
For a detailed example of how to make a plot from the command line
please see the :ref:`getting started guide<analysis-tools-getting-started>`.
please see the
:ref:`getting started guide<analysis-tools-getting-started>`.
"""
if not self.plotTypes:
noDataFig = Figure()
Expand Down
28 changes: 19 additions & 9 deletions python/lsst/analysis/tools/actions/vector/ellipticity.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,24 @@


class CalcE(VectorAction):
"""Calculate a complex value representation of the ellipticity.
r"""Calculate a complex value representation of the ellipticity.
The complex ellipticity is typically defined as
:math:`e = |e|\exp{(j*2*theta)} = \\frac{((Ixx - Iyy) + j*(2*Ixy))}{(Ixx + Iyy)}`, where j is
the square root of -1 and Ixx, Iyy, Ixy are second-order central moments.
This is sometimes referred to as distortion, and denoted by e = (e1, e2)
in GalSim (see Eq. 4.4. of Bartelmann and Schneider, 2001).
.. math::
e = |e|\exp{(j*2*theta)}
e = \\frac{((Ixx - Iyy) + j*(2*Ixy))}{(Ixx + Iyy)},
where j is the square root of -1 and Ixx, Iyy, Ixy are second-order
central moments. This is sometimes referred to as distortion, and denoted
by e = (e1, e2) in GalSim (see Eq. 4.4. of Bartelmann and Schneider, 2001).
The other definition differs in normalization.
It is referred to as shear, and denoted by g = (g1, g2)
in GalSim (see Eq. 4.10 of Bartelmann and Schneider (2001). It is defined
as :math:`g = \\frac{((Ixx - Iyy) + j*(2*Ixy))}{(Ixx + Iyy + 2\sqrt{(Ixx*Iyy - Ixy^{2})})}`.
as
.. math::
g = \\frac{((Ixx-Iyy)+j*(2*Ixy))}{(Ixx+Iyy+2\sqrt{(Ixx*Iyy-Ixy^{2})})}.
The shear measure is unbiased in weak-lensing shear, but may exclude some
objects in the presence of noisy moment estimates. The distortion measure
Expand Down Expand Up @@ -145,7 +152,7 @@ def __call__(self, data: KeyedData, **kwargs) -> Vector:


class CalcEDiff(VectorAction):
"""Calculate the difference of two ellipticities as a complex quantity.
r"""Calculate the difference of two ellipticities as a complex quantity.
The complex ellipticity difference between e_A and e_B is defined as
:math:`e_{A} - e_{B} = de = |de|\exp{(j*2*theta)}`.
Expand All @@ -160,7 +167,10 @@ class CalcEDiff(VectorAction):
1. This is a shape measurement used for doing QA on the ellipticity
of the sources.
2. For plotting purposes we might want to plot :math:`|de|*\exp{(j*theta)}`.
2. For plotting purposes we might want to plot
.. math:: |de|*\exp{(j*theta)}.
If `halvePhaseAngle` config parameter is set to `True`, then
the returned quantity therefore corresponds to :math:`|e|*\exp{(j*theta)}`.
"""
Expand Down Expand Up @@ -291,7 +301,7 @@ def validate(self):


class CalcE2(VectorAction):
"""Calculate distortion-type :math:`e2 = 2Ixy/(Ixx+Iyy)` or
r"""Calculate distortion-type :math:`e2 = 2Ixy/(Ixx+Iyy)` or
shear-type :math:`g2 = 2Ixy/(Ixx+Iyy+2\sqrt(Ixx*Iyy - Ixy^{2}))`.
See Also
Expand Down

0 comments on commit bccd06c

Please sign in to comment.