Skip to content

Commit ae04a86

Browse files
authored
Merge pull request #192 from boutproject/xbout-compatibility
Compatibility with latest `xBOUT`
2 parents 5ebdc6a + 4df7702 commit ae04a86

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

hypnotoad/scripts/hypnotoad_plot_grid_cells.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,27 +136,28 @@ def main():
136136
# Note: have to use `s` to set marker size, because xarray has used a `size`
137137
# kwarg for something else.
138138
ds_region.isel(
139-
x=slice(xin, xout_centre), theta=slice(ylow, yup_centre)
139+
x=slice(xin, xout_centre),
140+
y=slice(ylow, yup_centre),
140141
).plot.scatter(x="R", y="Z", marker=".", color="k", s=1)
141142

142143
# plot radial grid lines
143144
plt.plot(
144145
ds_region["Rxy_lower_left_corners"].isel(
145-
x=slice(xin, xout_corner_rad), theta=slice(ylow, yup_corner)
146+
x=slice(xin, xout_corner_rad), y=slice(ylow, yup_corner)
146147
),
147148
ds_region["Zxy_lower_left_corners"].isel(
148-
x=slice(xin, xout_corner_rad), theta=slice(ylow, yup_corner)
149+
x=slice(xin, xout_corner_rad), y=slice(ylow, yup_corner)
149150
),
150151
color="k",
151152
)
152153

153154
# plot poloidal grid lines
154155
plt.plot(
155156
ds_region["Rxy_lower_left_corners"]
156-
.isel(x=slice(xin_pol, xout_corner_pol), theta=slice(ylow, yup_corner))
157+
.isel(x=slice(xin_pol, xout_corner_pol), y=slice(ylow, yup_corner))
157158
.T,
158159
ds_region["Zxy_lower_left_corners"]
159-
.isel(x=slice(xin_pol, xout_corner_pol), theta=slice(ylow, yup_corner))
160+
.isel(x=slice(xin_pol, xout_corner_pol), y=slice(ylow, yup_corner))
160161
.T,
161162
color="k",
162163
)
@@ -176,10 +177,10 @@ def main():
176177
# regions is not (or 'not really') a branch cut.
177178
plt.plot(
178179
ds_region["Rxy_lower_left_corners"].isel(
179-
x=slice(xin, xout_corner_rad), theta=-1
180+
x=slice(xin, xout_corner_rad), y=-1
180181
),
181182
ds_region["Zxy_lower_left_corners"].isel(
182-
x=slice(xin, xout_corner_rad), theta=-1
183+
x=slice(xin, xout_corner_rad), y=-1
183184
),
184185
color="r",
185186
linewidth=3,
@@ -192,10 +193,10 @@ def main():
192193
# highlight the outer edge.
193194
plt.plot(
194195
ds_region["Rxy_lower_left_corners"].isel(
195-
x=-1, theta=slice(ylow, yup_corner)
196+
x=-1, y=slice(ylow, yup_corner)
196197
),
197198
ds_region["Zxy_lower_left_corners"].isel(
198-
x=-1, theta=slice(ylow, yup_corner)
199+
x=-1, y=slice(ylow, yup_corner)
199200
),
200201
color="b",
201202
linewidth=3,
@@ -206,10 +207,10 @@ def main():
206207
if ds_region.regions[r].connection_lower_y is None:
207208
plt.plot(
208209
ds_region["Rxy_lower_left_corners"].isel(
209-
x=slice(xin, xout_corner_rad), theta=ylow
210+
x=slice(xin, xout_corner_rad), y=ylow
210211
),
211212
ds_region["Zxy_lower_left_corners"].isel(
212-
x=slice(xin, xout_corner_rad), theta=ylow
213+
x=slice(xin, xout_corner_rad), y=ylow
213214
),
214215
color="k",
215216
linewidth=3,
@@ -219,10 +220,10 @@ def main():
219220
yval = -1 if yup_corner is None else yup_corner
220221
plt.plot(
221222
ds_region["Rxy_lower_left_corners"].isel(
222-
x=slice(xin, xout_corner_rad), theta=yval
223+
x=slice(xin, xout_corner_rad), y=yval
223224
),
224225
ds_region["Zxy_lower_left_corners"].isel(
225-
x=slice(xin, xout_corner_rad), theta=yval
226+
x=slice(xin, xout_corner_rad), y=yval
226227
),
227228
color="k",
228229
linewidth=3,

0 commit comments

Comments
 (0)