Versions Compared

Key

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

...

Code Block
Slice time :  1.0
Image raw:
[[1 2 3 4 5]
 [2 3 4 5 6]
 [3 4 5 6 7]]
-----


 delete_data

A specific occurrence of an IDS can be deleted from an existing Data Entry using the delete_data() operation.

The following code erases the occurrence 0 of the 'magnetics' IDS previously created in previous sections:

Code Block
import imas
import getpass
import numpy as np
from imas import imasdef

#creating the Data Entry object which 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)

#removing occurrence 0 of the 'magnetics' IDS previously appended to the Data Entry
data_entry.delete_data('magnetics', 0) #opens the Data Entry if it is closed

#closing the Data Entry 
data_entry.close()