Skip to main content
Ctrl+K
SunPy
  • About
    • Our Mission
    • SunPy Project
    • Presentations
    • Meetings
    • Code of Conduct
  • Documentation
    • sunpy
    • aiapy
    • dkist
    • drms
    • irispy
    • ndcube
    • roentgen
    • scope
    • solarmach
    • sunkit-image
    • sunkit-instruments
    • sunkit-magex
    • sunkit-pyvista
    • sunpy-soar
    • sunraster
    • xrtpy
      • pyflct
      • radiospectra
      • ablog
      • mpl-animators
      • streamtracer
  • Packages
  • Get Help
  • Contribute
  • Blog
  • Cite SunPy
  • About ▾
    • Our Mission
    • SunPy Project
    • Presentations
    • Meetings
    • Code of Conduct
  • Documentation ▾
    • sunpy
    • aiapy
    • dkist
    • drms
    • irispy
    • ndcube
    • roentgen
    • scope
    • solarmach
    • sunkit-image
    • sunkit-instruments
    • sunkit-magex
    • sunkit-pyvista
    • sunpy-soar
    • sunraster
    • xrtpy
      • pyflct
      • radiospectra
      • ablog
      • mpl-animators
      • streamtracer
  • Packages
  • Get Help
  • Contribute
  • Blog
  • Cite SunPy
Logo image

