Parker Solar Probe peihelion 1

This example shows how to plot magnetic field data from the first perihelion pass of Parker Solar Probe. Not shown here (because the files are quite large!) are the particle properties measured by SWEAP, which can be accessed with heliopy.data.psp.sweap_spc_l3.

Import the required packages

from heliopy.data import psp
from datetime import datetime
import matplotlib.pyplot as plt

Define the starttime and endtime of the perihelion pass

starttime = datetime(2018, 11, 2)
endtime = datetime(2018, 11, 10)

Download and load the magnetic field data

mag = psp.fields_mag_rtn_1min(starttime, endtime)

Out:

Downloading https://spdf.gsfc.nasa.gov/pub/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181102_v02.cdf to /home/docs/heliopy/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181102_v02.cdf

  0.0%     0 / 91147
  9.0%  8192 / 91147
 18.0% 16384 / 91147
 27.0% 24576 / 91147
 36.0% 32768 / 91147
 44.9% 40960 / 91147
 53.9% 49152 / 91147
 62.9% 57344 / 91147
 71.9% 65536 / 91147
 80.9% 73728 / 91147
 89.9% 81920 / 91147
 98.9% 90112 / 91147
100.0% 98304 / 91147


Downloading https://spdf.gsfc.nasa.gov/pub/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181103_v02.cdf to /home/docs/heliopy/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181103_v02.cdf

  0.0%     0 / 90881
  9.0%  8192 / 90881
 18.0% 16384 / 90881
 27.0% 24576 / 90881
 36.1% 32768 / 90881
 45.1% 40960 / 90881
 54.1% 49152 / 90881
 63.1% 57344 / 90881
 72.1% 65536 / 90881
 81.1% 73728 / 90881
 90.1% 81920 / 90881
 99.2% 90112 / 90881
100.0% 98304 / 90881


Downloading https://spdf.gsfc.nasa.gov/pub/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181104_v02.cdf to /home/docs/heliopy/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181104_v02.cdf

  0.0%     0 / 91354
  9.0%  8192 / 91354
 17.9% 16384 / 91354
 26.9% 24576 / 91354
 35.9% 32768 / 91354
 44.8% 40960 / 91354
 53.8% 49152 / 91354
 62.8% 57344 / 91354
 71.7% 65536 / 91354
 80.7% 73728 / 91354
 89.7% 81920 / 91354
 98.6% 90112 / 91354
100.0% 98304 / 91354


Downloading https://spdf.gsfc.nasa.gov/pub/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181105_v02.cdf to /home/docs/heliopy/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181105_v02.cdf

  0.0%     0 / 91104
  9.0%  8192 / 91104
 18.0% 16384 / 91104
 27.0% 24576 / 91104
 36.0% 32768 / 91104
 45.0% 40960 / 91104
 54.0% 49152 / 91104
 62.9% 57344 / 91104
 71.9% 65536 / 91104
 80.9% 73728 / 91104
 89.9% 81920 / 91104
 98.9% 90112 / 91104
100.0% 98304 / 91104


Downloading https://spdf.gsfc.nasa.gov/pub/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181106_v02.cdf to /home/docs/heliopy/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181106_v02.cdf

  0.0%     0 / 91324
  9.0%  8192 / 91324
 17.9% 16384 / 91324
 26.9% 24576 / 91324
 35.9% 32768 / 91324
 44.9% 40960 / 91324
 53.8% 49152 / 91324
 62.8% 57344 / 91324
 71.8% 65536 / 91324
 80.7% 73728 / 91324
 89.7% 81920 / 91324
 98.7% 90112 / 91324
100.0% 98304 / 91324


Downloading https://spdf.gsfc.nasa.gov/pub/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181107_v02.cdf to /home/docs/heliopy/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181107_v02.cdf

  0.0%     0 / 91408
  9.0%  8192 / 91408
 17.9% 16384 / 91408
 26.9% 24576 / 91408
 35.8% 32768 / 91408
 44.8% 40960 / 91408
 53.8% 49152 / 91408
 62.7% 57344 / 91408
 71.7% 65536 / 91408
 80.7% 73728 / 91408
 89.6% 81920 / 91408
 98.6% 90112 / 91408
100.0% 98304 / 91408


Downloading https://spdf.gsfc.nasa.gov/pub/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181108_v02.cdf to /home/docs/heliopy/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181108_v02.cdf

  0.0%     0 / 90921
  9.0%  8192 / 90921
 18.0% 16384 / 90921
 27.0% 24576 / 90921
 36.0% 32768 / 90921
 45.1% 40960 / 90921
 54.1% 49152 / 90921
 63.1% 57344 / 90921
 72.1% 65536 / 90921
 81.1% 73728 / 90921
 90.1% 81920 / 90921
 99.1% 90112 / 90921
100.0% 98304 / 90921


Downloading https://spdf.gsfc.nasa.gov/pub/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181109_v02.cdf to /home/docs/heliopy/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181109_v02.cdf

  0.0%     0 / 91294
  9.0%  8192 / 91294
 17.9% 16384 / 91294
 26.9% 24576 / 91294
 35.9% 32768 / 91294
 44.9% 40960 / 91294
 53.8% 49152 / 91294
 62.8% 57344 / 91294
 71.8% 65536 / 91294
 80.8% 73728 / 91294
 89.7% 81920 / 91294
 98.7% 90112 / 91294
100.0% 98304 / 91294


Downloading https://spdf.gsfc.nasa.gov/pub/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181110_v02.cdf to /home/docs/heliopy/data/psp/fields/l2/mag_rtn_1min/2018/psp_fld_l2_mag_rtn_1min_20181110_v02.cdf

  0.0%     0 / 91098
  9.0%  8192 / 91098
 18.0% 16384 / 91098
 27.0% 24576 / 91098
 36.0% 32768 / 91098
 45.0% 40960 / 91098
 54.0% 49152 / 91098
 62.9% 57344 / 91098
 71.9% 65536 / 91098
 80.9% 73728 / 91098
 89.9% 81920 / 91098
 98.9% 90112 / 91098
100.0% 98304 / 91098

Plot the data!

fig, ax = plt.subplots(figsize=(10, 4))

for comp, label in enumerate(['Br', 'Bt', 'Bn']):
    ax.plot(mag.index, mag.quantity(f'psp_fld_l2_mag_RTN_1min_{comp}'),
            linewidth=1, zorder=-comp, label=label)

ax.legend()
ax.set_ylabel('nT')
ax.set_title('PSP Perihelion 1')
fig.autofmt_xdate()
plt.show()
PSP Perihelion 1

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

Gallery generated by Sphinx-Gallery