gafusion / omas

Ordered Multidimensional Array Structure
http://gafusion.github.io/omas
MIT License
30 stars 14 forks source link

Error loading some D3D machine mappings #298

Closed orso82 closed 1 month ago

orso82 commented 3 months ago

I don't know if this is and issue specific to a shot.

NOTE I use ods.paths() to force loading data.

ods = ODS().open('machine', 'd3d', 163303)

for key in ods.keys():
    if key not in ["equilibrium", "core_profiles"]:
        print(f"== {key} ==")
        ods[key].paths()

print(f"== core_profiles ==")
ods["core_profiles.profiles_1d[1]"].paths()

print(f"== equilibrium ==")
ods["equilibrium.time_slice[1]"].paths()

ods.close()
== bolometer ==
== charge_exchange ==
charge_exchange.channel.: issue:KeyError('CER')
charge_exchange.channel.: issue:KeyError('CER')
== coils_non_axisymmetric ==
== dataset_description ==
== ec_launchers ==
Invalid mode type returned for beam 0
Invalid mode type returned for beam 1
Invalid mode type returned for beam 2
Invalid mode type returned for beam 3
Invalid mode type returned for beam 4
Invalid mode type returned for beam 5
== ece ==
== gas_injection ==
== interferometer ==
== langmuir_probes ==
== magnetics ==
== pf_active ==
== tf ==
== thomson_scattering ==
== wall ==
== core_profiles ==
== equilibrium ==
data(\EFIT01::TOP.MEASUREMENTS.SIGMPI)
...repeated
data(\EFIT01::TOP.MEASUREMENTS.SIGMPI)
data(\EFIT01::TOP.MEASUREMENTS.CHIDFLUX)
data(\EFIT01::TOP.MEASUREMENTS.FWTDIA)
data(\EFIT01::TOP.MEASUREMENTS.SIGSIL)
...repeated
data(\EFIT01::TOP.MEASUREMENTS.SIGSIL)
data(\EFIT01::TOP.MEASUREMENTS.CHIPASMA)
data(\EFIT01::TOP.MEASUREMENTS.SIGPASMA)
data(\EFIT01::TOP.MEASUREMENTS.FWTPASMA)
size(\EFIT01::TOP.MEASUREMENTS.SIZEROJ,0)
equilibrium.time_slice.:.constraints.j_tor.: issue:MdsIpException('%MDSPLUS-E-Unknown, %TREE-W-NNF, Node Not Found\n - server: atlas.gat.com:8000\n - treename: EFIT01\n - pulse: 163303\n - TDI: size(\\EFIT01::TOP.MEASUREMENTS.SIZEROJ,0)')
size(\EFIT01::TOP.MEASUREMENTS.SIZEROJ,0)
...repeated
\EFIT01::TOP.MEASUREMENTS.SIGFCC)
ADDFUN("stack_outer_2","exec('''def stack_outer_2(a, b):
    import numpy as np
    a = a.data()
    b = b.data()
    return np.concatenate([a, b],axis=1)''')"),stack_outer_2(\EFIT01::TOP.MEASUREMENTS.CHIECC, 
\EFIT01::TOP.MEASUREMENTS.CHIFCC)
...repeated
ADDFUN("stack_outer_2","exec('''def stack_outer_2(a, b):
    import numpy as np
    a = a.data()
    b = b.data()
    return np.concatenate([a, b],axis=1)''')"),stack_outer_2(\EFIT01::TOP.MEASUREMENTS.SIGECC, \EFIT01::TOP.MEASUREMENTS.SIGFCC)
...repeated
ADDFUN("efit_psi_to_real_psi_2d","exec('''def efit_psi_to_real_psi_2d(a, b, c):
    a = a.data()
    b = b.data()
    c = c.data()
    return (a.T * (c - b) + b).T''')"),efit_psi_to_real_psi_2d(-\EFIT01::TOP.MEASUREMENTS.RPRESS, \EFIT01::TOP.RESULTS.GEQDSK.SSIMAG, \EFIT01::TOP.RESULTS.GEQDSK.SSIBRY)
...repeated
data(\EFIT01::TOP.MEASUREMENTS.FWTPRE)
ADDFUN("efit_psi_to_real_psi_2d","exec('''def efit_psi_to_real_psi_2d(a, b, c):
    a = a.data()
    b = b.data()
    c = c.data()
...repeated
orso82 commented 3 months ago

Who is familiar with ec_launchers? CER?

Do we understand all of the errors occurring for equilibrium ?

torrinba commented 3 months ago

All of the missing equilibrium quantities are expected for older shots unfortunately. It was caused by a difference in names in the NetCDF files EFIT wrote and their pointnames in MDS+ (some of which appear to be defined for rtEFIT variable names). These should not be missing in newer shots. Current and pressure constraints also aren't used in EFIT01 so those wouldn't be meaningful anyway.

I think there were substantial changes to the ec_launcher IDS around IMAS 3.38 or 3.39. It's possible the machine mapping isn't entirely consistent anymore but I'm not familiar with how any of that data is stored in MDS+

orso82 commented 3 months ago

Thank you for the explanation @torrinba . For now we'll keep things as they are until someone really needs the equilibrium IDS to be filled from the machine mappings... then perhaps we can think of doing the data mappings in a Python function where we can retrieve multiple MDS+ signals in parallel, and handle the complexity that you described, instead of using TDI functions.

Perhaps @AreWeDreaming can chime in about the ec_launchers situation?

torrinba commented 3 months ago

Just to make sure this is clear, I don't think any TDI magic can fix these equilibrium entries. The data wasn't saved to MDS+ because efitloader was looking for different variable names. So all we could do with TDI is hide the errors for older shots...

AreWeDreaming commented 3 months ago

I think it was @jmcclena was the one that took care of ec_launchers a while back.

jmcclena commented 3 months ago

I'm not sure why ec_launchers would print that specific error, but 163303 doesn't have any ec. EC launchers looks fine on other EC shots like 155542

orso82 commented 3 months ago

Great, thank you @jmcclena . Perhaps it's just a matter of handling better when there is no ECH for a given shot

github-actions[bot] commented 1 month ago

Stale issue message