sunpy 8.1.dev24 documentation

  • The sunpy tutorial
    • Installation
    • Units
    • Times
    • Coordinates
    • Acquiring Data
      • Finding and Downloading Data from JSOC
      • Searching the Heliophysics Event Knowledgebase
    • Maps
    • Timeseries
  • Example Gallery
    • Acquiring Data
      • Available search attributes for the SOAR
      • Downloading EUI Data with VSO and SOAR
      • Getting data from CDAWeb
      • Querying Metadata clients
      • Querying and loading SHARP data
      • Querying the GOES flare event list
      • Quick overview of Searching the SOAR with Fido
      • Requesting cutouts of AIA images from the JSOC
      • Searching for EPD/EPT data with the a.soar.Sensor attribute
      • Searching for Solar Orbiter data using Solar Distance attribute
      • Searching for Solar Orbiter data using Wavelength and Detector attributes
    • Map
      • Comparing Map Rotation Functions
      • Creating a Composite map
      • Creating a mask for LASCO C2 data
      • Cropping a Map
      • Downloading and plotting Metis coronagraph data
      • Finding bright regions with ndimage
      • Finding contours of a map
      • Finding the brightest pixel
      • Generating a map from data array
      • Histograming map data
      • Interactively Selecting Coordinates on a Plot
      • Map metadata modification
      • Masking HMI based on the intensity of AIA
      • Overplotting HMI Contours on an AIA Image
      • Plotting a Map without any Axes
      • Plotting a difference image
      • Resampling Maps
      • Rotating a Map
      • Segmenting a Map based on transformation of coordinates
      • Tracking an Active Region Across the Solar Disk
    • Combining, Co-aligning, and Reprojecting Images
      • Aligning AIA and HMI Data with Reproject
      • Auto-Aligning AIA and HMI Data During Plotting
      • Creating Carrington Maps
      • Creating a Full Sun Map with AIA and EUVI
      • Downloading and Reprojecting a Solar Orbiter PHI/HRT Magnetogram
      • Reprojecting Images to Different Observers
      • Reprojecting Using a Spherical Screen
      • Reprojecting a Helioprojective Map to Helioprojective Radial
      • Reprojecting to a Map Projection with a Custom Origin
      • Reprojecting with Automatic Extent
      • Rotating HMI maps so they’re not ‘upside-down’
    • Time Series
      • Creating a TimeSeries from GOES-XRS near real time data with flare times
      • Find Peaks in sunpy TimeSeries
      • Flare times on a GOES XRS plot
      • Making a power spectrum from a TimeSeries
      • Retrieving and analyzing GOES X-Ray Sensor (XRS) data
      • Smoothing of timeSeries data using convolution filters
      • The TimeSeriesMetaData class
      • Using TimeSeries
    • Coordinates, times, and units
      • AIA to STEREO coordinate conversion
      • Converting between Helioprojective and AltAz Coordinate
      • Coordinates computations using SPICE kernels
      • Create a Helioprojective Map from observations in the RA-DEC coordinate system
      • Drawing the AIA limb on a STEREO EUVI image
      • Extracting intensity of a map along a line
      • Getting the location of the planets
      • Getting the observer location from a Map
      • Identifying stars in a STEREO/SECCHI COR2 coronagraph image
      • Obtaining a spacecraft trajectory from JPL Horizons
      • Offsetting the north pole of a coordinate frame
      • Overplotting the position of the Venus transit
      • Plotting Fields of View of Solar Orbiter and DKIST
      • Setting the correct position for SOHO in a LASCO C3 Map
    • Plotting
      • Adding an Earth scale image
      • Blending maps together
      • Combining off-limb and disk maps
      • Creating a Composite Plot with Three Maps
      • Drawing a latitude-longitude quadrangle
      • Drawing a rotated rectangle on a map
      • Drawing and using a Great Arc
      • Drawing heliographic longitude and latitude lines
      • Drawing the Extent of a WCS
      • Editing the colormap and normalization of a Map
      • Fading between two maps
      • Finding Local Peaks in Solar Data
      • Fine grained Plotting Features of Map
      • Imshow and maps coordinates
      • Loading an HMI synoptic map
      • Overlay an AIA image on a LASCO C2 coronagraph
      • Overlaying Two Maps
      • Overlaying off-disk contours using a screen
      • Overplotting HEK feature/event polygons on a map
      • Overplotting SRS active region locations on a magnetograms
      • Plot positions on a blank map
      • Plotting Solar Orbiter PHI Data
      • Plotting a coordinate grid
      • Plotting a map
      • Plotting a solar cycle index
      • Plotting points on a Map with WCSAxes
      • Plotting the solar equator and prime meridian
      • Plotting the solar limb
      • Set Axis Range When Plotting a Map
      • Simple Differential Rotation
      • Using the sunpy Colormaps with matplotlib
    • Differential Rotation of the Sun
      • Comparing differential-rotation models
      • Differentially rotating a coordinate
      • Differentially rotating a map
      • Overlaying differentially rotated gridlines
    • Saving and Loading Data
      • Reading ADAPT FITS Files
      • Saving and loading coordinates with asdf
      • Saving and loading sunpy Maps with ASDF
      • Saving and loading sunpy Maps with FITS
    • Computer Vision Techniques
      • Edge Enhancing Coronal Loops
      • Enhancing off-disk emission
      • Finding and masking bright pixels
      • Masking out the solar disk
    • Showcase
      • Artemis II Solar Eclipse
      • Artemis II trajectory
      • Creating a time-distance plot from a sequence of maps
      • HMI Showcase: Cutout
      • Obtaining solar-eclipse information
      • Parallel Spectral Fitting with Astropy Modeling
      • Reproducing the “Where is STEREO Today?” plot
      • Understanding Observer Orientation Relative to a Simulated Volume with astropy.coordinates
      • Visualizing 3D stereoscopic images
  • How-To Guides
    • Access coordinate components
    • Create a Map
    • Create coordinate objects
    • Create a custom Map
    • Create a custom TimeSeries
    • Draw a rectangle on a Map
    • Fix incorrect metadata
    • Manipulate grids lines when plotting a Map
    • Specify an observer by coordinate
    • Parse times with parse_time
    • Read an ASDF file into a Map
    • Use the remote data manager
    • Search for multiple wavelengths with Fido
    • Search the Virtual Solar Observatory (VSO)
    • Transform between coordinate frames
    • Query for Solar Orbiter data using the Wavelength attribute
  • Topic Guides
    • Coordinates
      • Calculating Carrington longitude
      • Differential rotation using coordinate frames
      • Coordinates with velocity information
      • Coordinates and WCS
      • The role of rsun in coordinate transformations
    • Add a new rotation method to Map
    • Deprecation, Versioning and Release Practices
    • Adding new data sources to Fido
    • Migrating to the new Scraper pattern system in sunpy 6.1
    • How “HISTORY” and “COMMENT” FITS Keys are Handled in sunpy
    • Advanced Installation
    • Logging system
    • Writing a new instrument Map class
    • A Detailed Look at the TimeSeries Metadata
    • The role of “rsun” in sunpy
  • Reference
    • sunpy (sunpy)
      • self_test
      • system_info
      • print_config
    • Coordinates (sunpy.coordinates)
      • get_body_heliographic_stonyhurst
      • get_earth
      • get_horizons_coord
      • propagate_with_solar_surface
      • solar_frame_to_wcs_mapping
      • solar_wcs_frame_mapping
      • transform_with_sun_center
      • BaseHeliographic
      • BaseMagnetic
      • GeocentricEarthEquatorial
      • GeocentricSolarEcliptic
      • GeocentricSolarMagnetospheric
      • Geomagnetic
      • Heliocentric
      • HeliocentricEarthEcliptic
      • HeliocentricInertial
      • HeliographicCarrington
      • HeliographicStonyhurst
      • Helioprojective
      • HelioprojectiveRadial
      • NorthOffsetFrame
      • PlanarScreen
      • RotatedSunFrame
      • SolarMagnetic
      • SphericalScreen
      • SunPyBaseCoordinateFrame
      • get_body_heliographic_stonyhurst
      • get_earth
      • get_horizons_coord
      • get_body
      • get_fov
      • initialize
      • install_frame
      • get_rotation_matrix
      • SpiceBaseCoordinateFrame
      • angular_radius
      • sky_position
      • carrington_rotation_number
      • carrington_rotation_time
      • true_longitude
      • apparent_longitude
      • true_latitude
      • apparent_latitude
      • mean_obliquity_of_ecliptic
      • true_rightascension
      • true_declination
      • true_obliquity_of_ecliptic
      • apparent_rightascension
      • apparent_declination
      • print_params
      • B0
      • L0
      • P
      • earth_distance
      • orientation
      • eclipse_amount
      • get_rectangle_coordinates
      • solar_angle_equivalency
      • get_limb_coordinates
      • get_heliocentric_angle
      • GreatArc
      • SunPyBaseCoordinateFrame
      • BaseHeliographic
      • BaseMagnetic
      • HeliographicStonyhurst
      • HeliographicCarrington
      • Heliocentric
      • Helioprojective
      • HelioprojectiveRadial
      • HeliocentricEarthEcliptic
      • GeocentricSolarEcliptic
      • HeliocentricInertial
      • GeocentricEarthEquatorial
      • Geomagnetic
      • SolarMagnetic
      • GeocentricSolarMagnetospheric
      • BaseScreen
      • SphericalScreen
      • PlanarScreen
      • NorthOffsetFrame
      • RotatedSunFrame
      • solar_wcs_frame_mapping
      • solar_frame_to_wcs_mapping
    • Data (sunpy.data)
      • EARTH_IMAGE
      • manager
      • cache
      • download_all
      • get_test_filepath
      • get_test_data_filenames
      • get_dummy_map_from_header
      • write_header_file_from_image_file
      • Cache
      • DataManager
      • ParfiveDownloader
      • SqliteStorage
      • DownloaderBase
      • DownloaderError
      • ParfiveDownloader
      • StorageProviderBase
      • SqliteStorage
      • InMemStorage
    • Image processing (sunpy.image)
      • resample
      • reshape_image_to_4d_superpixel
      • add_rotation_function
      • affine_transform
    • Input/output (sunpy.io)
      • read_genx
      • read
      • get_header
      • write
      • read_srs
    • Maps (sunpy.map)
      • all_coordinates_from_map
      • all_corner_coords_from_map
      • all_pixel_indices_from_map
      • contains_coordinate
      • contains_full_disk
      • contains_limb
      • contains_solar_center
      • coordinate_is_on_solar_disk
      • is_all_off_disk
      • is_all_on_disk
      • make_hpr_header
      • map_edges
      • on_disk_bounding_coordinates
      • pixelate_coord_path
      • sample_at_coords
      • solar_angular_radius
      • CompositeMap
      • GenericMap
      • MapMetaValidationError
      • MapSequence
      • PixelPair
      • Map
      • make_fitswcs_header
      • get_observer_meta
      • make_heliographic_header
      • make_hpr_header
      • from_helioviewer_project
      • source_stretch
      • ADAPTMap
      • AIAMap
      • CORMap
      • EITL1Map
      • EITMap
      • EUIMap
      • EUVIMap
      • GONGHalphaMap
      • GONGMagnetogramMap
      • GONGSynopticMap
      • HIMap
      • HMIMap
      • HMISynopticMap
      • HXIMap
      • KCorMap
      • LASCOMap
      • MDIMap
      • MDISynopticMap
      • METISMap
      • PHIMap
      • PUNCHMap
      • RHESSIMap
      • SJIMap
      • SOTMap
      • SUITMap
      • SUVIMap
      • SWAPMap
      • SXTMap
      • TRACEMap
      • WISPRMap
      • XRTMap
    • Remote data (sunpy.net)
      • Scraper
      • Fido
      • Time
      • Instrument
      • Wavelength
      • Level
      • ExtentType
      • Sample
      • Detector
      • Resolution
      • Physobs
      • Source
      • Provider
      • AttrAnd
      • AttrOr
      • UnifiedResponse
      • UnifiedDownloaderFactory
      • VSOClient
      • VSOQueryResponseTable
      • Extent
      • Field
      • Pixels
      • Filter
      • Quicklook
      • PScale
      • ADAPTClient
      • AIASynopsisClient
      • EVEClient
      • GBMClient
      • GONGClient
      • GenericClient
      • LYRAClient
      • NOAAIndicesClient
      • NOAAPredictClient
      • NoRHClient
      • QueryResponse
      • RHESSIClient
      • SRSClient
      • SUVIClient
      • XRSClient
      • SatelliteNumber
      • ADAPTFileType
      • ADAPTLonType
      • ADAPTInputSource
      • ADAPTDataAssimilation
      • ADAPTResolution
      • ADAPTVersionYear
      • ADAPTVersionMonth
      • ADAPTEvolutionMode
      • ADAPTHelioData
      • ADAPTRealizations
      • ADAPTMagData
      • Cutout
      • JSOCClient
      • JSOCResponse
      • Keyword
      • Notify
      • PrimeKey
      • Protocol
      • Segment
      • Series
      • Series
      • Protocol
      • Notify
      • Segment
      • PrimeKey
      • Cutout
      • Keyword
      • HEKClient
      • HEKRow
      • HEKTable
      • Contains
      • EventType
      • HEKAttr
      • HEKComparisonParamAttrWrapper
      • SpatialRegion
      • translate_results_to_query
      • vso_attribute_parse
      • H2VClient
      • get_datasets
      • get_observatory_groups
      • CDAWEBClient
      • Dataset
      • HECClient
      • HECResponse
      • Chaincode
      • MaxRecords
      • TableName
      • Dataset
      • Limit
      • SOLARNETClient
      • Tags
      • Target
      • Dataset
      • Limit
      • Target
      • Tags
      • SOARClient
      • SOOP
      • Distance
      • Product
      • Sensor
      • convert_row_to_table
      • QueryResponseColumn
      • BaseQueryResponse
      • QueryResponseRow
      • QueryResponseTable
      • BaseClient
      • QueryResponse
      • GenericClient
      • and
      • or
      • AttrMeta
      • Attr
      • DataAttr
      • DummyAttr
      • SimpleAttr
      • Range
      • AttrAnd
      • AttrOr
      • ValueAttr
      • AttrWalker
      • AttrComparison
      • ComparisonParamAttrWrapper
      • Scraper
      • extract_timestep
      • date_floor
      • get_timerange_from_exdict
    • Physics (sunpy.physics)
      • solar_rotate_coordinate
      • differential_rotate
    • Solar properties (sunpy.sun)
      • get
      • find
      • print_all
      • spectral_classification
      • au
      • mass
      • equatorial_radius
      • volume
      • surface_area
      • average_density
      • equatorial_surface_gravity
      • effective_temperature
      • luminosity
      • mass_conversion_rate
      • escape_velocity
      • sfu
      • average_angular_size
      • sidereal_rotation_rate
      • first_carrington_rotation
      • mean_synodic_period
      • differential_rotation
      • interior
      • evolution
    • Time (sunpy.time)
      • find_time
      • is_time
      • is_time_equal
      • is_time_in_given_format
      • julian_centuries
      • parse_time
      • TimeRange
      • TimeTaiSeconds
      • TimeUTime
    • Timeseries (sunpy.timeseries)
      • TimeSeriesMetaData
      • GenericTimeSeries
      • TimeSeries
      • ESPTimeSeries
      • EVESpWxTimeSeries
      • GBMSummaryTimeSeries
      • XRSTimeSeries
      • LYRATimeSeries
      • NOAAIndicesTimeSeries
      • NOAAPredictIndicesTimeSeries
      • NoRHTimeSeries
      • RHESSISummaryTimeSeries
    • Utilities (sunpy.util)
      • cached_property_based_on
      • check_arithmetic_compatibility
      • deprecated
      • deprecated_renamed_argument
      • dict_keys_same
      • expand_list
      • expand_list_generator
      • extent_in_other_wcs
      • find_dependencies
      • fix_duplicate_notes
      • get_keywords
      • get_set_methods
      • get_width
      • grid_perimeter
      • hash_file
      • missing_dependencies_by_extra
      • replacement_filename
      • sunpycontextmanager
      • system_info
      • unique
      • warn_connection
      • warn_deprecated
      • warn_metadata
      • warn_user
      • MetaDict
      • NoMapsInFileError
      • SunpyConnectionWarning
      • SunpyDeprecationWarning
      • SunpyMetadataWarning
      • SunpyPendingDeprecationWarning
      • SunpyUserWarning
      • SunpyWarning
      • add_common_docstring
      • load_config
      • copy_default_config
      • print_config
      • BasicRegistrationFactory
      • NoMatchError
      • MultipleMatchError
      • ValidationFunctionError
      • parse_header
      • slugify
      • get_content_disposition
      • get_filename
      • get_system_filename
      • download_file
      • download_fileobj
      • xml_to_dict
      • node_to_dict
      • get_node_text
      • NotTextNodeError
      • Generate
      • seconddispatch
    • Visualization (sunpy.visualization)
      • axis_labels_from_ctype
      • peek_show
      • show_hpr_impact_angle
      • show_colormaps
      • aia_color_table
      • sswidl_lasco_color_table
      • eit_color_table
      • sxt_color_table
      • xrt_color_table
      • trace_color_table
      • sot_color_table
      • hmi_mag_color_table
      • suvi_color_table
      • rhessi_color_table
      • std_gamma_2
      • euvi_color_table
      • solohri_lya1216_color_table
      • suit_color_table
      • punch_color_table
      • metis_color_table
      • MapSequenceAnimator
      • is_wcsaxes
      • gca_wcs
      • get_world_transform
      • default_wcs_grid
      • wcsaxes_heliographic_overlay
      • limb
      • equator
      • prime_meridian
      • extent
    • Customizing sunpy
    • Troubleshooting and Bugs
    • SSWIDL/sunpy Cheat Sheet
    • Internal API Documentation
      • read_file
      • read_file_header
      • write_file
      • detect_filetype
      • FileHeader
      • header_to_fits
      • read
      • get_header
      • write
      • extract_waveunit
      • format_comments_and_history
      • read
      • get_header
      • write
  • Release History
    • Full Changelog
    • What’s New in sunpy 8.1?
    • What’s New in sunpy 8.0?
    • What’s New in sunpy 7.1?
    • What’s New in sunpy 7.0?
    • What’s New in sunpy 6.1?
    • What’s New in sunpy 6.0?
    • What’s New in sunpy 5.1?
    • What’s New in sunpy 5.0?
    • What’s New in sunpy 4.1?
    • What’s New in SunPy 4.0?
    • What’s New in SunPy 3.1?
    • What’s New in SunPy 3.0?
    • What’s New in SunPy 2.1?
    • What’s New in SunPy 2.0?
    • What’s New in SunPy 1.1?
    • What’s New in SunPy 1.0?
    • What’s New in SunPy 0.9?
    • What’s New in SunPy 0.8?
  • Acknowledging or Citing SunPy
  • Known Issues
  • Bibliography
  • Current status of sub-packages
  • Developer’s Guide
    • Newcomers’ Guide
    • Pull Request Check List
    • Using conda for Development Dependencies
    • AI Usage
    • Coding Standards
    • Testing Guidelines
    • Documentation
    • Example Gallery
    • Pull Requests and GitHub Teams
    • Use of quantities and units
    • Workflow for Maintainers
    • Extra Packages and Groups
    • What runs on our Continuous Integration
    • Making Changes to Released Versions
    • Submodule and funding
    • sunpy’s Public API
    • Logging, Warnings, and Exceptions
    • Tests using the Remote Data Manager
    • SOAR Client Developer Guide
      • How data is retrieved from the SOAR
      • Tables supported in SOARClient
      • Request methods SOARClient supports
  • Developer’s Guide
  • Example Gallery

