Skip to content
Snippets Groups Projects

Fix complete ids corsica keep ids structures

Closed Olivier Sauter requested to merge fix_complete_IDS_CORSICA_keep_IDS_structures into master
1 unresolved thread

@carpanes should work the same for you, can you test and then merge. It should provide a correct ids according to latest structure, so we can put with ids2database after complete_IDS_CORSICA

Merge request reports

Pipeline #31667 passed

Pipeline passed for 3110cb16 on fix_complete_IDS_CORSICA_keep_IDS_structures

Closed by Olivier SauterOlivier Sauter 5 years ago (Feb 6, 2020 10:15pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • Author Maintainer

      @carpanes Seems pf_active.time (51 points) is the same as pf_active.coil{index_coil(1)}.current.time so if set in coil should remove from top and set homogeneous to 0. OK?

    • At a first glance I would say that all the currents share the same time, so we could also put homogeneous = 1 , and provide the time directly there, removing the other one. However, the field pf_active.coil{ii}.current.data and pf_active.coil{ii}.current.time was filled this way by CORSICA data originally so we might not want to change remove the original data.

    • Author Maintainer

      Yes better keep local tim/data

    • Please register or sign in to reply
    • Author Maintainer

      I fixed most things. One question is pf_passive empty or not. Do you use something from the Corsica IDS.pf_passive?

      (cannot ids_put because homogeneous not set, but should not set if empty altogether)

    • Author Maintainer

      @carpanes I added a ids_check_empty and it seems pf_passive is empty, so I guess you do not use it?

      You can check with my shot, run=1111 in my iter database or rmfield pf_passive before running liuqe

    • Indeed, vessel current which are the only eventual passive structure, we still don't know how to use them in ITER. Also for the case of TCV I haven't implemented yet, nor I think we are providing them to the IDS structure at the moment.

    • Please register or sign in to reply
  • Olivier Sauter
    Olivier Sauter @osauter started a thread on commit c3f59cb8
96 107
97 108 %% Limiter description
98 109 tmp = data_limiter();
110 IDS_out.wall.ids_properties.homogeneous_time = 0; % no times are set so just say not homogeneous
99 111 IDS_out.wall.description_2d{1}.limiter.unit{1}.outline.r = tmp.r;
100 112 IDS_out.wall.description_2d{1}.limiter.unit{1}.outline.z = tmp.z;
101 113
114 % problem with mex ids_put when time default or empty, make outline and ggd empty
115 IDS_out.wall.description_2d{1}.mobile.unit{1}.outline = {};
116 IDS_out.wall.description_ggd = {};
  • Author Maintainer

    @amerle the .time in these substructure exist but are either empty or "default value". However I get an error in the ids_put:

    ual_end_action: [UALBackendException = Cannot get Time information] ual_print_context: [UALLowlevelException = Cannot find context 8 in store] problems in putting data in database: Error using ids_put internal error occured with error code -1 ... in aos description_ggd/grid_ggd ... in IDS wall

    What is the rule? Or may be there is no rule ? At this stage I made the parent an empty cell then it works

  • I don't know if it's a rule or a recommendation but yes for any array that exists you have to provide its dimensions. So for a dynamic array of structure time must be filled (or if homogeneous time is selected the base time). I think for time that is a rule. In that case it triggers an error because it is used by the backend and it can't find it (it's not an error that is linked to the mex interface particularly)

    Same as always, you have to remove all unused arrays of structures before doing ids_put.

    This is why for the mex I provide:

    • ids_gen2 which initialises every array of structures as empty
    • ids_allocate which given an ids name, a path within the ids and a size will allocate the corresponding array of structures with the correct size.

    This way is more similar to the FORTRAN interface if you see what I mean.

    Edited by Antoine Merle
  • Author Maintainer

    Actually having empty structures in the ids_gen is a problem since we are adding just a few data like xxx.yyy.name and xxx.yyy.data. If we do not copy the expected substructure in yyy, then xxx.yyy has only the "name" and "data" fields and the ids_put fails.

    So I cannot use something like ids_gen2, nor use the ids_get with your mex, but need the ids_gen, then copy the default structure with all expected fields in yyy then put the relevant data in yyy.name and yyy.data. What I do not do is to check that a field exists before modifying, which I should actually like isfield(xxx.yyy,'name');...

  • But ... that was the purpose of my second bullet with the ids_allocate part ...

  • Author Maintainer

    OK I never tried that one hence do not know, you can do sub-allocation like:

    magnetics.bpol_probe(2:N) = ids_allocate('magnetics','bpol_probe',N-1);

    or something like that?

    OK I just checked, indeed I can do the above. But is it standard?

  • Is it shared by the other MATLAB interface? no

    But the plan is to phase out the other MATLAB interface, and I think this approach has advantages over the previous one so I hope no one will truly oppose it.

    Since with ids_gen2, all arrays are initially empty, you would rather do something like:

    magnetics.bpol_probe = ids_allocate('magnetics','bpol_probe',N);
    Edited by Antoine Merle
  • Please register or sign in to reply
  • @osauter I will test and than merge, probably later in the day .

    • Resolved by Francesco Carpanese

      @osauter is the IDS that I can get from the following script ( e-mail exchange)

       ids_to_get = {'pf_active','magnetics','tf','wall','equilibrium'};
       aa=gdat(130506,'ids','run',1111,'source',ids_to_get,'machine','imas','database_user','sautero','tokamak_name','iter');

      done with the latest modification in this merge request? In that can I tested and it data seem ok for LIUQE.

    • Author Maintainer

      What is "the full database"?

    • The full CORSICA IDS database that you can get with the commands from HPC iter

      module load IMAS
      imasdb iter
      scenario_summary -s ITER,CORSICA
    • Author Maintainer

      Did you just try? I get:

      `scenario_summary -s ITER,CORSICA

      File "/work/imas/extra/bin/scenario_summary", line 40

      print('Error reading yaml '+files[i], file=sys.stderr)
                                                ^

      SyntaxError: invalid syntax `

      Edited by Olivier Sauter
    • I've just tried but let me double check I didn't mistake the copy paste

    • The reference one they are using is the 130510, the remaining ones are pretty old.

    • Author Maintainer

      How do you see it's old?

      It seems it's a python script, do you need a module load of specific python?

    • Author Maintainer

      OK I did shot 13510 you can get it with run=11 in my iter, sautero database

    • Author Maintainer

      OK I did 130501 to 130510 (except 130507 which fails with complete_IDS_CORSICA)

      You find them all in my iter database, runs 11

    • Author Maintainer

      (And I could do summary after module purge;module load IMAS

    • Perfect thank you very much Olivier. Information about new and old come from discussion with Kim. Yes, probably you needed a module purge.

    • What is the run number for 130510? with the call

      aa=gdat(130510,'ids','run',1111,'source',...
      ids_to_get,'machine','imas','database_user','sautero','tokamak_name','iter');

      I get

      ual_open_pulse: [UALBackendException = %TREE-E-FOPENR, Error opening file read-only.] Context type = 101 Backend @ = 0x7f4d30e5c830 context_uid = 139975953256512 backend_id = 12 (MDSPLUS_BACKEND) shot = 130510 run = 1111 user = "sautero" tokamak = "iter" version = "3" Warning: could not imas_open_env with following gdat_data.gdat_params:

      In gdat_imas (line 292) In gdat (line 190) In get_data_tutorial (line 9)

      ans =

      struct with fields:

            data_request: 'ids'
                 machine: 'imas'
                  doplot: 0
                nverbose: 1
                     run: 1111
               occurence: 0
                    help: [1x1 struct]
                  source: {'pf_active'  'magnetics'  'tf'  'wall'  'equilibrium'}
           database_user: 'sautero'
            tokamak_name: 'iter'
      data_major_version: '3'

      Warning: problems calling gdat_imas

      In gdat (line 196) In get_data_tutorial (line 9) Error using imas_open_env Error opening imas shot 130510, run 1111 user sautero, tokamak iter, version 3

      Error in gdat_imas (line 288) gdat_data.gdat_params.idx_imas_open_env = imas_open_env('ids', shot, gdat_data.gdat_params.run,gdat_data.gdat_params.database_user, ...

      Error in gdat (line 190) [gdat_data,gdat_params,error_status,varargout] = feval(['gdat_' lower(machine_eff)],args{:});

      Error in get_data_tutorial (line 9) aa=gdat(130510,'ids','run',1111,'source',...

    • Author Maintainer

      run 11 as for the others I redid now (except 06)

    • Please register or sign in to reply
  • Francesco Carpanese resolved all threads

    resolved all threads

  • Please register or sign in to reply
    Loading