gafusion / omas

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

General solution for MDS+ run IDs and non-standard Trees #260

Closed AreWeDreaming closed 9 months ago

AreWeDreaming commented 1 year ago

There are already special cases at DIII-D for EFIT and PROFILES_tree (after #256 ) which are handled as special cases with dedicated keyword arguments. However, this is a much more general problem with can affect a lot more MDS+ trees.

Hence, the system that handles which MDS+ tree and pulse id (i.e. shot + run_id) is loaded should be generalized. The following snippet shows how a generic solution could look like

tree_dict = {}
tree_dict['equilibrium'] = ("EFIT", "01")
tree_dict['core_profiles.*'] = ("OMFIT_PROFS", "001")
tree_dict['core_profiles.global_quantities.v_loop'] = (None, None)
ods.open('d3d', 194844, options=tree_dict)

This would specify the tree locations based on ODS locations which is the natural way of defining them. This will require some not insubstantial remodeling of omas_machine and related modules.

github-actions[bot] commented 1 year ago

Stale issue message

AreWeDreaming commented 12 months ago

@orso82 Any feedback on this?

orso82 commented 12 months ago

I don't really see the reason of making things more complicated. Doesn't current system already allow you to handle all of this:

options = {}
options['equilibrium'] = "EFIT_01"
options['core_profiles'] = "OMFIT_PROFS_001"
options['core_profiles.global_quantities.v_loop'] = None
pfbuxton commented 11 months ago

We have added extra options to the machine mapping files which allows for this.

We access data using syntax like this:

from omas import ODS
ods = ODS().open(
    'machine', 'st40',
    10009,
    options={
        'equilibrium_code_run': 'EFIT#RUN01',
        'core_profiles_code_run': 'ASTRA#RUN01'
    }
)

within the st40.json file we have entries like this:

 "equilibrium.time_slice.:.global_quantities.ip": {
  "COCOSIO": 11,
  "PYTHON": "equilibrium__tokamak_energy(ods, {pulse}, {equilibrium_code_run!r})"
 },
 "core_profiles.profiles_1d.:.ion.:.temperature": {
  "PYTHON": "core_profiles__tokamak_energy(ods, {pulse}, {core_profiles_code_run!r})"
 },

For equilibrium_code_run we have mappings to our MDSplus database for: EFIT, FreeGS, Fiesta, ASTRA, METIS, CHEASE, and CORSICA.

In my opinion: no changes need to be made to OMFIT source, just the local implementation.

github-actions[bot] commented 9 months ago

Stale issue message