STIXMap#

class stixpy.map.stix.STIXMap(data, header, plot_settings=None, **kwargs)[source]#

Bases: GenericMap

A class to represent a STIX Map.

Notes

A number of the properties of this class are returned as two-value named tuples that can either be indexed by position ([0] or [1]) or be accessed by the names (.x and .y) or (.axis1 and .axis2). Things that refer to pixel axes use the .x, .y convention, where x and y refer to the FITS axes (x for columns y for rows). Spatial axes use .axis1 and .axis2 which correspond to the first and second axes in the header. axis1 corresponds to the coordinate axis for x and axis2 corresponds to y.

This class assumes that the metadata adheres to the FITS 4 standard. Where the CROTA2 metadata is provided (without PC_ij) it assumes a conversion to the standard PC_ij described in section 6.1 of . Calabretta & Greisen (2002)

Warning

If a header has CD_ij values but no PC_ij values, CDELT values are required for this class to construct the WCS. If a file with more than two dimensions is feed into the class, only the first two dimensions (NAXIS1, NAXIS2) will be loaded and the rest will be discarded.

Attributes Summary

wcs

The WCS property of the map.

Methods Summary

is_datasource_for(data, header, **kwargs)

plot(**kwargs)

Plots the map object using matplotlib, in a method equivalent to imshow() using nearest neighbor interpolation.

Attributes Documentation

wcs#

The WCS property of the map.

Methods Documentation

classmethod is_datasource_for(data, header, **kwargs)[source]#
plot(**kwargs)[source]#

Plots the map object using matplotlib, in a method equivalent to imshow() using nearest neighbor interpolation.

Parameters:
  • annotate (bool, optional) – If True, the data is plotted at its natural scale; with title and axis labels.

  • axes (Axes or None) – If provided the image will be plotted on the given axes. Else the current Matplotlib axes will be used.

  • title (str, bool, optional) – The plot title. If True, uses the default title for this map.

  • clip_interval (two-element Quantity, optional) – If provided, the data will be clipped to the percentile interval bounded by the two numbers.

  • autoalign (bool or str, optional) – If other than False, the plotting accounts for any difference between the WCS of the map and the WCS of the WCSAxes axes (e.g., a difference in rotation angle). If pcolormesh, this method will use pcolormesh() instead of the default imshow(). Specifying True is equivalent to specifying pcolormesh.

  • **imshow_kwargs (dict) – Any additional imshow arguments are passed to imshow().

Examples

>>> # Simple Plot with color bar
>>> aia.plot()   
>>> plt.colorbar()   
>>> # Add a limb line and grid
>>> aia.plot()   
>>> aia.draw_limb()   
>>> aia.draw_grid()   

Notes

The autoalign functionality is computationally intensive. If the plot will be interactive, the alternative approach of preprocessing the map (e.g., de-rotating it) to match the desired axes will result in better performance.

When combining autoalign functionality with Helioprojective coordinates, portions of the map that are beyond the solar disk may not appear, which may also inhibit Matplotlib’s autoscaling of the plot limits. The plot limits can be set manually. To preserve the off-disk parts of the map, using the assume_spherical_screen() context manager may be appropriate.