Example Gallery#

The purpose of the page is to describe the contribution guidelines for the sunpy Example Gallery.

All potential contributors to the sunpy example gallery should read and abide by the following guidelines.

Contribution Guidelines#

  • The title of the example should be short yet descriptive and emphasize the goal of the example. Try to make the title appeal to a broad audience and avoid referencing a specific instrument, catalog, or anything wavelength dependent.

  • Each example should begin with a paragraph that gives a brief overview of the entire example, including relevant astronomy concepts, and motivates the described functionality.

  • The examples must be compatible with the versions supported by the last major release of the sunpy core package.

  • All the examples must be fully PEP8 compliant, the pre-commit hook should be used to ensure this.

  • Wherever possible, the examples should include linked references with links pointing to the appropriate DOI or ADS entry.

  • The example should include links (URL or sphinx intersphinx) to relevant documentation pages.

  • Each example should, where possible, include at least one image, map, or plot to use as the icon in the example gallery.

  • The examples should avoid using acronyms without defining them first (e.g. Virtual Solar Observatory, or VSO). Similarly complex jargon should be avoided unless clearly explained.

  • There should be a good variety of examples for each section (simple and more complex to cater for different levels).

  • When creating a plot, particularly of a map, the example should follow these rules of thumb to minimize verbosity and maintain consistency with the other gallery examples:

    • Do not use peek in examples. Instead, use plot.

    • Always create a figure instance using plt.figure() prior to creating a plot.

    • Always create an Axes instance, and where possible use this to modify the plot instead of using the pyplot interface (for example use ax.set_xlabel()` instead of plt.xlabel()).

    • If an axes instance is created, it should be explicitly passed as a keyword argument wherever possible (e.g. in plot or draw_grid).

    • At the end of the example, call plt.show(). While not explicitly needed for the gallery to render, this ensures that when run as a script, the plots will appear.

    • If you need to use astropy.visualization.{quantity_support, time_support}, import these functions at the top of the example, and call them directly before the first plot that needs them.

We recommend checking the other examples in the gallery to see how they are structured and what they contain.

Tagging Examples#

All our examples in the gallery are tagged with one or more tags describing what topics the example covers. A list of tags looks like this:

# sphinx_gallery_tags = ["Map", "Coordinates", "AIA"]

The tags we add to examples are:

  • Instruments or sources of any data used i.e. "AIA", "EUVI", "ADAPT".

  • Category of SunPy functionality i.e. "Map", "Timeseries", "Coordinates", "Reproject".

  • Data provider where appropriate i.e. "JSOC", "HEK" these should be the focus of an example.

  • Science topic, such as "Flares", "Active Regions".

  • "Visualization" should be added to examples where the focus of the example is learning visualization techniques.

Tags should be formatted to be human readable, so should be Title Case and make use of symbols such as &. Adding a tag which hasn’t already been added should be done thoughtfully.

Building the Gallery#

If you are authoring gallery examples and wish to preview them you can use tox:

tox -e build_docs-gallery

The documentation build is quite time consuming, but both sphinx and sphinx-gallery will cache outputs so subsequent runs should be faster.

It’s also possible to only execute a single gallery example (or pattern of examples) like this:

tox -e build_docs-gallery -D sphinx_gallery_conf.filename_pattern=filename\.py

previous

Documentation

next

Pull Requests and GitHub Teams

On this page
  • Contribution Guidelines
  • Tagging Examples
  • Building the Gallery

© Copyright 2026, The SunPy Community.

Code • Forum • Chat

Built with Sphinx 9.1.0.