Maps (sunpy.map)#

sunpy Map objects are constructed using the special factory class:

class sunpy.map.map_factory.MapFactory(default_widget_type=None, additional_validation_functions=[], registry=None)[source]#

A factory for generating coordinate aware 2D images.

This factory takes a variety of inputs, such as file paths, wildcard patterns or (data, header) pairs.

Depending on the input different return types are possible.

Parameters:
  • *inputs – Inputs to parse for map objects. See the examples section for a detailed list of accepted inputs.

  • sequence (bool, optional) – Return a sunpy.map.MapSequence object comprised of all the parsed maps.

  • composite (bool, optional) – Return a sunpy.map.CompositeMap object comprised of all the parsed maps.

Returns:

Examples

>>> import sunpy.map
>>> from astropy.io import fits
>>> import sunpy.data.sample  
>>> mymap = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)  

sunpy.map Package#

Map objects are constructed using the special factory class: Map. All sunpy Maps are derived from sunpy.map.GenericMap, all the methods and attributes are documented in that class.

The result of a call to Map will be either a GenericMap object if no instrument matches, or a subclass of GenericMap which deals with a specific source of data, e.g., AIAMap or LASCOMap (see sunpy.map Package to see a list of all of them).

sunpy.map Package#

Functions#

all_coordinates_from_map(smap)

Returns the coordinates of the center of every pixel in a map.

all_corner_coords_from_map(smap)

Returns the coordinates of the pixel corners in a map.

all_pixel_indices_from_map(smap)

Returns pixel pair indices of every pixel in a map.

contains_coordinate(smap, coordinates)

Checks whether a coordinate falls within the bounds of a map.

contains_full_disk(smap)

Checks if a map contains the full disk of the Sun.

contains_limb(smap)

Checks if a map contains any part of the solar limb or equivalently whether the map contains both on-disk and off-disk pixels.

contains_solar_center(smap)

Returns True if smap contains the solar center.

coordinate_is_on_solar_disk(coordinates)

Checks if the helioprojective Cartesian coordinates are on the solar disk.

is_all_off_disk(smap)

Checks if none of the coordinates in the GenericMap are on the solar disk.

is_all_on_disk(smap)

Checks if all of the coordinates in the GenericMap are on the solar disk.

map_edges(smap)

Returns the pixel locations of the edges of an input map.

on_disk_bounding_coordinates(smap)

Returns the the bottom left and top right coordinates of the smallest rectangular region that contains all the on disk coordinates of the input map.

pixelate_coord_path(smap, coord_path, *[, ...])

Return the pixel coordinates for every pixel that intersects with a coordinate path.

sample_at_coords(smap, coordinates)

Samples the data in a map at given series of coordinates.

solar_angular_radius(coordinates)

Calculates the solar angular radius as seen by the observer.

Classes#

CompositeMap(map1 [,map2,..])

A Composite Map class

GenericMap(data, header[, plot_settings])

A Generic spatially-aware 2D data array

MapMetaValidationError

MapSequence(*args[, sortby, derotate])

A series of Maps in a single object.

PixelPair(x, y)

Variables#

Map

A factory for generating coordinate aware 2D images.

maxwell

CGS unit for magnetic flux

Class Inheritance Diagram#

Inheritance diagram of sunpy.map.compositemap.CompositeMap, sunpy.map.mapbase.GenericMap, sunpy.map.mapbase.MapMetaValidationError, sunpy.map.mapsequence.MapSequence, sunpy.map.mapbase.PixelPair

Header helpers#

The header_helper sub-module contains helper functions for generating FITS-WCS headers from Python objects.

sunpy.map.header_helper Module#

Functions#

meta_keywords()

Deprecated since version 5.0.

make_fitswcs_header(data, coordinate[, ...])

Function to create a FITS-WCS header from a coordinate object (SkyCoord) that is required to create a GenericMap.

get_observer_meta(observer[, rsun])

Function to get observer meta from coordinate frame.

make_heliographic_header(date, ...[, ...])

Construct a FITS-WCS header for a full-Sun heliographic (Carrington or Stonyhurst) coordinate frame.

Instrument Map Classes#

Defined in sunpy.map.sources are a set of GenericMap subclasses which convert the specific metadata and other differences in each instruments data to the standard GenericMap interface. These ‘sources’ also define things like the colormap and default normalization for each instrument. These subclasses also provide a method, which describes to the Map factory which data and metadata pairs match its instrument.

sunpy.map.sources Package#

Functions#

from_helioviewer_project(meta)

Test determining if the given metadata contains Helioviewer Project sourced data.

source_stretch(meta, fits_stretch)

Assign the correct source-dependent image stretching function.

Classes#

AIAMap(data, header, **kwargs)

AIA Image Map.

CORMap(data, header, **kwargs)

STEREO-SECCHI CORonograph Image Map.

EITMap(data, header, **kwargs)

SOHO EIT Image Map.

EUIMap(data, header, **kwargs)

EUI Image Map

EUVIMap(data, header, **kwargs)

STEREO-SECCHI EUVI Image Map

GONGSynopticMap(data, header[, plot_settings])

GONG Synoptic Map.

HIMap(data, header, **kwargs)

STEREO-SECCHI Heliospheric Imager (HI) Map.

HMIMap(data, header, **kwargs)

HMI Image Map.

HMISynopticMap(data, header, **kwargs)

SDO/HMI Synoptic Map.

KCorMap(data, header, **kwargs)

K-Cor Image Map.

LASCOMap(data, header, **kwargs)

SOHO LASCO Image Map

MDIMap(data, header, **kwargs)

SOHO MDI Image Map

MDISynopticMap(data, header, **kwargs)

SOHO MDI synoptic magnetogram Map.

RHESSIMap(data, header, **kwargs)

RHESSI Image Map.

SJIMap(data, header[, plot_settings])

A 2D IRIS Slit Jaw Imager Map.

SOTMap(data, header, **kwargs)

Hinode SOT Image Map definition.

SUVIMap(data, header, **kwargs)

SUVI Image Map.

SWAPMap(data, header, **kwargs)

PROBA2 SWAP Image Map.

SXTMap(data, header, **kwargs)

Yohkoh SXT Image Map

TRACEMap(data, header, **kwargs)

TRACE Image Map

WISPRMap(data, header, **kwargs)

WISPR Map

XRTMap(data, header, **kwargs)

Hinode XRT map definition.

Class Inheritance Diagram#

Inheritance diagram of sunpy.map.sources.sdo.AIAMap, sunpy.map.sources.stereo.CORMap, sunpy.map.sources.soho.EITMap, sunpy.map.sources.solo.EUIMap, sunpy.map.sources.stereo.EUVIMap, sunpy.map.sources.gong.GONGSynopticMap, sunpy.map.sources.stereo.HIMap, sunpy.map.sources.sdo.HMIMap, sunpy.map.sources.sdo.HMISynopticMap, sunpy.map.sources.mlso.KCorMap, sunpy.map.sources.soho.LASCOMap, sunpy.map.sources.soho.MDIMap, sunpy.map.sources.soho.MDISynopticMap, sunpy.map.sources.rhessi.RHESSIMap, sunpy.map.sources.iris.SJIMap, sunpy.map.sources.hinode.SOTMap, sunpy.map.sources.suvi.SUVIMap, sunpy.map.sources.proba2.SWAPMap, sunpy.map.sources.yohkoh.SXTMap, sunpy.map.sources.trace.TRACEMap, sunpy.map.sources.psp.WISPRMap, sunpy.map.sources.hinode.XRTMap