SWDatabase
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Namespaces | Functions | Variables
test_polarity.py File Reference

Namespaces

 test_polarity
 
 compute_polarity
 Compute polarity for a given insitu magnetic field as a function of Parker spiral magnetic vector.
 

Functions

def test_polarity.polarity_1
 
def test_polarity.polarity_2
 

Variables

string test_polarity.scraft = 'STA'
 
float test_polarity.rss = 2.5
 
tuple test_polarity.date_min = datetime.datetime(2019,11,1,0)
 
tuple test_polarity.date_max = datetime.datetime(2019,12,5,12)
 
int test_polarity.delay = 12
 
 test_polarity.plot = True
 
string test_polarity.frame_spice = 'IAU_SUN'
 
tuple test_polarity.folder_test = os.path.join('dir.test','TEST')
 
tuple test_polarity.ndates = int((date_max - date_min).total_seconds()/delay/3600)
 
list test_polarity.dates = [ date_min + i*datetime.timedelta(hours=delay) for i in range(0,ndates+1) ]
 
list test_polarity.times = []
 
tuple test_polarity.time_in = module_timespace.Time()
 
string test_polarity.obs_mag = 'OBS_INSITU_MAG_STEREOA'
 
string test_polarity.obs_vel = 'OBS_INSITU_VELOCITY_STEREOA'
 
string test_polarity.observer = 'SUN'
 
list test_polarity.point_sc = positions_iau_sun[i]
 
int test_polarity.delta_max = 3
 
list test_polarity.v_wind = data_v[3]
 
tuple test_polarity.vector_mag_iausun = module_timespace.Coordinate()
 
 test_polarity.bx = vector_mag_hee.x
 
 test_polarity.by = vector_mag_hee.y
 
 test_polarity.bz = vector_mag_hee.z
 
list test_polarity.bnorm = data_b[3]
 
 test_polarity.success = polarity2
 
tuple test_polarity.sun = sub.scatter(0,0,color = 'y')
 
tuple test_polarity.text_sun = sub.text(0,0,'Sun')
 
tuple test_polarity.sc_ex = point_sc.r*math.sin(math.pi/2-point_sc.lat*module_common.deg2rad)
 
tuple test_polarity.sc_ey = point_sc.r*math.sin(math.pi/2-point_sc.lat*module_common.deg2rad)
 
tuple test_polarity.sc_norm = math.sqrt(sc_ex**2+sc_ey**2)
 
tuple test_polarity.sc = sub.scatter(sc_ex,sc_ey)
 
tuple test_polarity.ex = sub.arrow(sc_ex,sc_ey,1,0,length_includes_head=True,head_width=0.1,head_length=0.1)
 
tuple test_polarity.ey = sub.arrow(sc_ex,sc_ey,0,1,length_includes_head=True,head_width=0.1,head_length=0.1)
 
tuple test_polarity.text_ex = sub.text(sc_ex+1,sc_ey ,'ex')
 
tuple test_polarity.text_ey = sub.text(sc_ex ,sc_ey+1,'ey')
 
tuple test_polarity.u = sub.arrow(sc_ex,sc_ey, math.cos(point_sc.lon*module_common.deg2rad), math.sin(point_sc.lon*module_common.deg2rad),length_includes_head=True,head_width=0.1,head_length=0.1,color='b')
 
tuple test_polarity.ephi = sub.arrow(sc_ex,sc_ey,-math.sin(point_sc.lon*module_common.deg2rad), math.cos(point_sc.lon*module_common.deg2rad),length_includes_head=True,head_width=0.1,head_length=0.1,color='b')
 
tuple test_polarity.mephi = sub.arrow(sc_ex,sc_ey, math.sin(point_sc.lon*module_common.deg2rad),-math.cos(point_sc.lon*module_common.deg2rad),length_includes_head=True,head_width=0 ,head_length=0 ,color='b',linestyle='dashed')
 
tuple test_polarity.text_u = sub.text(sc_ex+math.cos(point_sc.lon*module_common.deg2rad),sc_ey+math.sin(point_sc.lon*module_common.deg2rad),'u')
 
tuple test_polarity.text_ephi = sub.text(sc_ex-math.sin(point_sc.lon*module_common.deg2rad),sc_ey+math.cos(point_sc.lon*module_common.deg2rad),'ephi')
 
tuple test_polarity.b_spiral_norm = math.sqrt(b_spiral_ex**2+b_spiral_ey**2)
 
tuple test_polarity.b_spiral = sub.arrow(sc_ex,sc_ey,b_spiral_ex/b_spiral_norm,b_spiral_ey/b_spiral_norm,length_includes_head=True,head_width=0.1,head_length=0.1,color='k')
 
tuple test_polarity.text_b_spiral = sub.text(sc_ex+b_spiral_ex/b_spiral_norm,sc_ey+b_spiral_ey/b_spiral_norm,'Bparker \nPsi_p = %7.2f'%(psi_parker))
 
tuple test_polarity.b_perp1 = sub.arrow(sc_ex,sc_ey, dx, dy,length_includes_head=True,color='k',linestyle='dashdot',linewidth=3)
 
tuple test_polarity.b_perp2 = sub.arrow(sc_ex,sc_ey,-dx,-dy,length_includes_head=True,color='k',linestyle='dashdot',linewidth=3)
 
tuple test_polarity.point = sub.scatter(x_list[i]/sc_norm,y_list[i]/sc_norm,color='k',marker = '.')
 
string test_polarity.color = 'green'
 
tuple test_polarity.b = sub.arrow(sc_ex,sc_ey,bx/bnorm,by/bnorm,length_includes_head=True,head_width=0.1,head_length=0.1,color = color)
 
string test_polarity.command = 'eog %s/test_polarity_*.png'