SciPy / Austin, TX / 12 July 2023
AU/NASA GSFC
BAERI/LMSAL
NASA GSFC
Aperio Software
Image Credit: NASA APOD/Reinhold Wittich
sunpy
!“The community-developed, free and open-source solar data analysis environment for Python.”
sunpy
from sunpy.net import Fido, attrs as a
import astropy.units as u
1query = Fido.search(
a.Time('2018-05-29 18:00', '2018-05-29 18:00:10'),
a.Wavelength(171*u.angstrom),
a.Instrument.aia
)
print(query)
Results from 1 Provider:
1 Results from the VSOClient:
Source: http://vso.stanford.edu/cgi-bin/search
Total estimated size: 67.789 Mbyte
Start Time End Time Source ... Extent Type Size
... Mibyte
----------------------- ----------------------- ------ ... ----------- --------
2018-05-29 18:00:09.000 2018-05-29 18:00:10.000 SDO ... FULLDISK 64.64844
2files = Fido.fetch(query, path='data/{instrument}')
print(files)
data/AIA
.
['data/AIA/aia_lev1_171a_2018_05_29t18_00_09_35z_image_lev1.fits']
sunpy
sunpy
AIA
171.0 Angstrom
2018-05-29T18:00:09.350
<SkyCoord (HeliographicStonyhurst: obstime=2018-05-29T18:00:09.350, rsun=696000.0 km): (lon, lat, radius) in (deg, deg, m)
(0.00562552, -0.97774891, 1.51600359e+11)>
PixelPair(x=<Quantity 1425.73662106 pix>, y=<Quantity 2049.01122848 pix>)
sunpy
from sunpy.coordinates import propagate_with_solar_surface
m_seq = sunpy.map.Map('data/sequence/*.fits', sequence=True)
fig = plt.figure(figsize=(16, 4))
for i, m in enumerate(m_seq):
ax = fig.add_subplot(1, len(m_seq), i+1, projection=m)
m.plot(axes=ax)
with propagate_with_solar_surface():
blc = m_cutout.bottom_left_coord.transform_to(m.coordinate_frame)
trc = m_cutout.top_right_coord.transform_to(m.coordinate_frame)
m.draw_quadrangle(blc, top_right=trc)
sunpy
with propagate_with_solar_surface():
m_seq_aligned = sunpy.map.Map([m.reproject_to(m_cutout.wcs) for m in m_seq], sequence=True)
fig = plt.figure(figsize=(16, 4))
for i, m in enumerate(m_seq_aligned):
ax = fig.add_subplot(1,len(m_seq_aligned), i+1, projection=m)
m.plot(axes=ax, cmap='sdoaia171', title=m_seq[i].date)
Map
objects is difficult
Map
objects backed by Dask arrays is awkward
Map
does not have “first-class” support for S3 URLsMap
methods still require “eager” execution
@dask.delayed
functions that reimplement existing methodsxarray
and WCS approaches to coordinates systemsastropy.units
and Dask
Quantity
backed by a Dask arrayQuantity
objectssunpy
+ dask
= Science result from L1 data in minutes