SkyPlot

class lsst.analysis.tools.actions.plot.SkyPlot(*args, **kw)

Bases: 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 statistics and includes those on the plot.

The plotting of patch outlines requires patch information to be included as an additional parameter.

Attributes Summary

colorbarRange

Action to calculate the min and max of the colorbar range.

fixAroundZero

Fix the colorbar to be symmetric around zero.

plotName

The name for the plot.

plotOutlines

Plot the outlines of the ccds/patches? (bool, default True)

plotTypes

Selection of types of objects to plot.

showExtremeOutliers

Show the x-y positions of extreme outlier values as overlaid scatter points.

xAxisLabel

Label to use for the x axis.

yAxisLabel

Label to use for the y axis.

zAxisLabel

Label to use for the z axis.

Methods Summary

__call__(data, **kwargs)

Call self as a function.

getInputSchema(**kwargs)

Return the schema an AnalysisAction expects to be present in the arguments supplied to the __call__ method.

makePlot(data[, plotInfo, sumStats])

Make a skyPlot of the given data.

statsAndText(arr[, mask])

Calculate some stats from an array and return them and some text.

Attributes Documentation

colorbarRange

Action to calculate the min and max of the colorbar range. (VectorAction, default <class 'lsst.analysis.tools.actions.plot.calculateRange.Med2Mad'>)

fixAroundZero

Fix the colorbar to be symmetric around zero. (bool, default False)

plotName

The name for the plot. (str)

plotOutlines

Plot the outlines of the ccds/patches? (bool, default True)

plotTypes

Selection of types of objects to plot. Can take any combination of stars, galaxies, unknown, mag, any. (List)

showExtremeOutliers

Show the x-y positions of extreme outlier values as overlaid scatter points. (bool, default True)

xAxisLabel

Label to use for the x axis. (str)

yAxisLabel

Label to use for the y axis. (str)

zAxisLabel

Label to use for the z axis. (str)

Methods Documentation

__call__(data: MutableMapping[str, ndarray[Any, dtype[_ScalarType_co]] | Scalar | HealSparseMap | Tensor | Mapping], **kwargs) Mapping[str, Figure] | Figure

Call self as a function.

getInputSchema(**kwargs) Mapping]]]

Return the schema an AnalysisAction expects to be present in the arguments supplied to the __call__ method.

Returns:
resultKeyedDataSchema

The schema this action requires to be present when calling this action, keys are unformatted.

makePlot(data: MutableMapping[str, ndarray[Any, dtype[_ScalarType_co]] | Scalar | HealSparseMap | Tensor | Mapping], plotInfo: Mapping[str, str] | None = None, sumStats: Mapping | None = None, **kwargs) Figure

Make a skyPlot of the given data.

Parameters:
dataKeyedData

The catalog to plot the points from.

plotInfodict

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).

sumStatsdict

A dictionary where the patchIds are the keys which store the R.A. and dec of the corners of the patch.

Returns:
pipeBase.Struct containing:
skyPlotmatplotlib.figure.Figure

The resulting figure.

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 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 data contains: xStars, yStars, zStars and starStatMask.

If galaxies is present: xGalaxies, yGalaxies, zGalaxies and galaxyStatsMask.

If unknown is present: xUnknowns, yUnknowns, zUnknowns and unknownStatMask.

If any is specified: x, y, z, statMask.

These options are not exclusive and multiple can be specified and thus need to be present in data.

Examples

An example of the plot produced from this code is here:

../_images/skyPlotExample.png

For a detailed example of how to make a plot from the command line please see the getting started guide.

statsAndText(arr, mask=None)

Calculate some stats from an array and return them and some text.