Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Equilibrium/ReadEquilibrium.jl
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ internal COCOS 2 convention:

+ `global_quantities.psi_axis`, `global_quantities.psi_boundary`
+ `profiles_1d.psi`, `profiles_1d.f`, `profiles_1d.pressure`, `profiles_1d.q`
+ `profiles_2d[1].grid.dim1` (R), `profiles_2d[1].grid.dim2` (Z), `profiles_2d[1].psi`
+ the `profiles_2d` entry with `grid_type.index == 1` (rectangular), supplying `grid.dim1` (R), `grid.dim2` (Z) and `psi`
"""
function read_imas(config::EquilibriumConfig, dd)
@info "Processing IMAS equilibrium at global_time = $(dd.global_time) s"
Expand Down Expand Up @@ -511,7 +511,8 @@ function read_imas(config::EquilibriumConfig, dd)
error("read_imas: no profiles_2d found in equilibrium time slice. " *
"Ensure the 2D ψ(R,Z) map is stored in dd.equilibrium.")
end
prof2d = eqt.profiles_2d[1]
prof2d = findfirst(:rectangular, eqt.profiles_2d)
prof2d === nothing && error("read_imas: no rectangular profiles_2d found.")
r_grid = prof2d.grid.dim1
z_grid = prof2d.grid.dim2

Expand Down
1 change: 1 addition & 0 deletions test/runtests_imas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ using GeneralizedPerturbedEquilibrium.Equilibrium

resize!(eqt.profiles_2d, 1; wipe=true)
prof2d = eqt.profiles_2d[1]
prof2d.grid_type.index = 1
prof2d.grid.dim1 = R_grid
prof2d.grid.dim2 = Z_grid
prof2d.psi = psi_rz .* cf
Expand Down
Loading