Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Differences inside Matlab interface

Table of Contents

 

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
ITMIMAS
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')

3.4.1. Creating pulse file

...

Code Block
languagetext
>> import

...

 

...

languagetext

...

imasjava.imas
>> idx=imas_create('ids', 111, 11);
>> disp(idx)
     0
>>

3.4.2. Opening pulse file

...

languagetext

...

Code Block
languagetext
>> import imasjava.imas
>> idx=imas_open('ids', 111, 11);
>> disp(idx)
     0
>>

 

3.4.3. Closing pulse file

...

Code Block
languagetext
>> import

...

 

...

languagetext

...

imasjava.imas
>> idx=imas_open('ids', 111, 11);
>> disp(idx)
     0
>> ret=imas_close(idx)
ret =
     0
>>

3.4.4. Creation of

...

IDS

...

languagetext

...

Code Block
languagetext
>> eq=ids_gen('equilibrium')
eq =
           ids_properties: [1x1 struct]
    vacuum_toroidal_field: [1x1 struct]
               time_slice: {[1x1 struct]}
                     code: [1x1 struct]
                     time: []
>>

3.4.5. Saving

...

IDS

...

Code Block
languagetext
>> import

...

 

...

languagetext

...

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);
>>

3.4.6. Reading

...

IDS

...

languagetext

...

Code Block
languagetext
>> 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
>>