1. Differences inside Matlab interface
Below, we have collected commonly used operations related to CPOs/IDSes. You can compare both methods by looking at different implementations of similar operations.
CHEAT SHEET |
ITM | IMAS |
---|
import_ual | import imasjava.imas |
euitm_create('euitm', shot, run) | imas_create('ids', shot, run); |
euitm_open('euitm', shot, run); | imas_open('ids', shot, run) |
euitm_close(idx) | imas_close(idx) |
CPO_gen('equilibrium', 100) | ids_gen('equilibrium') |
| |
| |
| |
| |
| |
| |
| |
| |
| |
1.1. 1. Creating pulse file
ITM | IMAS |
---|
>> import_ual
>> idx=euitm_create('euitm', 111, 11);
>> disp(idx)
0
>>
|
>> import imasjava.imas
>> idx=imas_create('ids', 111, 11);
>> disp(idx)
0
>>
|
1.2. 2. Opening pulse file
ITM | IMAS |
---|
>> import_ual
>> idx=euitm_open('euitm', 111, 11);
>> disp(idx)
0
>>
|
>> import imasjava.imas
>> idx=imas_open('ids', 111, 11);
>> disp(idx)
0
>>
|
1.3. 3. Closing pulse file
ITM | IMAS |
---|
>> import_ual
>> idx=euitm_open('euitm', 111, 11);
>> disp(idx)
0
>> ret=euitm_close(idx)
ret =
0
>>
|
>> import imasjava.imas
>> idx=imas_open('ids', 111, 11);
>> disp(idx)
0
>> ret=imas_close(idx)
ret =
0
>>
|
1.4. 4. Creation of CPO/IDS
ITM | IMAS |
---|
>> eq=CPO_gen('equilibrium', 100)
eq =
1x100 struct array with fields:
datainfo
eqconstraint
eqgeometry
flush
global_param
profiles_1d
profiles_2d
coord_sys
time
codeparam
>>
|
>> eq=ids_gen('equilibrium')
eq =
ids_properties: [1x1 struct]
vacuum_toroidal_field: [1x1 struct]
time_slice: {[1x1 struct]}
code: [1x1 struct]
time: []
>>
|
1.5. 5. Saving CPO/IDS
ITM | IMAS |
---|
>> import_ual
>> idx=euitm_create('euitm', 111, 11);
>> eq=CPO_gen('equilibrium',10);
>> for i = 1: 10
eq(i).datainfo.dataprovider='tutorial';
eq(i).codeparam.codename='test put matlab';
eq(i).time=(1.0 + i);
end
>> euitm_put(idx,'equilibrium',eq);
>> euitm_close(idx);
>>
|
>> import imasjava.*
>> idx=imas_create('ids',111,11);
>> eq=ids_gen('equilibrium');
>> eq.ids_properties.comment = 'This is a test IDS';
>> eq.ids_properties.homogeneous_time = 1
eq =
ids_properties: [1x1 struct]
vacuum_toroidal_field: [1x1 struct]
time_slice: {[1x1 struct]}
code: [1x1 struct]
time: []
>> eq.time = [1 2 3 4 5 6 7 8 9 10];
>> for i =1:10
eq.time_slice{i}.time = i;
end
>> ids_put(idx,'equilibrium',eq);
>> imas_close(idx);
>>
|
1.6. 6. Reading CPO/IDS
ITM | IMAS |
---|
>> import_ual
>> idx=euitm_open('euitm', 111, 11)
idx =
0
>> eq=euitm_get(idx, 'equilibrium')
eq =
1x10 struct array with fields:
datainfo
eqconstraint
eqgeometry
flush
global_param
profiles_1d
profiles_2d
coord_sys
time
codeparam
>>
|
>> import imasjava.*
>> idx = imas_open('ids', 111, 11);
idx =
0
>> eq=ids_get(idx, 'equilibrium');
>> disp(eq.ids_properties);
comment: 'This is a test IDS'
homogeneous_time: 1
>>
|