Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add draw_contours + assume_spherical_screen example #6506

@wtbarnes

Description

@wtbarnes

Due to how it is used in our example gallery, there may be a misconception that assume_spherical_screen can only be used with reprojection, when in fact it can be useful any time you're performing a coordinate transformation. In particular, we should add a gallery example that shows how to use this in combination with draw_contours, e.g.

import sunpy.map
from sunpy.coordinates import Helioprojective
import matplotlib.pyplot as plt
import sunpy.data.sample
import astropy.units as u

aia193 = sunpy.map.Map(sunpy.data.sample.AIA_193_IMAGE)
aia171 = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)

fig= plt.figure(figsize=(10, 5))
ax1 = fig.add_subplot(1,2,1,projection=aia171)
aia171.plot(axes=ax1, clip_interval=(1,99.9)*u.percent)
aia171.draw_contours(levels=[1,5]*u.percent, axes=ax1, colors='C0')
ax1.set_title("171 Contours on 171")

ax2 = fig.add_subplot(1,2,2,projection=aia193)
aia193.plot(axes=ax2)
with Helioprojective.assume_spherical_screen(aia171.observer_coordinate):
    aia171.draw_contours(levels=[1,5]*u.percent, axes=ax2, colors='C2')
ax2.set_title("171 Contours on 193")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Effort MediumRequires a moderate time investment.ExamplesRelated to the Example Gallery.Package NoviceRequires little technical knowledge of the package.Priority LowRapid action not required.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions