Querying PUNCH Data#

A notebook guide to querying and loading PUNCH data using SunPy.

This notebook provides a guide on how to use tools to query PUNCH data from the VSO / SDAC using Python tools, and how to load and display this data using SunPy.

Load libraries

from sunpy.map import Map
from sunpy.net import Fido
from sunpy.net import attrs as a

Data querying#

With a range of dates and a PUNCH instrument in mind, we can begin querying data. Here we’ll consider data from the first two minutes of the first of June, and focus on data from WFI-2 only.

We can construct a query using the Fido tool, specifying search attributes:

time_range = a.Time('2025/06/01 00:00:00', '2025/06/01 00:02:00')
result = Fido.search(time_range, a.Instrument('WFI-2'))
result
Results from 1 Provider:

8 Results from the VSOClient:
VSOQueryResponseTable length=8
Start TimeEnd TimeInstrumentWavelengthProviderPhysobsWavetypeExtent XExtent YExtent WidthExtent LengthExtent TypeSize
nmMibyte
TimeTimestr5float64[2]str10str9str7str7str7str17str16str11float64
2025-06-01 00:00:17.0002025-06-01 00:00:41.000WFI-2530.0 .. 530.0SDAC_PUNCHintensityvisible19.667314.47310.19555555284023350.0622215270996FAR_OFF_SUN1.51074
2025-06-01 00:00:17.0002025-06-01 00:00:41.000WFI-2530.0 .. 530.0SDAC_PUNCHintensityvisible18.872614.76810.78222221136093150.0622215270996FAR_OFF_SUN6.30371
2025-06-01 00:00:29.0002025-06-01 00:00:41.000WFI-2530.0 .. 530.0SDAC_PUNCHintensityvisible19.667314.47310.19555555284023350.0622215270996FAR_OFF_SUN1.51074
2025-06-01 00:00:29.0002025-06-01 00:00:41.000WFI-2530.0 .. 530.0SDAC_PUNCHintensityvisible18.961514.70910.78222221136093150.0622215270996FAR_OFF_SUN6.64941
2025-06-01 00:00:29.0002025-06-01 00:00:41.000WFI-2530.0 .. 530.0SDAC_PUNCHintensityvisible18.961514.70910.78222221136093150.0622215270996FAR_OFF_SUN6.30859
2025-06-01 00:00:29.0002025-06-01 00:00:41.000WFI-2530.0 .. 530.0SDAC_PUNCHintensityvisible19.667314.47310.19555555284023350.0622215270996FAR_OFF_SUN1.51074
2025-06-01 00:00:29.0002025-06-01 00:00:41.000WFI-2530.0 .. 530.0SDAC_PUNCHintensityvisible18.961314.70920.78222221136093150.0622215270996FAR_OFF_SUN6.68262
2025-06-01 00:00:29.0002025-06-01 00:00:41.000WFI-2530.0 .. 530.0SDAC_PUNCHintensityvisible19.667314.47310.19555555284023350.0622215270996FAR_OFF_SUN1.51367



This results in a table of available data products that match the search criteria. Next, let’s download the first file from this list of results:

files = Fido.fetch(result[0][0])
Files Downloaded:   0%|          | 0/1 [00:00<?, ?file/s]

PUNCH_L0_CR2_20250601000029_v0a.fits:   0%|          | 0.00/1.58M [00:00<?, ?B/s]

PUNCH_L0_CR2_20250601000029_v0a.fits:   7%|▋         | 104k/1.58M [00:00<00:01, 1.04MB/s]


Files Downloaded: 100%|██████████| 1/1 [00:00<00:00,  2.08file/s]
Files Downloaded: 100%|██████████| 1/1 [00:00<00:00,  2.07file/s]

This returns a list of paths to files that have been downloaded. Note that the Fido.fetch tool can specify a particular download directory for larger data searches. With that file downloaded, we can load it into a SunPy map object, and display it.

map = Map(files[0])
map.peek()
PUNCH - WFI-2 $530 \; \mathrm{nm}$ 2025-06-01 00:00:29

And that’s it! From here the data is encapsulated into a SunPy map object, which supports that framework for plotting, coordinate transformations, etc.

Of course this is just one path, you could always load the data using Astropy fits tools, load it into an NDCube, or any other FITS-compliant tool.

Total running time of the script: (0 minutes 12.024 seconds)

Gallery generated by Sphinx-Gallery