CLUSTER_Python_Programme/Bachelorthesis/PITCH_TIMELINE.py
lisa c25249f762 PITCH_TIMELINE.py
Generates a time series, which displays the PADs as a heat map
for all channels of a spacecraft. It also provides the components
and magnitude of the magnetic field, as well as the coordinates
and radial distance from Earth.
2026-06-10 21:59:06 +02:00

87 lines
No EOL
1.7 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from rapid_fgm import *
from datetime import datetime
import matplotlib.pyplot as plt
# -----USER INPUT-------------
TIME_PERIOD = (datetime(2002, 6, 27, 0), datetime(2002, 6, 29, 0))
TIME_POINT = datetime(2002, 6, 28, 19, 15)
SC_ID = 'C4'
PARTICLE_TYPE = "electron" #'electron' oder "ion"
#-----------------------------------------
instrument = "IES" if PARTICLE_TYPE == "electron" else "IIMS"
r = RAPID(sc_id=SC_ID, time_period=TIME_PERIOD, particle_type=PARTICLE_TYPE)
data_rapid = r.load_rapid()
r.get_rapid_var(r.data_rapid)
print('rapid time:', r.time_rapid[0], r.time_rapid[-1])
flow = FLOW(
sc_id=SC_ID,
time_period=TIME_PERIOD,
particle_type=PARTICLE_TYPE
)
flow.get_flow_var(flow.data_flow)
flow.load_flow()
f = FGM(SC_ID, time_period=TIME_PERIOD)
f.load_fgm()
f.get_fgm_var(f.data_fgm)
w = WORKSPACE()
sync = w.sync_all_by_resolution(r, f, flow)
t_sync = sync['time']
rapid_sync = sync['rapid']
fgm_sync = sync['fgm']
sc2gse = sync['sc2gse']
sc_data = w.spacecrafts(
sc_id=SC_ID,
t_sync=t_sync,
rapid_sync=rapid_sync,
fgm_sync=fgm_sync,
sc2gse=sc2gse,
time_period=None
)
w.rapid_n_sc2gse(SC_ID)
pitch_angle, cos_pitch = w.calc_pitch_angle(SC_ID)
w.rapid_n_sc2gse(SC_ID)
pitch_angle, cos_pitch = w.calc_pitch_angle(SC_ID)
w.histPAD(SC_ID)
data = w.SC_data[SC_ID]
#font in Times New Roman
plt.rcParams['font.family'] = 'Times New Roman'
plt.rcParams['mathtext.fontset'] = 'stix'
fig, ax = w.plot_pitch_timeseries(
SC_ID,vmin=None, vmax=None,
norm=None, title = f"{SC_ID} {instrument} PADs 2002-06-28")
filename = 'C:/Users/lview/OneDrive/Dokumente/Desktop/C3_RAPID_20020628/Dumbbell/'+ f'{SC_ID}_{instrument}_'+'_PADs_timeseries_20020628.pdf'
print(filename)
plt.savefig(filename)
plt.show()