Skip to content

Commit

Permalink
Fix definition of b0 in vmec output
Browse files Browse the repository at this point in the history
  • Loading branch information
f0uriest committed May 7, 2024
1 parent 90d1ecb commit 1675e12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions desc/vmec.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def save(cls, eq, path, surfs=128, verbose=1): # noqa: C901 - FIXME - simplify
data_quad = eq.compute(
["R0/a", "V", "<|B|>_rms", "<beta>_vol", "<beta_pol>_vol", "<beta_tor>_vol"]
)
data_axis = eq.compute(["G", "p", "R", "<|B|^2>"], grid=grid_axis)
data_axis = eq.compute(["G", "p", "R", "<|B|^2>", "<|B|>"], grid=grid_axis)

Check warning on line 271 in desc/vmec.py

View check run for this annotation

Codecov / codecov/patch

desc/vmec.py#L271

Added line #L271 was not covered by tests
data_lcfs = eq.compute(["G", "I", "R", "Z"], grid=grid_lcfs)
data_half = eq.compute(
[
Expand Down Expand Up @@ -488,7 +488,7 @@ def save(cls, eq, path, surfs=128, verbose=1): # noqa: C901 - FIXME - simplify
b0 = file.createVariable("b0", np.float64)
b0.long_name = "average B_tor on axis"
b0.units = "T"
b0[:] = data_axis["G"][0] / data_axis["R"][0]
b0[:] = data_axis["<|B|>"][0]

Check warning on line 491 in desc/vmec.py

View check run for this annotation

Codecov / codecov/patch

desc/vmec.py#L491

Added line #L491 was not covered by tests

betaxis = file.createVariable("betaxis", np.float64)
betaxis.long_name = "2 * mu_0 * pressure / <|B|^2> on the magnetic axis"
Expand Down

0 comments on commit 1675e12

Please sign in to comment.