-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Utility for writing to IMAS #15
Comments
@eldond I would avoid adding derived quantities to Perhaps this would be a better starting point: """
gEQDSK2IMAS(GEQDSKFile::GEQDSKFile,eq::IMAS.equilibrium)
Convert IMAS.equilibrium__time_slice to MXHEquilibrium.jl EFIT structure
"""
function gEQDSK2IMAS(g::CHEASE.EFIT.GEQDSKFile, eq::IMAS.equilibrium)
tc = CoordinateConventions.transform_cocos(1, 11) # chease output is cocos 1 , dd is cocos 11
eqt = eq.time_slice[]
eq1d = eqt.profiles_1d
eq2d = resize!(eqt.profiles_2d, 1)[1]
@ddtime(eq.vacuum_toroidal_field.b0 = g.bcentr)
eq.vacuum_toroidal_field.r0 = g.rcentr
eqt.global_quantities.magnetic_axis.r = g.rmaxis
eqt.boundary.geometric_axis.r = g.rcentr
eqt.boundary.geometric_axis.z = g.zmid
eqt.global_quantities.magnetic_axis.z = g.zmaxis
eqt.global_quantities.ip = g.current
eq1d.psi = g.psi .* tc["PSI"]
eq1d.q = g.qpsi
eq1d.pressure = g.pres
eq1d.dpressure_dpsi = g.pprime .* tc["PPRIME"]
eq1d.f = g.fpol .* tc["F"]
eq1d.f_df_dpsi = g.ffprim .* tc["F_FPRIME"]
eq2d.grid_type.index = 1
eq2d.grid.dim1 = g.r
eq2d.grid.dim2 = g.z
eq2d.psi = g.psirz .* tc["PSI"]
return nothing
end |
Okay. Should the writing function be in EFIT or in IMAS, though? |
Whether you mean |
This stops us from importing EFIT into IMAS later because it would create a circular dependency, right? |
@eldond we do not need nor want to import EFIT into IMAS. Is there some specific use case that you have in mind? |
@orso82 I want to import data from an eqdsk file into IMAS. I am using EFIT.jl to do this so far. |
EFIT.jl with IMASdd.jl as a dependency, and |
Hi,
I have https://github.com/ProjectTorreyPines/SD4SOLPS.jl/blob/24af0ba75505bc56ce9a57b122c8cd9fcc721383/src/SD4SOLPS.jl#L78 which uses
EFIT.jl
output and translates data into the IMAS schema. I developed this within one of the repos from our project, but maybe it makes more sense as part ofEFIT.jl
? IMASDD is already a dependency. Let me know if I should move this function. Maybe it would go inio.jl
?The text was updated successfully, but these errors were encountered: