lsst.display.matplotlib gb32d437585+cb1993dea9
 
Loading...
Searching...
No Matches
lsst.display.matplotlib.wcsAxes.WcsAxesManager Class Reference

Public Member Functions

 __init__ (self, axes, frameSet, *, grid=False, useSexagesimal=False, extraOptions="")
 
 draw (self)
 
 setSexagesimal (self, useSexagesimal)
 
 remove (self)
 

Public Attributes

list artists = []
 

Protected Member Functions

 _plotOptions (self)
 
 _removeArtists (self)
 
 _onLimitsChanged (self, axes)
 
 _redrawNow (self)
 

Protected Attributes

 _axes = axes
 
 _frameSet = frameSet
 
 _grid = grid
 
 _useSexagesimal = useSexagesimal
 
 _extraOptions = extraOptions
 
tuple _savedVisibility
 
bool _redrawing = False
 
 _redrawTimer = None
 
list _callbackIds
 
 _redrawNow = True
 

Static Protected Attributes

int _redrawDelayMs = 200
 

Detailed Description

Manage AST-drawn sky coordinate axes on a matplotlib Axes.

All visible axis furniture (border, ticks, labels, optional grid)
is drawn by AST; matplotlib's own axis furniture is hidden while
this manager is active and restored by `remove`.

The axes' data coordinates must be pixel coordinates in the LSST
convention, matching the base frame of ``frameSet`` as produced by
`astFrameSetFromWcs`: the center of the first pixel of the parent
image is at (0, 0), and a subimage keeps its parent's coordinates
(its pixel coordinates start at the subimage's XY0, not at zero).
This differs from the FITS convention, in which the first pixel of
the image is centered at (1, 1).

Parameters
----------
axes : `matplotlib.axes.Axes`
    The axes to draw on.
frameSet : `starlink.Ast.FrameSet`
    Pixel-to-sky transform, base frame in axes data coordinates.
grid : `bool`, optional
    Draw the full curvilinear coordinate grid across the image?
useSexagesimal : `bool`, optional
    Format labels as e.g. HH:MM:SS.s rather than decimal degrees.
extraOptions : `str`, optional
    Comma-separated AST Plot attribute settings appended after the
    defaults, so they take precedence (e.g.
    ``"Colour(grid)=2, Width(border)=2"``).

Notes
-----
AST colour values are 1-based indices into the grf colour table
(see `starlink.Grf.grf_matplotlib`), not colour names:
1=default, 2=red, 3=green, 4=blue, 5=cyan, 6=magenta, 7=yellow,
8=black, 9=dark grey, 10=grey, 11=light grey, 12=white.

Member Function Documentation

◆ _onLimitsChanged()

lsst.display.matplotlib.wcsAxes.WcsAxesManager._onLimitsChanged ( self,
axes )
protected
Schedule a redraw for new view limits; matplotlib callback.

The redraw is debounced with a one-shot timer so that a stream
of limit changes (interactive panning or zooming, or the x/y
pair from a single zoom) produces a single rebuild once the
view settles.  Backends without a running event loop cannot
fire timers, so there the redraw happens immediately.

◆ _plotOptions()

lsst.display.matplotlib.wcsAxes.WcsAxesManager._plotOptions ( self)
protected
Return the AST Plot options string for the current state.

◆ _redrawNow()

lsst.display.matplotlib.wcsAxes.WcsAxesManager._redrawNow ( self)
protected
Rebuild the AST axes for the current view and repaint.

◆ _removeArtists()

lsst.display.matplotlib.wcsAxes.WcsAxesManager._removeArtists ( self)
protected
Remove the AST artists from the axes.

◆ draw()

lsst.display.matplotlib.wcsAxes.WcsAxesManager.draw ( self)
Draw (or redraw) the AST axes for the current view limits.

◆ remove()

lsst.display.matplotlib.wcsAxes.WcsAxesManager.remove ( self)
Remove the AST axes and restore matplotlib's axis furniture.

◆ setSexagesimal()

lsst.display.matplotlib.wcsAxes.WcsAxesManager.setSexagesimal ( self,
useSexagesimal )
Switch between sexagesimal and decimal degree labels.

Parameters
----------
useSexagesimal : `bool`
    Format labels as e.g. HH:MM:SS.s iff True.

Member Data Documentation

◆ _callbackIds

list lsst.display.matplotlib.wcsAxes.WcsAxesManager._callbackIds
protected
Initial value:
= [
axes.callbacks.connect("xlim_changed", self._onLimitsChanged),
axes.callbacks.connect("ylim_changed", self._onLimitsChanged),
]

◆ _savedVisibility

tuple lsst.display.matplotlib.wcsAxes.WcsAxesManager._savedVisibility
protected
Initial value:
= (
axes.xaxis.get_visible(),
axes.yaxis.get_visible(),
{name: spine.get_visible() for name, spine in axes.spines.items()},
)

The documentation for this class was generated from the following file: