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... | |
def common.module_fieldline.cart2sphe | ( | x, | |
y, | |||
z | |||
) |
Convert 3 cartesian vectors coordinate x,y,z into fieldline.
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.
def common.module_fieldline.closed_fieldline | ( | fieldlines | ) |
Check if fieldlines are closed.
:
If r[0] < 1.1Rs and r[-1] < 1.1Rs, then open.
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
def common.module_fieldline.get_delta | ( | fieldline1, | |
fieldline2 | |||
) |
Get the norm between 2 fieldlines along the first fieldline.
[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. |
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.
[in] | fieldline | Fieldline() object. [in] r_in radius in km. |
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.
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.
[in] | fieldline | List of Fieldline() objects. |
[in] | var | String. Magnetic composant to be mean. Br or Blon or Blat. Default Br. |
[in] | r | Float. Meaning will be done at r = r (if it exists). |
[in] | v | Int. Verbose mode if Int > 0. Default: 0. |
def common.module_fieldline.open_fieldline | ( | fieldlines | ) |
Check if fieldlines are open.
:
If r[0] > 2Rs or r[-1] > 2Rs, then open.
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.
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.
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)