hands-on.md 20.4 KB
Newer Older
Eric Buchlin's avatar
Eric Buchlin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Solar Orbiter school, Les Houches
## Remote-sensing data hands-on session
### Éric Buchlin, 2021-04-08


## Pre-requisites

* Up-to-date web browser
* [JHelioViewer](http://www.jhelioviewer.org/), version [4.0.0](http://swhv.oma.be/download/) or [4.0.1 (beta)](http://swhv.oma.be/download_test/). It runs with Java, but Java is already bundled with JHelioViewer in these versions.
<!-- TODO 4.0.0 or 4.0.1? -->
* Python with the following libraries installed (or recently updated):
    * [sunpy](https://sunpy.org/).
    * [astropy](https://www.astropy.org/) (should be installed automatically as a sunpy dependency)
    * [python_soar](https://github.com/dstansby/sunpy-soar)
* A FITS file viewer: [SAOImageDS9](https://sites.google.com/cfa.harvard.edu/saoimageds9), [fv](https://heasarc.gsfc.nasa.gov/ftools/fv/)...

Any issues installing these tools?


## Participants' requests for the RS hands-on

* Data access
    * [X] EUI
24
    * [ ] STIX (see Andrea Battaglia's presentation)
Eric Buchlin's avatar
Eric Buchlin committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
    * [ ] PHI, Metis, SoloHI, SPICE: no publicly-available data yet
* [X] visualization
* [ ] attitude/pointing, SPICE kernels → mentioned in IS hands-on?
    * [X] align SO data with data from other instruments
* [ ] composition diagnostics with SPICE → not ready yet
* [X] search specific events → HEK
    * [X] searching at specific events with different instrument data → VSO
* [ ] tracing connectivity → connectivity hands-on
* [X] JHelioViewer for SO → SOAR/SAMP
* [X] Sunpy for SO


## Find data

Solar remote sensing data are redistributed through archives, such as:

* [JSOC](http://jsoc.stanford.edu/) (LMSAL) for SDO AIA and HMI
* [SDC](http://sdc.uio.no/sdc/) (Univ. Oslo) for Hinode and IRIS
* [MEDOC](http://medoc.ias.u-psud.fr) (CNRS/Univ. Paris-Saclay/CNES) for SOHO, STEREO, SDO...
* [SOAR](http://soar.esac.esa.int/soar/) is the ESA archive for Solar Orbiter.

Each archive has different kinds of web interfaces and APIs (Application Programming Interfaces).

But they also (try to) follow standards (e.g. from [IVOA](https://www.ivoa.net/): International Virtual Observatory Alliance) that allow to query them with common tools. 

We will concentrate on the archives and tools that (will) work for Solar Orbiter data.


### Using SOAR (web interface)

The SOAR is the ESA archive, and so the primary archive, for Solar Orbiter data.

Among remote-sensing instruments, at the moment only EUI has data on the SOAR, so we will demonstrate the SOAR with EUI data.

* Go to the [SOAR web page](http://soar.esac.esa.int/soar/)

![SOAR screenshot](./fig/screenshot-soar-01.png)

* Click on [Search](http://soar.esac.esa.int/soar/#search)

![SOAR screenshot](./fig/screenshot-soar-02.png)

* Select:
    * date range: day of 2020-05-30
        * When are data available? Tools are still in development. One possibility we already have is David Stansby's [SODA](https://www.davidstansby.com/soda/)
    * instrument: EUI
    * processing level: L2
* Click on "Search"

![SOAR screenshot](./fig/screenshot-soar-03.png)

* Click on the magnifying glass to see a file details
* Click on the download button to download a file
* Select several files and click on the download button at the top of the table to download several files.
* Open the FITS file in a FITS viewer.

![SOAR screenshot](./fig/screenshot-soar-04.png)

* Keep this tab open for later.


### VSO

VSO is the Virtual Solar Observatory, offering a unified access to different archives, thanks to the VO standards. The VSO does not include Solar Orbiter data yet, but this will change in the future, and it can be useful anyway for accessing other remote-sensing data, this why we will demonstrate it now.

We will first use the [VSO search form](http://vso.stanford.edu/cgi-bin/search).

* First we need to select what the types of fields that we want in the query form: we select time, observable, spectral range.

![VSO screenshot](./fig/screenshot-vso-01.png)

* Select "intensity", "extreme-UV", from 2020-05-30T00:00 to 2020-05-31T00:00, and click on "Search"

![VSO screenshot](./fig/screenshot-vso-02.png)

<!-- TODO I get no result... -->


### MEDOC

[MEDOC](http://medoc.ias.u-psud.fr) includes data from SOHO, STEREO, SDO... and will also include the Solar Orbiter remote-sensing data.

* Access the main [web interface](https://idoc-medoc.ias.u-psud.fr/)
* View the available data set with the menu Explore data → Dataset graphic tree

![MEDOC screenshot](./fig/screenshot-medoc-01.png)

* Query some data, using the magnifying glass icon in the data set tree, or using one of the items in the Search forms menu.

![MEDOC screenshot](./fig/screenshot-medoc-02.png)


### Programmatic access: using APIs

Web interfaces are nice, but are not enough:

* when you need specific search criteria not included in the query forms,
* to automate data download and analysis,
* to analyse large data sets.

Most archives and all VOs have APIs, thus allowing queries and access to data through a programme, for example:

* [SOAR](http://soar.esac.esa.int/soar/) has a TAP (Table Access Protocol) server (TAP is an IVOA protocol): click on the "programmatic access" icon in the left icon menu for details.

![SOAR screenshot](./fig/screenshot-soar-05.png)

* [MEDOC](http://medoc.ias.u-psud.fr): [pySiTools](https://git.ias.u-psud.fr/medoc/PySitools2)
* VSO: [API](https://vso.nascom.nasa.gov/API/VSO_API.html)

We are not going to look at each of them... But SunPy has a nice Python interface (called [Fido](https://docs.sunpy.org/en/stable/guide/acquiring_data/fido.html), for Federated Internet Data Obtainer) to many data sets, through different archives and VOs.

We will start by trying Fido for SDO/AIA:

```python
import astropy.units as u
from sunpy.net import Fido, attrs as a

# Attributes allow us to specify the search parameters
time_range = a.Time("2020-05-30T14:58", "2020-05-30T14:59")
instrument = a.Instrument.aia
channel = a.Wavelength(171 * u.angstrom) | a.Wavelength(211 * u.angstrom)
# Use attributes to search
result = Fido.search(time_range, instrument, channel)
print(result)
# download the 171Å files
downloaded_files = Fido.fetch(result[0], path="/tmp/{file}")
```

```
Results from 2 Providers:

5 Results from the VSOClient:
       Start Time               End Time        Source Instrument ...  Physobs  Provider   Size   Wavetype
                                                                  ...                     Mibyte          
----------------------- ----------------------- ------ ---------- ... --------- -------- -------- --------
2020-05-30 14:58:09.000 2020-05-30 14:58:10.000    SDO        AIA ... intensity     JSOC 64.64844   NARROW
2020-05-30 14:58:21.000 2020-05-30 14:58:22.000    SDO        AIA ... intensity     JSOC 64.64844   NARROW
2020-05-30 14:58:33.000 2020-05-30 14:58:34.000    SDO        AIA ... intensity     JSOC 64.64844   NARROW
2020-05-30 14:58:45.000 2020-05-30 14:58:46.000    SDO        AIA ... intensity     JSOC 64.64844   NARROW
2020-05-30 14:58:57.000 2020-05-30 14:58:58.000    SDO        AIA ... intensity     JSOC 64.64844   NARROW

5 Results from the VSOClient:
       Start Time               End Time        Source Instrument ...  Physobs  Provider   Size   Wavetype
                                                                  ...                     Mibyte          
----------------------- ----------------------- ------ ---------- ... --------- -------- -------- --------
2020-05-30 14:58:09.000 2020-05-30 14:58:10.000    SDO        AIA ... intensity     JSOC 64.64844   NARROW
2020-05-30 14:58:21.000 2020-05-30 14:58:22.000    SDO        AIA ... intensity     JSOC 64.64844   NARROW
2020-05-30 14:58:33.000 2020-05-30 14:58:34.000    SDO        AIA ... intensity     JSOC 64.64844   NARROW
2020-05-30 14:58:45.000 2020-05-30 14:58:46.000    SDO        AIA ... intensity     JSOC 64.64844   NARROW
2020-05-30 14:58:57.000 2020-05-30 14:58:58.000    SDO        AIA ... intensity     JSOC 64.64844   NARROW


Files Downloaded:   0%|                                                                         | 0/5 [00:00<?, ?file/s]
aia_lev1_171a_2020_05_30t14_58_09_35z_image_lev1.fits:  33%|███████▊                | 3.77M/11.6M [00:08<00:12, 600kB/s]
aia_lev1_171a_2020_05_30t14_58_21_35z_image_lev1.fits:  79%|██████████████████▏    | 9.12M/11.6M [00:08<00:02, 1.06MB/s]
aia_lev1_171a_2020_05_30t14_58_33_34z_image_lev1.fits:  35%|████████▎               | 4.02M/11.6M [00:08<00:11, 651kB/s]
aia_lev1_171a_2020_05_30t14_58_45_35z_image_lev1.fits:  85%|███████████████████▍   | 9.78M/11.6M [00:08<00:00, 2.05MB/s]
aia_lev1_171a_2020_05_30t14_58_57_35z_image_lev1.fits:  32%|███████▍               | 3.71M/11.6M [00:08<00:06, 1.19MB/s]
```

```python
# plot a map
from sunpy.map import Map
import matplotlib.pyplot as plt

m_aia = Map(downloaded_files[0])
m_aia.plot()
plt.colorbar()
plt.show()
```

![Sunpy screenshot](./fig/screenshot-sunpy-01.png)


Sunpy/Fido does not officially yet include access to Solar Orbiter data, but it will soon. In the meantime, there is already the additional Python package `python_soar` developed by David Stansby that allows to get a taste of what Python access to Solar Orbiter will be (again, there is only EUI in the SOAR at the moment).

```python
# Importing sunpy_soar registers the client with sunpy
import sunpy_soar
from sunpy_soar.attrs import Identifier

# Create search attributes
instrument = a.Instrument("EUI")
time = a.Time("2020-05-30", "2020-05-31")
level = a.Level(2)
identifier = Identifier("EUI-HRIEUV174-IMAGE")

# Do search
result = Fido.search(instrument, time, level, identifier)
print(result)
```

```
Results from 1 Provider:

50 Results from the SOARClient:
Instrument     Data product    Level        Start time               End time
---------- ------------------- ----- ----------------------- -----------------------
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:58:05.728 2020-05-31 14:58:05.728
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:58:00.717 2020-05-31 14:58:00.717
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:57:55.706 2020-05-31 14:57:55.706
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:57:50.696 2020-05-31 14:57:50.696
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:57:45.685 2020-05-31 14:57:45.685
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:57:40.673 2020-05-31 14:57:40.673
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:57:35.662 2020-05-31 14:57:35.662
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:57:30.651 2020-05-31 14:57:30.651
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:57:15.617 2020-05-31 14:57:15.617
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:57:10.605 2020-05-31 14:57:10.605
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:57:05.594 2020-05-31 14:57:05.594
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:57:00.583 2020-05-31 14:57:00.583
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:56:55.572 2020-05-31 14:56:55.572
       ...                 ...   ...                     ...                     ...
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:54:55.306 2020-05-31 14:54:55.306
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:54:50.294 2020-05-31 14:54:50.294
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:54:45.284 2020-05-31 14:54:45.284
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:54:40.273 2020-05-31 14:54:40.273
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:54:35.262 2020-05-31 14:54:35.262
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:54:30.251 2020-05-31 14:54:30.251
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:54:25.240 2020-05-31 14:54:25.240
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:54:20.229 2020-05-31 14:54:20.229
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:54:15.219 2020-05-31 14:54:15.219
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:54:10.207 2020-05-31 14:54:10.207
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:54:05.196 2020-05-31 14:54:05.196
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:54:00.185 2020-05-31 14:54:00.185
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:57:25.640 2020-05-31 14:57:25.640
       EUI EUI-HRIEUV174-IMAGE    L2 2020-05-30 14:57:20.629 2020-05-31 14:57:20.629
Length = 50 rows
```

```python
# Download files (1 in 10)
downloaded_files = Fido.fetch(result[0][::10], path="/tmp/{file}")
print(downloaded_files)
```

```
['/tmp/solo_L2_eui-hrieuv174-image_20200530T145705594_V01.fits', '/tmp/solo_L2_eui-hrieuv174-image_20200530T145435262_V01.fits', '/tmp/solo_L2_eui-hrieuv174-image_20200530T145805728_V01.fits', '/tmp/solo_L2_eui-hrieuv174-image_20200530T145525372_V01.fits', '/tmp/solo_L2_eui-hrieuv174-image_20200530T145615482_V01.fits']
```

```python
# plot first map
m_hri = Map(downloaded_files[0])
m_hri.plot()
Eric Buchlin's avatar
Eric Buchlin committed
268
m_hri.draw_grid()
Eric Buchlin's avatar
Eric Buchlin committed
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
plt.colorbar()
plt.show()
```

![Sunpy screenshot](./fig/screenshot-sunpy-02.png)

```python
# The Map embarks the WCS (World Coordinate System) information
print(m_hri.wcs)
```

```
WCS Keywords

Number of WCS axes: 2
CTYPE : 'HPLN-TAN'  'HPLT-TAN'  
CRVAL : -0.045345021731727  0.035532774863427  
CRPIX : 1024.5  1024.5  
PC1_1 PC1_2  : 0.99643596675095  -0.08435261800977  
PC2_1 PC2_2  : 0.08435261800977  0.99643596675095  
CDELT : 0.00013666666666667  0.00013666666666667  
NAXIS : 0  0
```

```python
# Get the heliographic position of the field-of-view center
# (which is the reference pixel)
print(m_hri.reference_pixel)
print(m_hri.reference_coordinate)
```

```
PixelPair(x=<Quantity 1023.5 pix>, y=<Quantity 1023.5 pix>)
<SkyCoord (Helioprojective: obstime=2020-05-30T14:58:05.728, rsun=695700000.0 m, observer=<HeliographicStonyhurst Coordinate (obstime=2020-05-30T14:58:05.728): (lon, lat, radius) in (deg, deg, m)
    (31.1495164, 4.2176466, 8.3113519e+10)>): (Tx, Ty) in arcsec
    (-163.24207823, 127.91798951)>
```

```python
# EUI-HRI FOV center in the SDO/AIA helioprojective coordinates
from sunpy.coordinates import frames
print(
    m_hri.reference_coordinate.transform_to(
        frames.Helioprojective(observer=m_aia.observer_coordinate)
    )
)
```

```
<SkyCoord (HeliographicStonyhurst: obstime=2020-05-30T14:58:05.728): (lon, lat, radius) in (deg, deg, m)
    (31.1495164, 4.2176466, 8.3113519e+10)>
```

```python
# Plot the EUI-HRI FOV on the AIA map
import numpy as np
from sunpy.map import map_edges
ax = plt.subplot(projection=m_aia)
m_aia.plot()
hri_edges_pix = map_edges(m_hri)   # pixel coordinates on each of the 4 edges
hri_edges_coord = (m_hri.pixel_to_world(*(edge.T)) for edge in hri_edges_pix)
for edge in hri_edges_coord:
    ax.plot_coord(edge, 'b')
plt.colorbar()
plt.show()
```

![Sunpy screenshot](./fig/screenshot-sunpy-03.png)

### Finding a specific Solar Orbiter observation

Intrument teams have internal cataloging tools (I don't know of anything public yet), you can contact them with specific requests.


### Search for specific events

If you are looking for "events" (filaments, eruptions, active regions, coronal holes...) with some specific properties, you can use the Heliophysics Events Knowledgebase (HEK) (nothing from Solar Orbiter there yet).

One of the HEK interfaces is [iSolSearch](https://www.lmsal.com/isolsearch):

* Select and date range and some event types.
* Click on the events, as displayed on the solar disk, or in the list on the right

![HEK screenshot](./fig/screenshot-hek-01.png)

* View a movie of the event, and the event properties.


The HEK is also available from HelioViewer (see below), [from SunPy](https://docs.sunpy.org/en/stable/guide/acquiring_data/hek.html), from [SolarSoft](https://www.lmsal.com/hek/api.html#ontology)... and of course all this is using the [HEK API](http://solar.stanford.edu/hekwiki/ApplicationProgrammingInterface).

## Preview data

### helioviewer.org

helioviewer.org is a web app to explore and visualize solar images. It is part of the HelioViewer system, composed of servers (GSFC, IAS/MEDOC, ROB), including an API, and clients (helioviewer.org, JHelioViewer, SSW/SunGlobe, `sunpy.net.helioviewer`...).

The helioviewer.org client is of course accessible from [https://helioviewer.org/](https://helioviewer.org/) but also from its [IAS/MEDOC mirror](https://helioviewer.ias.u-psud.fr/).

* Go to [IAS/MEDOC helioviewer.org](https://helioviewer.ias.u-psud.fr/) or [helioviewer.org](https://helioviewer.org)
* Select or add layers, e.g.:
    * SDO / AIA / 193
    * SDO / HMI / magnetogram
    * SOHO / LASCO / C2
* Play with the layer opacities, the image scale, the dates, the option to display difference images...

![helioviewer.org screenshot](./fig/screenshot-helioviewer-01.png)

* Create a movie
* Request science data



### JHelioViewer

JHelioViewer is a Java client for the HelioViewer servers. It offers many more possibilities than the web client.

* Launch JHelioViewer

![JHelioViewer screenshot](./fig/screenshot-jhv-01.png)

* Select a time interval, 2020-05-30T00:00:00 to 2020-05-31T00:00:00
* Add a layer: STEREO A/EUVI 171
* Add a layer: SDO/AIA 171
* Add a layer: SOHO/LASCO C2
* Display PFSS model
* Play movie
* Pan / rotate / zoom...
* Change layers opacities, blend, color maps, ordering...

![JHelioViewer screenshot](./fig/screenshot-jhv-02.png)

* Select a layer, and reset the camera for this layer
* Track features
* Try multi-view
* Try different projections

![JHelioViewer screenshot](./fig/screenshot-jhv-03.png)

![JHelioViewer screenshot](./fig/screenshot-jhv-04.png)

* Display events from the Space Weather Events Knowledgebase / Heliophysics Events Knowledgebase.

![JHelioViewer screenshot](./fig/screenshot-jhv-05.png)

* Leave JHelioViewer open on this time range with at least the SDO/AIA 171 layer


### SO from SOAR in JHelioViewer via SAMP

SAMP (Simple Application Messaging Protocol) is also an [IVOA protocol](https://www.ivoa.net/documents/SAMP/). It allows astronomy software to interoperate and communicate, to share data between different tools. In particular, it can be used to view SO data from the SOAR in JHelioViewer:

* Go back to the browser tab we left open for SOAR (query results)
* Select the first HRI-EUV-174 line
* Click on the "Send via SAMP" button
* Authorize the SAMP connection 

![SOAR/SAMP screenshot](./fig/screenshot-samp-01.png)

* In JHelioViewer, wait for the EUI image to load and adjust levels / opacity / blend.

![JHV/SAMP screenshot](./fig/screenshot-samp-02.png)



## Open FITS files

We have already seen several ways to open FITS files, for viewing or for analysis:

* A FITS file viewer like ds9 or fv
* Reading it into a `sunpy.map.Map` object.

As SO remote-sensing instruments data files are regular FITS files, they can normally be opended using any FITS library, in any language. For example, take one of the FITS files you have downloaded before, and, with [`astropy.io.fits`](https://docs.astropy.org/en/stable/io/fits/index.html):

```python
from astropy.io import fits
# change to your FITS file name
filename = "solo_L2_eui-hrieuv174-image_20200530T145435262_V01.fits"
hdulist = fits.open(filename)
hdulist.info()
```

```
Filename: solo_L2_eui-hrieuv174-image_20200530T145435262_V01.fits
No.    Name      Ver    Type      Cards   Dimensions   Format
  0  PRIMARY       1 PrimaryHDU     212   (2048, 2048)   float32   
```

```python
# print header
print(hdulist[0].header)
```

```
SIMPLE  =                    T / conforms to FITS standard
BITPIX  =                  -32 / array data type
NAXIS   =                    2 / number of array dimensions
NAXIS1  =                 2048
NAXIS2  =                 2048
LONGSTRN= 'OGIP 1.0'           / The OGIP long string convention may be used
COMMENT --------- General Description: -----------------------------------------
FILENAME= 'solo_L2_eui-hrieuv174-image_20200530T145435262_V01.fits' / FITS filen
DATE    = '2020-12-03T16:29:46.989' / [UTC] FITS file creation date
(...)
```

```python
import matplotlib.pyplot as plt
from astropy.wcs import WCS

# simple imshow of the data
#plt.imshow(hdulist[0].data, origin="lower")
#plt.show()

# or, better, using the WCS keywords to get the frame right
wcs = WCS(hdulist[0])   # warning about CROTA, but WCS uses PCi_j anyway
ax = plt.subplot(projection=wcs)
plt.imshow(hdulist[0].data, origin="lower", cmap="solar orbiterhri_euv174")
plt.colorbar()
plt.show()
```

490
491
Issue with loading the color map? Do `import sunpy`.

Eric Buchlin's avatar
Eric Buchlin committed
492
493
![Sunpy screenshot](./fig/screenshot-sunpy-04.png)

Eric Buchlin's avatar
Eric Buchlin committed
494
Of course this would have been easier using `sunpy.Map` (see above).
Eric Buchlin's avatar
Eric Buchlin committed
495
496

SPICE files are also regular FITS files, but, as for other slit spectrographs, it can be convenient to read them using the sunpy-sponsored [`sunraster`](https://docs.sunpy.org/projects/sunraster/en/latest/) package, designed for this kind of instruments.