Skip to content

Commit 5dde7ec

Browse files
authored
Merge pull request #266 from boutproject/plot3d
3d plotting
2 parents 813b0d6 + b982324 commit 5dde7ec

File tree

6 files changed

+603
-3
lines changed

6 files changed

+603
-3
lines changed

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ calc =
5050
xrft
5151
xhistogram
5252
docs = sphinx >= 1.4
53+
3d_plot =
54+
k3d >= 2.8.0
55+
mayavi >= 4.7.2
56+
wand
5357

5458
[build_sphinx]
5559
project = $metadata.name

xbout/boutdataarray.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,9 @@ def interpolate_parallel(
385385

386386
return da
387387

388+
def add_cartesian_coordinates(self):
389+
return _add_cartesian_coordinates(self.data)
390+
388391
def add_cartesian_coordinates(self):
389392
"""
390393
Add Cartesian (X,Y,Z) coordinates.
@@ -1077,3 +1080,20 @@ def plot_regions(self, ax=None, **kwargs):
10771080
tokamak topology.
10781081
"""
10791082
return plotfuncs.plot_regions(self.data, ax=ax, **kwargs)
1083+
1084+
def plot3d(self, ax=None, **kwargs):
1085+
"""
1086+
Make a 3d plot
1087+
1088+
Warnings
1089+
--------
1090+
1091+
3d plotting functionality is still a bit of a work in progress. Bugs are likely, and
1092+
help developing is welcome!
1093+
1094+
Parameters
1095+
----------
1096+
1097+
See plotfuncs.plot3d()
1098+
"""
1099+
return plotfuncs.plot3d(self.data, **kwargs)

xbout/boutdataset.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ def find_with_dims(first_var, dims):
266266

267267
return ds
268268

269+
def add_cartesian_coordinates(self):
270+
return _add_cartesian_coordinates(self.data)
271+
269272
def integrate_midpoints(self, variable, *, dims=None, cumulative_t=False):
270273
"""
271274
Integrate using the midpoint rule for spatial dimensions, and trapezium rule for

0 commit comments

Comments
 (0)