Fix complete ids corsica keep ids structures
@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
Activity
@carpanes Seems
pf_active.time
(51 points) is the same aspf_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
andpf_active.coil{ii}.current.time
was filled this way by CORSICA data originally so we might not want to change remove the original data.
@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
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 = {}; @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 MerleActually 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');...
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
@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.
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 SauterWhat 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',...