PropertyMapPlot

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

Bases: PlotAction

Attributes Summary

plotName

The name for the plotting task.

Methods Summary

__call__(data, tractInfo, plotConfig, ...)

Call self as a function.

addPlotInfo(fig, plotInfo, mapName)

Add useful information to the plot.

addTextToColorbar(cb, text[, orientation, ...])

Helper method to add text inside the horizontal colorbar.

getLongestSuffixMatch(s, options)

Find the longest suffix in the provided list that matches the end of the given string.

getOutputNames([config])

Returns a list of names that will be used as keys if this action's call method returns a mapping.

getZoomedExtent(fullExtent, n)

Get zoomed extent centered on the original full plot.

makePlot(data, tractInfo, plotConfig, plotInfo)

Make the survey property map plot.

prettyPrintFloat(n)

Attributes Documentation

plotName

The name for the plotting task. (str, default None)

Methods Documentation

__call__(data: MutableMapping[str, ndarray[Any, dtype[ScalarType]] | Scalar | HealSparseMap | Tensor], tractInfo: ExplicitTractInfo, plotConfig: PropertyMapTractAnalysisConfig, plotInfo: Mapping[str, Mapping[str, str] | str | int], **kwargs) Mapping[str, Figure]

Call self as a function.

addPlotInfo(fig: Figure, plotInfo: Mapping[str, Mapping[str, str] | str | int], mapName: Mapping[str, str]) Figure

Add useful information to the plot.

Parameters:
figmatplotlib.figure.Figure

The figure to add the information to.

plotInfodict

A dictionary of the plot information.

mapNamestr

The name of the map being plotted.

Returns:
figmatplotlib.figure.Figure

The figure with the information added.

static addTextToColorbar(cb, text, orientation='vertical', color='black', fontsize=14, fontweight='bold', alpha=0.8)

Helper method to add text inside the horizontal colorbar.

Parameters:
cbColorbar

The colorbar object.

textstr

The text to add.

orientationstr, optional

The orientation of the colorbar. Can be either “vertical” or “horizontal”.

fontsizeint, optional

The fontsize of the text.

fontweightstr, optional

The fontweight of the text.

alphafloat, optional

The alpha value of the text.

Returns:
None

The text is added to the colorbar in place.

static getLongestSuffixMatch(s, options)

Find the longest suffix in the provided list that matches the end of the given string.

Parameters:
sstr

The target string for which we want to find a matching suffix.

optionslist [str]

A list of potential suffix strings to match against the target string s.

Returns:
str

The longest matching suffix from the options list. If no match is found, returns None.

getOutputNames(config=None) Iterable[str]

Returns a list of names that will be used as keys if this action’s call method returns a mapping. Otherwise return an empty Iterable.

Parameters:
configlsst.pex.config.Config, optional

Configuration of the task. This is only used if the output naming needs to be config-aware.

Returns:
resultIterable of str

If a PlotAction produces more than one plot, this should be the keys the action will use in the returned Mapping.

static getZoomedExtent(fullExtent, n)

Get zoomed extent centered on the original full plot.

Parameters:
fullExtenttuple [float]

The full extent defined by (lon_min, lon_max, lat_min, lat_max):

  • lon_min

    Minimum longitude of the original extent (float).

  • "lon_max"

    Maximum longitude of the original extent (float).

  • lat_min

    Minimum latitude of the original extent (float).

  • "lat_max"

    Maximum latitude of the original extent (float).

nfloat, optional

Zoom factor; for instance, n=2 means zooming in 2 times at the center. If None, the function returns None.

Returns:
tuple [float]

New extent as (new_lon_min, new_lon_max, new_lat_min, new_lat_max).

makePlot(data: MutableMapping[str, ndarray[Any, dtype[ScalarType]] | Scalar | HealSparseMap | Tensor], tractInfo: ExplicitTractInfo, plotConfig: PropertyMapTractAnalysisConfig, plotInfo: Mapping[str, Mapping[str, str] | str | int]) Mapping[str, Figure]

Make the survey property map plot.

Parameters:
dataKeyedData

The HealSparseMap to plot the points from.

tractInfo: `~lsst.skymap.tractInfo.ExplicitTractInfo`

The tract info object.

plotConfig

PropertyMapTractAnalysisConfig The configuration for the plot.

plotInfodict

A dictionary of information about the data being plotted.

Returns:
figDictdict [Figure]

The resulting figures.

static prettyPrintFloat(n)