Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
3
3D Fieldlines
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sec23
korte
3D Fieldlines
Merge requests
!1
You need to sign in or sign up before continuing.
Custom rk
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Custom rk
custom-rk
into
main
Overview
0
Commits
6
Changes
9
Merged
Maximilian Schanner
requested to merge
custom-rk
into
main
2 years ago
Overview
0
Commits
6
Changes
9
Expand
0
0
Merge request reports
Compare
main
version 9
1096656a
2 years ago
version 8
4b66ea30
2 years ago
version 7
2d56b8e8
2 years ago
version 6
dc2929a9
2 years ago
version 5
2d0a122c
2 years ago
version 4
93e387d9
2 years ago
version 3
bedeed82
2 years ago
version 2
6ccb40f7
2 years ago
version 1
bee7f91a
2 years ago
main (base)
and
latest version
latest version
d120d44d
6 commits,
2 years ago
version 9
1096656a
5 commits,
2 years ago
version 8
4b66ea30
12 commits,
2 years ago
version 7
2d56b8e8
11 commits,
2 years ago
version 6
dc2929a9
10 commits,
2 years ago
version 5
2d0a122c
9 commits,
2 years ago
version 4
93e387d9
8 commits,
2 years ago
version 3
bedeed82
7 commits,
2 years ago
version 2
6ccb40f7
6 commits,
2 years ago
version 1
bee7f91a
5 commits,
2 years ago
9 files
+
635
−
212
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
9
Search (e.g. *.vue) (Ctrl+P)
docs/mayavi.rst
+
24
−
16
Options
@@ -31,31 +31,39 @@ Internally, the magnetic field vector is generated on a 3D grid:
.. code-block:: python
from pymagglobal import Model, coefficients, REARTH
from utils import gen_Bxyz_grid
import generate
model = Model('gufm1')
epoch = 1840
_, _, coeffs = coefficients(epoch, model)
# the dimension of the grid is 2*a*REARTH
a = 5
(g_X, g_Y, g_Z), (B_x, B_y, B_z), (B_n, B_e, B_c) = \
gen_Bxyz_grid(coeffs, a=a, res=50)
(g_X, g_Y, g_Z), (B_x, B_y, B_z), (B_n, B_e, B_c) = generate.bxyz_grid(
coeffs,
a=a,
res=50,
)
From the vectors, fieldlines are generated using Mayavi's `flow` method:
.. code-block:: python
from mayavi import mlab
mlab.flow(B_x, B_y, B_z,
figure=fig,
extent=[-REARTH*a, REARTH*a,
-REARTH*a, REARTH*a,
-REARTH*a, REARTH*a],
integration_direction='both',
seed_resolution=2000,
seed_visible=False,
color=(1., 1., 1.),
line_width=2)
mlab.flow(
B_x, B_y, B_z,
figure=fig,
extent=[
-REARTH*a, REARTH*a,
-REARTH*a, REARTH*a,
-REARTH*a, REARTH*a,
],
integration_direction='both',
seed_resolution=2000,
seed_visible=False,
color=(1., 1., 1.),
line_width=2,
)
Loading