Skip to content

Commit

Permalink
Merge pull request #248 from boutproject/fci-fixes
Browse files Browse the repository at this point in the history
FCI fixes
  • Loading branch information
johnomotani authored Sep 25, 2022
2 parents fe0e8ee + d4aa5ec commit a23da81
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion xbout/geometries.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,14 @@ def apply_geometry(ds, geometry_name, *, coordinates=None, grid=None):
can_use_1d_z_coord = (nz == 1) or use_metric_3d

if can_use_1d_z_coord:
z = _1d_coord_from_spacing(updated_ds["dz"], zcoord, updated_ds)
if updated_ds.geometry == "fci":
# dz is varying. just set to a linspace
z = xr.DataArray(
np.linspace(start=0, stop=2 * np.pi, num=nz, endpoint=False),
dims=zcoord,
)
else:
z = _1d_coord_from_spacing(updated_ds["dz"], zcoord, updated_ds)
else:
if bout_v5:
if not np.all(updated_ds["dz"].min() == updated_ds["dz"].max()):
Expand Down
2 changes: 2 additions & 0 deletions xbout/plotting/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def plot_separatrix(da, sep_pos, ax, radial_coord="x"):

def _decompose_regions(da):

if da.geometry == "fci":
return {region: da for region in da.bout._regions}
return {
region: da.bout.from_region(region, with_guards=1)
for region in da.bout._regions
Expand Down

0 comments on commit a23da81

Please sign in to comment.