InterpolateDetectorMetricPlot

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

Bases: PlotAction

Interpolate metrics evaluated at locations across a detector.

The provided list of metric names and labels enables the creation of a multi-panel plot, with the 2D interpolation of the input metric values sampled on the given detector x and y coordinates. The interpolation evaluation grid can be controlled with the margin and number of grid points.

Attributes Summary

gridMargin

Grid margins for the field to interpolate (int, default 20)

metricNames

Metrics to pull data from for interpolation (List)

nGridPoints

N points in the grid for the field to interpolate (int, default 50)

xAxisLabel

Label to use for the x axis.

xCoordSize

Dimensions for X direction field to interpolate (int, default 4096)

yAxisLabel

Label to use for the y axis.

yCoordSize

Dimensions for Y direction field to interpolate (int, default 4096)

zAxisLabels

Labels to use for the z axis.

Methods Summary

__call__(data, **kwargs)

Call self as a function.

getInputSchema()

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

makePlot(data[, plotInfo])

Makes a plot of a smooth interpolation of randomly sampled metrics in the image domain.

Attributes Documentation

gridMargin

Grid margins for the field to interpolate (int, default 20)

metricNames

Metrics to pull data from for interpolation (List)

nGridPoints

N points in the grid for the field to interpolate (int, default 50)

xAxisLabel

Label to use for the x axis. (str, default 'x (pixel)')

xCoordSize

Dimensions for X direction field to interpolate (int, default 4096)

yAxisLabel

Label to use for the y axis. (str, default 'y (pixel)')

yCoordSize

Dimensions for Y direction field to interpolate (int, default 4096)

zAxisLabels

Labels to use for the z axis. (List, default None)

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() 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, **kwargs) Figure

Makes a plot of a smooth interpolation of randomly sampled metrics in the image domain.

Parameters:
dataKeyedData

The catalog to plot the points from, the catalog needs to have columns:

  • "x"

    The x image coordinate of the input metric values

  • "y"

    The y image coordinate of the input metric values

  • metricNames

    The column names of each image metric that needs to be interpolated.

plotInfodict

Optional. A dictionary of information about the data being plotted

Returns:
figmatplotlib.figure.Figure

The resulting figure.

Notes

Uses the zAxisLabels config option to write the metric units and title for each of the used panels. The number of plots is determined from the number of metricNames in the config options. The colorbar of the interpolation is included for each panel, as well as a scatter plot showing the locations of the metric sampling locations.

Examples

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

../_images/interpolateDetectorPlotExample.png

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