Skip to content

Commit

Permalink
Fix formatting 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 085811e commit ca6e2a1
Show file tree
Hide file tree
Showing 9 changed files with 165 additions and 150 deletions.
4 changes: 2 additions & 2 deletions doc/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ modules:
# Name of the static content directories (subdirectories of `_static`).
# Static content directories are usually named after the package.
# Most packages do not need a static content directory (leave commented out).
statics:
- "_static/analysis_tools"
statics:
- "_static/analysis_tools"
2 changes: 1 addition & 1 deletion python/lsst/analysis/tools/actions/plot/barPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class BarPanel(Config):


class BarPlot(PlotAction):
"""A plotting tool which can take multiple keyed data inputs
"""A plotting tool which can take multiple keyed data inputs
and can create one or more bar graphs.
"""

Expand Down
190 changes: 97 additions & 93 deletions python/lsst/analysis/tools/actions/plot/colorColorFitPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@


class ColorColorFitPlot(PlotAction):
"""Makes a color-color plot and overplots a
"""Makes a color-color plot and overplots a
prefited line to the specified area of the plot.
This is mostly used for the stellar locus plots
and also includes panels that illustrate the
This is mostly used for the stellar locus plots
and also includes panels that illustrate the
goodness of the given fit.
"""

Expand Down Expand Up @@ -113,96 +113,100 @@ def makePlot(
) -> Figure:
"""Make stellar locus plots using pre fitted values.
Parameters
----------
data : `KeyedData`
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:
* ``"run"``
The output run for the plots (`str`).
* ``"skymap"``
The type of skymap used for the data (`str`).
* ``"filter"``
The filter used for this data (`str`).
* ``"tract"``
The tract that the data comes from (`str`).
Returns
-------
fig : `matplotlib.figure.Figure`
The resulting figure.
Notes
-----
The axis labels are given by `self.config.xLabel` and
`self.config.yLabel`. The perpendicular distance of the points to
the fit line is given in a histogram in the second panel.
For the code to work it expects various quantities to be
present in the 'data' that it is given.
The quantities that are expected to be present are:
* Statistics that are shown on the plot or used by the plotting code:
* ``approxMagDepth``
The approximate magnitude corresponding to the SN cut used.
* ``f"{self.plotName}_sigmaMAD"``
The sigma mad of the distances to the line fit.
* ``f"{self.identity or ''}_median"``
The median of the distances to the line fit.
* ``f"{self.identity or ''}_hardwired_sigmaMAD"``
The sigma mad of the distances to the initial fit.
* ``f"{self.identity or ''}_hardwired_median"``
The median of the distances to the initial fit.
* Parameters from the fitting code that are illustrated on the plot:
* ``"bHW"``
The hardwired intercept to fall back on.
* ``"bODR"``
The intercept calculated by the orthogonal distance
regression fitting.
* ``"bODR2"``
The intercept calculated by the second iteration of
orthogonal distance regression fitting.
* ``"mHW"``
The hardwired gradient to fall back on.
* ``"mODR"``
The gradient calculated by the orthogonal distance
regression fitting.
* ``"mODR2"``
The gradient calculated by the second iteration of
orthogonal distance regression fitting.
* ``"xMin`"``
The x minimum of the box used in the fit.
* ``"xMax"``
The x maximum of the box used in the fit.
* ``"yMin"``
The y minimum of the box used in the fit.
* ``"yMax"``
The y maximum of the box used in the fit.
* ``"mPerp"``
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.
* ``"bPerpMax"``
The intercept of the perpendicular line that goes through xMax.
* The main inputs to plot:
x, y, mag
Examples
--------
An example of the plot produced from this code is here:
.. 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>`.
Parameters
----------
data : `KeyedData`
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:
* ``"run"``
The output run for the plots (`str`).
* ``"skymap"``
The type of skymap used for the data (`str`).
* ``"filter"``
The filter used for this data (`str`).
* ``"tract"``
The tract that the data comes from (`str`).
Returns
-------
fig : `matplotlib.figure.Figure`
The resulting figure.
Notes
-----
The axis labels are given by `self.config.xLabel` and
`self.config.yLabel`. The perpendicular distance of the points to
the fit line is given in a histogram in the second panel.
For the code to work it expects various quantities to be
present in the 'data' that it is given.
The quantities that are expected to be present are:
* Statistics that are shown on the plot or used by the plotting code:
* ``approxMagDepth``
The approximate magnitude corresponding to the SN cut used.
* ``f"{self.plotName}_sigmaMAD"``
The sigma mad of the distances to the line fit.
* ``f"{self.identity or ''}_median"``
The median of the distances to the line fit.
* ``f"{self.identity or ''}_hardwired_sigmaMAD"``
The sigma mad of the distances to the initial fit.
* ``f"{self.identity or ''}_hardwired_median"``
The median of the distances to the initial fit.
* Parameters from the fitting code that are illustrated on the plot:
* ``"bHW"``
The hardwired intercept to fall back on.
* ``"bODR"``
The intercept calculated by the orthogonal distance
regression fitting.
* ``"bODR2"``
The intercept calculated by the second iteration of
orthogonal distance regression fitting.
* ``"mHW"``
The hardwired gradient to fall back on.
* ``"mODR"``
The gradient calculated by the orthogonal distance
regression fitting.
* ``"mODR2"``
The gradient calculated by the second iteration of
orthogonal distance regression fitting.
* ``"xMin`"``
The x minimum of the box used in the fit.
* ``"xMax"``
The x maximum of the box used in the fit.
* ``"yMin"``
The y minimum of the box used in the fit.
* ``"yMax"``
The y maximum of the box used in the fit.
* ``"mPerp"``
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.
* ``"bPerpMax"``
The intercept of the perpendicular line that goes through
xMax.
* The main inputs to plot:
x, y, mag
Examples
--------
An example of the plot produced from this code is here:
.. 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>`.
"""

