SWDatabase
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Classes | Functions
common.module_fieldline Namespace Reference

Classes

class  FieldlineError
 
class  Fieldline
 Class represent a fieldline. More...
 

Functions

def write_fieldline_ascii
 
def sphe2cart
 
def cart2sphe
 
def get_footpoint
 
def get_point
 Get fieldline point where r = r_in. More...
 
def check_fieldline
 Check if fieldlines are correct. More...
 
def open_fieldline
 Check if fieldlines are open. More...
 
def closed_fieldline
 Check if fieldlines are closed. More...
 
def get_delta
 Get the norm between 2 fieldlines along the first fieldline. More...
 
def relative_error
 Get the relative error between 2 fieldlines f1 and f2: rel_err = max(rel_err(r),rel_err(lon),rel_err(lat),rel_err(b)) where. More...
 
def reverse
 Reverse fieldline indexation. More...
 
def helicoid_z2
 Build an helicoidal fieldline around (lat0,lon0) from r0 to r1. More...
 
def find_polarity
 Find polarity of a bunch of fieldlines. More...
 
def mean_magnetic_at_r
 Compute the mean magnetic field for a bunch of fieldline at r = r. More...
 

Function Documentation

def common.module_fieldline.cart2sphe (   x,
  y,
  z 
)
Convert 3 cartesian vectors coordinate x,y,z into fieldline.

Here is the caller graph for this function:

def common.module_fieldline.check_fieldline (   fieldlines)

Check if fieldlines are correct.

Criterion:
If r > 0 and 0 <= lon <= 360 and -90 <= lat <= 90 along fieldline, fieldline ok.

Returns
list of boolean, same index as fieldlines list
def common.module_fieldline.closed_fieldline (   fieldlines)

Check if fieldlines are closed.

:
If r[0] < 1.1Rs and r[-1] < 1.1Rs, then open.

Returns
list of open fieldlines
def common.module_fieldline.find_polarity (   fieldlines)

Find polarity of a bunch of fieldlines.

Look only at fieldline first point.
For all fieldline: Br >= 0, polarity = 1, Br < 0, polarity = -1 N(polarity=1) >= N(polarity=-1), polarity_glo = 1

Here is the caller graph for this function:

def common.module_fieldline.get_delta (   fieldline1,
  fieldline2 
)

Get the norm between 2 fieldlines along the first fieldline.

Parameters
[out]norm,:fieldline1.nsize array. At each fieldline1 point, gives the minimum distance from fieldline2.
[out]index,:fieldline1.nsize array. At each fieldline1 point, gives the fieldline2 index where minimum distance is found.

Here is the call graph for this function:

def common.module_fieldline.get_footpoint (   fieldlines,
  loc = 'last' 
)
Returns a list of fieldlines footpoint as Coordinates. 
def common.module_fieldline.get_point (   fieldline,
  r = module_common.rsun2km 
)

Get fieldline point where r = r_in.

Parameters
[in]fieldlineFieldline() object. [in] r_in radius in km.
Returns
index index of fieldline where r nearest from r

Here is the caller graph for this function:

def common.module_fieldline.helicoid_z2 (   r0,
  r1,
  lat0,
  lon0,
  npoint,
  z0 = 4 
)

Build an helicoidal fieldline around (lat0,lon0) from r0 to r1.

Helicoid radius is some z**2 function dependant.

Returns
Fieldline() object.
def common.module_fieldline.mean_magnetic_at_r (   fieldlines,
  var = 'br',
  r = module_common.rsun2km,
  v = 0 
)

Compute the mean magnetic field for a bunch of fieldline at r = r.

Mean only fieldlines which have the same polarity as the global polarity given by find_polarity routines.

Parameters
[in]fieldlineList of Fieldline() objects.
[in]varString. Magnetic composant to be mean. Br or Blon or Blat. Default Br.
[in]rFloat. Meaning will be done at r = r (if it exists).
[in]vInt. Verbose mode if Int > 0. Default: 0.
Returns
bmean Mean magnetic composant.

Here is the call graph for this function:

def common.module_fieldline.open_fieldline (   fieldlines)

Check if fieldlines are open.

:
If r[0] > 2Rs or r[-1] > 2Rs, then open.

Returns
list of open fieldlines
def common.module_fieldline.relative_error (   f1,
  f2 
)

Get the relative error between 2 fieldlines f1 and f2: rel_err = max(rel_err(r),rel_err(lon),rel_err(lat),rel_err(b)) where.

  • rel_err(r ) = Ninf((f1.r - f2.r )/f1.r)
  • rel_err(lon) = Ninf((f1.lon - f2.lon)/f1.r)
  • and so on
def common.module_fieldline.reverse (   fieldline)

Reverse fieldline indexation.

Do not return another fieldline, just modify it.

def common.module_fieldline.sphe2cart (   fieldline)
Convert fieldline spherical coordinate into 3 cartesian vectors coordinate x,y,z.

Here is the caller graph for this function:

def common.module_fieldline.write_fieldline_ascii (   fieldline,
  filename 
)
Given a Fieldline structure, write each composant in filename file according this format:
r(1) lon(1) lat(1) br(1) blon(1) blat(1)
r(2) lon(2) lat(2) br(2) blon(2) blat(2)
...
r(nsize) lon(nsize) lat(nsize) br(nsize) blon(nsize) blat(nsize)