Versions Compared

Key

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

High Level Interfaces & their Application Programming Interface - PDF presentation

High Level Interfaces and their API (Application Programming Interface)

...

Info
A Data Entry is an IMAS concept for designating a collection of IDSs present in a local (pulse file) or remote data source. A Data Entry is associated to with a shot and a run number.

The HLI API covers all available Access Layer features with the following exposed methods:

...

In this tutorial, we will describe each method of the HLI API (section 1.1. HLI API). We will use the Python HLI.  

API functions name and their signature may differ from one HLI to another. Documentation of all others HLIs is available in the User guide available from this page: https://confluence.iter.org/display/IMP/Integrated+Modelling+Home+Page

...

The creation of a new Data Entry using the MDS+ or HDF5 backend:

  • consists in creating a new (MDS+/HDF5) pulse file on the disk
  • requires to have at least an existing 'database' (corresponding to a directory when using the MDS+ backend) which will host the new pulse filefor hosting pulse file(s)

So, let's first create a new database named 'data_access_tutorial' which will belong to the current user.

...

Let's check that the database (it's simply a directory with some subdirectories for MDS+) has been successfully created:

Code Block
<g2lfleur@s52 ~>ls -alh ~/public/imasdb/data_access_tutorial/
total 6.0K
drwxr-xr-x  3 g2lfleur g2itmdev 2.0K Sep 16 13:29 .
drwxr-xr-x  5 g2lfleur g2itmdev 2.0K Sep 16 13:29 ..
drwxr-xr-x 12 g2lfleur g2itmdev 2.0K Sep 16 13:29 3

...

Code Block
import imas
import getpass
from imas import imasdef

#creates#creating the Data Entry object 'data_entry', a kind of handler ofwhich handles the pulse file with shot=15000, run=1, belonging to database 'data_access_tutorial' of the current user, using the MDS+ backend
data_entry = imas.DBEntry(imasdef.MDSPLUS_BACKEND, 'data_access_tutorial, 15000, 1, user_name=getpass.getuser())

#creates#creating the pulse file associatedhandled toby the Data Entry object 'data_entry' previously created
data_entry.create()

#here, we can perform some write operations using the put() operation, it will be dealt with later
#... 

#closes the data_entry
data_entry.close()

...