# Define a new colormap
Expand Down
27 changes: 14 additions & 13 deletions python/lsst/analysis/tools/actions/plot/scatterplotWithTwoHists.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@


class ScatterPlotStatsAction(KeyedDataAction):
"""Calculates the statistics needed for the
"""Calculates the statistics needed for the
scatter plot with two hists.
"""

Expand Down Expand Up @@ -138,7 +138,7 @@ class _StatsContainer(NamedTuple):


class ScatterPlotWithTwoHists(PlotAction):
"""Makes a scatter plot of the data with a marginal
"""Makes a scatter plot of the data with a marginal
histogram for each axis.
"""

Expand Down Expand Up @@ -287,26 +287,26 @@ def makePlot(
which points to plot and the statisticSelector actions to determine
which points to use for the printed statistics.
If this function is being used within the pipetask framework
that takes care of making sure that data has all the required
elements but if you are runnign this as a standalone function
then you will need to provide the following things in the
If this function is being used within the pipetask framework
that takes care of making sure that data has all the required
elements but if you are runnign this as a standalone function
then you will need to provide the following things in the
input data.
* If stars is in self.plotTypes:
xStars, yStars, starsHighSNMask, starsLowSNMask and
{band}_highSNStars_{name}, {band}_lowSNStars_{name}
xStars, yStars, starsHighSNMask, starsLowSNMask and
{band}_highSNStars_{name}, {band}_lowSNStars_{name}
where name is median, sigma_Mad, count and approxMag.
* If it is for galaxies/unknowns then replace stars in the above
* If it is for galaxies/unknowns then replace stars in the above
names with galaxies/unknowns.
* If it is for any (which covers all the points) then it
becomes, x, y, and any instead of stars for the other
* If it is for any (which covers all the points) then it
becomes, x, y, and any instead of stars for the other
parameters given above.
* In every case it is expected that data contains:
lowSnThreshold, highSnThreshold and patch
lowSnThreshold, highSnThreshold and patch
(if the summary plot is being plotted).
Examples
Expand All @@ -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
20 changes: 10 additions & 10 deletions python/lsst/analysis/tools/actions/plot/skyPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
class SkyPlot(PlotAction):
"""Plots the on sky distribution of a parameter.
Plots the values of the parameter given for the z axis
according to the positions given for x and y. Optimised
for use with RA and Dec. Also calculates some basic
Plots the values of the parameter given for the z axis
according to the positions given for x and y. Optimised
for use with RA and Dec. Also calculates some basic
statistics and includes those on the plot.
"""

Expand Down Expand Up @@ -170,19 +170,19 @@ def makePlot(
Notes
-----
Expects the data to contain slightly different things
depending on the types specified in plotTypes. This
is handled automatically if you go through the pipetask
framework but if you call this method separately then you
Expects the data to contain slightly different things
depending on the types specified in plotTypes. This
is handled automatically if you go through the pipetask
framework but if you call this method separately then you
need to make sure that data contains what the code is expecting.
If stars is in the plot types given then it is expected that
If stars is in the plot types given then it is expected that
data contains: xStars, yStars, zStars and starStatMask.
If galaxies is present: xGalaxies, yGalaxies, zGalaxies and
If galaxies is present: xGalaxies, yGalaxies, zGalaxies and
galaxyStatsMask.
If unknown is present: xUnknowns, yUnknowns, zUnknowns and
If unknown is present: xUnknowns, yUnknowns, zUnknowns and
unknownStatMask.
If any is specified: x, y, z, statMask.
Expand Down

0 comments on commit ca6e2a1

Please sign in to comment.