OOMMFDrive#
- class micromagneticdata.OOMMFDrive(name, number, dirname='.', x=None, use_cache=False, **kwargs)#
Drive class for OOMMFDrives (created automatically).
This class provides utility for the analysis of individual OOMMF drives. It should not be created explicitly. Instead, use
micromagneticdata.Drivewhich automatically creates adriveobject of the correct sub-type.- Parameters:
name (str) – System’s name.
number (int) – Drive number.
dirname (str, optional) – Directory in which system’s data is saved. Defults to
'./'.x (str, optional) – Independent variable column name. Defaults to
Noneand depending on the driver used, one is found automatically.use_cache (bool, optional) – If
Truethe Drive object will read tabular data and the names and number of magnetisation files only once. Note: this prevents Drive to detect new data when looking at the output of a running simulation. If set toFalsethe data is read every time the user accesses it. Defaults toFalse.
- Raises:
IOError – If the drive directory cannot be found.
Examples
Getting drive object.
>>> import os >>> import micromagneticdata as md ... >>> dirname = os.path.join(os.path.dirname(__file__), 'tests', 'test_sample') >>> drive = md.Drive(name='rectangle', number=0, dirname=dirname)
Methods
__dir__Default dir() implementation.
__eq__Return self==value.
__getitem__Magnetisation field of an individual step or subpart of the drive.
__iter__Iterator.
__lshift__Concatenate multiple drives of the same type.
Representation string.
ovf2vtkOVF to VTK conversion.
register_callbackRegister a callback to which a field is passed before being returned.
sliderWidget for selecting individual steps.
to_xarrayExport
micromagneticdata.Driveasxarray.DataArrayProperties
MIF file.
callbacksReturn all registered callbacks.
dirnameDescriptor allowing setting attributes only with values of a certain type.
hvPlot interface, Holoviews/hvplot based.
infoDrive information.
m0Inital magnetisation.
nNumber of steps.
nameDescriptor allowing setting attributes only with values of a certain type.
numberDescriptor allowing setting attributes only with scalars (
numbers.Real).tableTable object.
use_cacheUse caching for scalar data and the list of magnetisation files.
Independent variable name.
- __repr__()#
Representation string.
- Returns:
Representation string.
- Return type:
str
Examples
Representation string.
>>> import os >>> import micromagneticdata as md ... >>> dirname = os.path.join(os.path.dirname(__file__), 'tests', 'test_sample') >>> drive = md.Drive(name='rectangle', number=0, dirname=dirname) >>> drive OOMMFDrive(name='rectangle', number=0, dirname='...test_sample', x='t')
- property calculator_script#
MIF file. This property returns a string with the content of MIF file.
- Returns:
MIF file content.
- Return type:
str
Examples
Getting MIF file.
>>> import os >>> import micromagneticdata as md ... >>> dirname = os.path.join(os.path.dirname(__file__), 'tests', 'test_sample') >>> drive = md.Drive(name='rectangle', number=6, dirname=dirname) >>> drive.calculator_script '# MIF 2...'
Getting mx3 file
TODO add mumax3 output to the pre-computed data
- property x#
Independent variable name.
- Parameters:
value (str) – Independent variable name.
- Returns:
Representation string.
- Return type:
str
- Raises:
ValueError – If the column name does not exist in table.
Examples
Getting and setting independent variable name.
>>> import os >>> import micromagneticdata as md ... >>> dirname = os.path.join(os.path.dirname(__file__), 'tests', 'test_sample') >>> drive = md.Data(name='hysteresis', dirname=dirname)[0] >>> drive.x 'B_hysteresis' >>> drive.x = 'Bx_hysteresis'