Data entry API¶
- imas_open()¶
idx = imas_open ( uri [, mode] )
Open or create the Data Entry at the provided URI.
- Parameters:
uri – URI
mode –
Low level IMAS pulse file access mode. Available options:
40:
OPEN_PULSE(default). Opens the access to the data only if the Data Entry exists, returns error otherwise.41:
FORCE_OPEN_PULSE. Opens access to the data, creates the Data Entry if it does not exists yet.42:
CREATE_PULSE. Creates a new empty Data Entry (returns error if Data Entry already exists) and opens it at the same time.43:
FORCE_CREATE_PULSE. Creates an empty Data Entry (overwrites if Data Entry already exists) and opens it at the same time.
- Returns:
Data Entry index
- imas_open_env()¶
idx = imas_open_env (name, pulse, run, user, tokamak, version)
Open the Data Entry defined by the provided parameters.
- Parameters:
name – Name of the database (by convention ‘ids’).
pulse – Pulse number.
run – Run number.
user – User name
tokamak – Tokamak name, also known as Database name
version – Major version of the data dictionary, e.g. “3”
- Returns:
Data Entry index
- imas_open_env_backend()¶
idx = imas_open_env_backend (pulse, run, user, tokamak, version, backend_id)
Open the Data Entry defined by the provided parameters.
- Parameters:
pulse – Pulse number.
run – Run number.
user – User name
tokamak – Tokamak name, also known as Database name
version – Major version of the data dictionary, e.g. “3”
backend_id –
ID of the backend to use. Available options:
- Returns:
Data Entry index
- imas_create_env()¶
idx = imas_create_env(name, pulse, run, refpulse, refrun, user, tokamak, version)
Create a new database entry.
Caution
This method erases the previous entry if it existed!
- Parameters:
name – Name of the database (by convention ‘ids’).
pulse – Pulse number.
run – Run number.
refpulse – not used
refrun – not used
user – User name
tokamak – Tokamak name, also known as Database name
version – Major version of the data dictionary, e.g. “3”
- Returns:
Data Entry index
- imas_create_env_backend()¶
idx = imas_create_env_backend(pulse, run, user, tokamak, version, backend_id)
Create a new database entry.
Caution
This method erases the previous entry if it existed!
- Parameters:
pulse – Pulse number.
run – Run number.
user – User name
tokamak – Tokamak name, also known as Database name
version – Major version of the data dictionary, e.g. “3”
backend_id –
ID of the backend to use. Available options:
- Returns:
Data Entry index
- imas_list_all_occurrences()¶
imas_list_all_occurrences (idx, ids_name[, node_path])
List all non-empty occurrences of IDSname in the dataset, and optionnally return the content of a descriptive node path in MATLAB External Interfaces
- Parameters:
idx – database index, returned by imas_open/imas_create.
ids_name – name of the IDS
node_path – DD path of a string node
- Returns:
list of occurrences if the data entry (idx) list of the contents of the node_path for each occurrence found if node_path is specified, otherwise returns an empty list
- imas_build_uri_from_legacy_parameters()¶
uri = imas_build_uri_from_legacy_parameters (backend_id, pulse, run, user, database, version [, options])
Creates an URI string from legacy parameters
- Parameters:
backend_id –
ID of the backend to use. Available options:
pulse – Pulse number.
run – Run number.
user – User name
database – Name of IMAS database
version – Major version of the data dictionary, e.g. “3”
options – Deprecated, available for backwards compatibility
- Returns:
URI
Version constants¶
- imas_versions()¶
out = imas_versions ()
Get version info of the IMAS library