lsst.sims.maf.plots package

Submodules

lsst.sims.maf.plots.hourglassPlotters module

class lsst.sims.maf.plots.hourglassPlotters.HourglassPlot[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

__call__(metricValue, slicer, userPlotDict, fignum=None)[source]

Generate the hourglass plot

lsst.sims.maf.plots.moPlotters module

class lsst.sims.maf.plots.moPlotters.MetricVsH[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

Plot metric values versus H. Marginalize over metric values in each H bin using ‘npReduce’.

class lsst.sims.maf.plots.moPlotters.MetricVsOrbit(xaxis='q', yaxis='e')[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

Plot metric values (at a particular H value) vs. orbital parameters. Marginalize over metric values in each orbital bin using ‘npReduce’.

class lsst.sims.maf.plots.moPlotters.MetricVsOrbitPoints(xaxis='q', yaxis='e')[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

Plot metric values (at a particular H value) as function of orbital parameters, using points for each metric value.

lsst.sims.maf.plots.ndPlotters module

class lsst.sims.maf.plots.ndPlotters.OneDSubsetData[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

Plot a single axes from the sliceColList, identified by plotDict[‘axis’], given the metricValues at all slicepoints [sums over non-visible axes].

plotBinnedData1D(metricValues, slicer, userPlotDict, fignum=None)[source]
Parameters
  • metricValue (numpy.ma.MaskedArray) –

  • slicer (lsst.sims.maf.slicers.NDSlicer) –

  • userPlotDict (dict) – Dictionary of plot parameters set by user (overrides default values). ‘axis’ keyword identifies which axis to show in the plot (along xaxis of plot).

  • fignum (int) – Matplotlib figure number to use (default = None, starts new figure).

Returns

Matplotlib figure number used to create the plot.

Return type

int

class lsst.sims.maf.plots.ndPlotters.TwoDSubsetData[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

Plot 2 axes from the slicer.sliceColList, identified by plotDict[‘xaxis’]/[‘yaxis’], given the metricValues at all slicepoints [sums over non-visible axes].

__call__(metricValues, slicer, userPlotDict, fignum=None)[source]
Parameters
  • metricValue (numpy.ma.MaskedArray) –

  • slicer (lsst.sims.maf.slicers.NDSlicer) –

  • userPlotDict (dict) – Dictionary of plot parameters set by user (overrides default values). ‘xaxis’ and ‘yaxis’ values define which axes of the nd data to plot along the x/y axes.

  • fignum (int) – Matplotlib figure number to use (default = None, starts new figure).

Returns

Matplotlib figure number used to create the plot.

Return type

int

lsst.sims.maf.plots.neoDistancePlotter module

class lsst.sims.maf.plots.neoDistancePlotter.NeoDistancePlotter(step=0.01, eclipMax=10.0, eclipMin=- 10.0)[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

Special plotter to calculate and plot the maximum distance an H=22 NEO could be observable to, in any particular particular opsim observation.

__call__(metricValue, slicer, userPlotDict, fignum=None)[source]
Parameters
  • metricValue (numpy.ma.MaskedArray) – Metric values calculated by lsst.sims.maf.metrics.PassMetric

  • slicer (lsst.sims.maf.slicers.UniSlicer) –

  • userPlotDict (dict) – Dictionary of plot parameters set by user (overrides default values).

  • fignum (int) – Matplotlib figure number to use (default = None, starts new figure).

Returns

Matplotlib figure number used to create the plot.

Return type

int

lsst.sims.maf.plots.nightPointingPlotter module

class lsst.sims.maf.plots.nightPointingPlotter.NightPointingPlotter(mjdCol='observationStartMJD', altCol='alt', azCol='az')[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

lsst.sims.maf.plots.onedPlotters module

class lsst.sims.maf.plots.onedPlotters.OneDBinnedData[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

__call__(metricValues, slicer, userPlotDict, fignum=None)[source]

Plot a set of oneD binned metric data.

lsst.sims.maf.plots.perceptual_rainbow module

lsst.sims.maf.plots.perceptual_rainbow.makePRCmap()[source]

lsst.sims.maf.plots.plotBundle module

class lsst.sims.maf.plots.plotBundle.PlotBundle(bundleList=None, plotDicts=None, plotFunc=None)[source]

Bases: object

Object designed to help organize multiple MetricBundles that will be plotted together using the PlotHandler.

addBundle(bundle, plotDict=None, plotFunc=None)[source]

Add bundle to the object. Optionally add a plotDict and/or replace the plotFunc

incrementPlotOrder()[source]

Find the maximium order number in the display dicts, and set them to +1 that

percentileLegend()[source]

Go through the bundles and change the lables if there are the correct summary stats

plot(outDir='Out', resultsDb=None, closeFigs=True)[source]

lsst.sims.maf.plots.plotHandler module

class lsst.sims.maf.plots.plotHandler.BasePlotter[source]

Bases: object

Serve as the base type for MAF plotters and example of API.

class lsst.sims.maf.plots.plotHandler.PlotHandler(outDir='.', resultsDb=None, savefig=True, figformat='pdf', dpi=600, thumbnail=True, trimWhitespace=True)[source]

Bases: object

plot(plotFunc, plotDicts=None, displayDict=None, outfileRoot=None, outfileSuffix=None)[source]

Create plot for mBundles, using plotFunc.

plotDicts: List of plotDicts if one wants to use a _new_ plotDict per MetricBundle.

saveFig(fignum, outfileRoot, plotType, metricName, slicerName, runName, constraint, metadata, displayDict=None)[source]
setMetricBundles(mBundles)[source]

Set the metric bundle or bundles (list or dictionary). Reuse the PlotHandler by resetting this reference. The metric bundles have to have the same slicer.

setPlotDicts(plotDicts=None, plotFunc=None, reset=False)[source]

Set or update (or ‘reset’) the plotDict for the (possibly joint) plots.

Resolution is: auto-generated items (colors/labels/titles) < anything previously set in the plotHandler < defaults set by the plotter < explicitly set items in the metricBundle plotDict < explicitly set items in the plotDicts list passed to this method.

lsst.sims.maf.plots.plotHandler.applyZPNorm(metricValue, plotDict)[source]

lsst.sims.maf.plots.spatialPlotters module

class lsst.sims.maf.plots.spatialPlotters.BaseHistogram[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

__call__(metricValueIn, slicer, userPlotDict, fignum=None)[source]

Plot a histogram of metricValues (such as would come from a spatial slicer).

class lsst.sims.maf.plots.spatialPlotters.BaseSkyMap[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

__call__(metricValueIn, slicer, userPlotDict, fignum=None)[source]

Plot the sky map of metricValue for a generic spatial slicer.

class lsst.sims.maf.plots.spatialPlotters.HealpixHistogram[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

__call__(metricValue, slicer, userPlotDict, fignum=None)[source]

Histogram metricValue for all healpix points.

class lsst.sims.maf.plots.spatialPlotters.HealpixPowerSpectrum[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

__call__(metricValue, slicer, userPlotDict, fignum=None)[source]

Generate and plot the power spectrum of metricValue (calculated on a healpix grid).

class lsst.sims.maf.plots.spatialPlotters.HealpixSDSSSkyMap[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

__call__(metricValueIn, slicer, userPlotDict, fignum=None)[source]

Plot the sky map of metricValue using healpy cartview plots in thin strips. raMin: Minimum RA to plot (deg) raMax: Max RA to plot (deg). Note raMin/raMax define the centers that will be plotted. raLen: Length of the plotted strips in degrees decMin: minimum dec value to plot decMax: max dec value to plot metricValueIn: metric values

class lsst.sims.maf.plots.spatialPlotters.HealpixSkyMap[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

Generate a sky map of healpix metric values using healpy’s mollweide view.

__call__(metricValueIn, slicer, userPlotDict, fignum=None)[source]
Parameters
  • metricValue (numpy.ma.MaskedArray) –

  • slicer (lsst.sims.maf.slicers.HealpixSlicer) –

  • userPlotDict (dict) – Dictionary of plot parameters set by user (overrides default values).

  • fignum (int) – Matplotlib figure number to use (default = None, starts new figure).

Returns

Matplotlib figure number used to create the plot.

Return type

int

class lsst.sims.maf.plots.spatialPlotters.LambertSkyMap[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

Use basemap and contour to make a Lambertian projection. Note that the plotDict can include a ‘basemap’ key with a dictionary of arbitrary kwargs to use with the call to Basemap.

class lsst.sims.maf.plots.spatialPlotters.OpsimHistogram[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

__call__(metricValue, slicer, userPlotDict, fignum=None)[source]

Histogram metricValue for all healpix points.

lsst.sims.maf.plots.spatialPlotters.setColorLims(metricValue, plotDict)[source]

Set up color bar limits.

lsst.sims.maf.plots.spatialPlotters.setColorMap(plotDict)[source]

lsst.sims.maf.plots.specialPlotters module

class lsst.sims.maf.plots.specialPlotters.FOPlot[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

Special plotter to generate and label fO plots.

__call__(metricValue, slicer, userPlotDict, fignum=None)[source]
Parameters
  • metricValue (numpy.ma.MaskedArray) – The metric values calculated with the ‘Count’ metric and a healpix slicer.

  • slicer (lsst.sims.maf.slicers.HealpixSlicer) –

  • userPlotDict (dict) – Dictionary of plot parameters set by user (overrides default values). Note that Asky and Nvisits values set here and in the slicer should be consistent, for plot labels and summary statistic values to be consistent.

  • fignum (int) – Matplotlib figure number to use (default = None, starts new figure).

Returns

Matplotlib figure number used to create the plot.

Return type

int

class lsst.sims.maf.plots.specialPlotters.SummaryHistogram[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

Special plotter to summarize metrics which return a set of values at each slicepoint, such as if a histogram was calculated at each slicepoint (e.g. with the lsst.sims.maf.metrics.TgapsMetric). Effectively marginalizes the calculated values over the sky, and plots the a summarized version (reduced to a single according to the plotDict[‘metricReduce’] metric).

__call__(metricValue, slicer, userPlotDict, fignum=None)[source]
Parameters
  • metricValue (numpy.ma.MaskedArray) – Handles ‘object’ datatypes for the masked array.

  • slicer (lsst.sims.maf.slicers) – Any MAF slicer.

  • userPlotDict (dict) – Dictionary of plot parameters set by user (overrides default values). ‘metricReduce’ (an lsst.sims.maf.metric) indicates how to marginalize the metric values calculated at each point to a single series of values over the sky. ‘histStyle’ (True/False) indicates whether to plot the results as a step histogram (True) or as a series of values (False) ‘bins’ (np.ndarray) sets the x values for the resulting plot and should generally match the bins used with the metric.

  • fignum (int) – Matplotlib figure number to use (default = None, starts new figure).

Returns

Matplotlib figure number used to create the plot.

Return type

int

lsst.sims.maf.plots.twoDPlotters module

class lsst.sims.maf.plots.twoDPlotters.TwoDMap[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

__call__(metricValue, slicer, userPlotDict, fignum=None)[source]
Parameters
  • metricValue (numpy.ma.MaskedArray) –

  • slicer (lsst.sims.maf.slicers.BaseSpatialSlicer) – (any spatial slicer)

  • userPlotDict (dict) – Dictionary of plot parameters set by user (overrides default values).

  • fignum (int) – Matplotlib figure number to use (default = None, starts new figure).

Returns

Matplotlib figure number used to create the plot.

Return type

int

class lsst.sims.maf.plots.twoDPlotters.VisitPairsHist[source]

Bases: lsst.sims.maf.plots.plotHandler.BasePlotter

Given an opsim2dSlicer, figure out what fraction of observations are in singles, pairs, triples, etc.

__call__(metricValue, slicer, userPlotDict, fignum=None)[source]
Parameters
  • metricValue (numpy.ma.MaskedArray) –

  • slicer (lsst.sims.maf.slicers.TwoDSlicer) –

  • userPlotDict (dict) – Dictionary of plot parameters set by user (overrides default values).

  • fignum (int) – Matplotlib figure number to use (default = None, starts new figure).

Returns

Matplotlib figure number used to create the plot.

Return type

int

Module contents