ml-solarwind / plotting_learningset.py
plotting_learningset.py
Raw
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 16 12:50:21 2020

@author: baum_c4
"""

import numpy as np
import pandas as pd

import pickle
import matplotlib.colors as mcol
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import matplotlib

with open('plot_learningset.pickle', 'rb') as f:
    [learnvector_o,learnvector_m,learnvector_s,timevector]=pickle.load(f)
    
    
posx_o=learnvector_o[0]
posy_o=learnvector_o[1]
posz_o=learnvector_o[2]
velx_o=learnvector_o[3]
vely_o=learnvector_o[4]
velz_o=learnvector_o[5]
dst=learnvector_o[6]


cm1 = mcol.LinearSegmentedColormap.from_list("MyCmapName",["b","m","r"])
f,ax = plt.subplots(1,1,figsize=(14*0.39,8*0.39))
c=ax.scatter(posx_o/6372,posy_o/6371,c=posz_o/6371,vmin=-22,vmax=22,cmap=cm1) 
cbar=plt.colorbar(c)
cbar.set_label('ACE position in Z [Re]')
#ax.set_rmax(2)
#ax.set_rticks([0.5, 1, 1.5, 2])  # less radial ticks
#ax.set_rlabel_position(-22.5)  # get radial labels away from plotted line
ax.set_xlabel('ACE position in X [Re]')
ax.set_ylabel('ACE position in Z [Re]')
ax.set_title('ACE Position in GSE')
plt.xticks(np.arange(215, 256, step=10))
plt.yticks(np.arange(-45, 46, step=15))
ax.grid(True)

plt.tight_layout()
plt.savefig('pos_learn.pdf',bbox_inches='tight')
plt.show()


font = { 'size'   : 12}

matplotlib.rc('font', **font)

cm1 = mcol.LinearSegmentedColormap.from_list("MyCmapName",["b","m","r"])
f,ax = plt.subplots(2,1,figsize=(16*0.39,15*0.39))

c=ax[0].scatter(posx_o/6372,posy_o/6371,c=posz_o/6371,vmin=-22,vmax=22,cmap=cm1) 
cbar=f.colorbar(c,ax=ax[0])
cbar.set_label('ACE position in Z [Re]')
#ax.set_rmax(2)
#ax.set_rticks([0.5, 1, 1.5, 2])  # less radial ticks
#ax.set_rlabel_position(-22.5)  # get radial labels away from plotted line
ax[0].set_xlabel('ACE position in X [Re]')
ax[0].set_ylabel('ACE position in Z [Re]')
ax[0].set_title('ACE Position in GSE')
plt.xticks(np.arange(215, 256, step=10))
plt.yticks(np.arange(-45, 46, step=15))
ax[0].grid(True)




c=ax[1].scatter(velx_o,vely_o,c=timevector[:,2]/60,cmap=cm1,vmin=10,vmax=90) 
cbar=plt.colorbar(c,ax=ax[1],ticks=[10,30,50,70,90])
cbar.set_label('meas. propagation delay [min]')
ax[1].set_title('Solar wind speed in GSE')
plt.xticks(np.arange(-1000, -199, step=200))
plt.yticks(np.arange(-150, 151, step=50))
#ax.set_rmax(2)
#ax.set_rticks([0.5, 1, 1.5, 2])  # less radial ticks
#ax.set_rlabel_position(-22.5)  # get radial labels away from plotted line
ax[1].set_xlabel('Solar wind speed in X [km/s]')
ax[1].set_ylabel('Solar wind speed in Y [km/s]')
ax[1].grid(True)
plt.tight_layout()
plt.savefig('plot_learn.pdf',bbox_inches='tight')
plt.show()