sknrf.app.dataviewer.model.mdif module

MDIF File (sknrf.model.dataviewer.mdif)

This module converts between the MDIF text format, the MDIF object format, and the sknrf datagroup.

MDIF Text Format

MDIF Specification

Note

The MDIF Specification is supported with the following exceptions:
  • Depedent parameters are assumed to be complex numbers.

  • Dependent parameters cannot be sparse matricies

  • Dependent paramters cannot contain measurement units

See Also

sknrf.model.dataviewer.dataset.DatagroupModel, sknrf.model.dataviewer.dataset.DatasetModel, sknrf.model.dataviewer.snp.SNP

class sknrf.app.dataviewer.model.mdif.MDIFBlock(sweep=None, attributes=None, independent=None, dependents=None)

Bases: object

MDIF Block Object

The MDIF Block contains the measurement response for a given measurement sweep index.

Parameters:
sweeplist

Values of the sweep parameters.

attributeslist

Values of the attributes parameters.

independentnumpy ndarray

Values of the independent parameter.

dependentsnumpy ndarray

Values of the dependents parameters.

class sknrf.app.dataviewer.model.mdif.MDIFGroup(name, type_='', sweeps=None, sweep_types=None, attributes=None, attribute_types=None, independent='', independent_type='', dependents=None, dependent_types=None, data=None)

Bases: object

MDIF Group Object

The MDIF Group contains a MDIFBlock for each measurement sweep index.

Parameters:
namestr

Name of the MDIF file.

typestr

Name of the measurement type.

sweepslist of str

Names of the sweep parameters.

sweep_typeslist of str

Data types of the sweep parameters.

attributeslist of str

Names of the attribute parameters.

attribute_typeslist of str

Data types of the attribute parameters.

independentstr

Names of the independent (inner) sweep parameter.

independent_typestr

Data type of the independent sweep parameter.

dependentslist of str

Names of the dependent parameters.

dependent_typeslist of str

Data types of the dependent parameters.

datalist of MDIFBlock objects
class sknrf.app.dataviewer.model.mdif.MDIF(name, date='', dataBlocks=None)

Bases: object

MDIF Object

The MDIF object contains a MDIFGroup for each measurement. It allows read/write access to the MDIF file format.

Parameters:
namestr

Name of the MDIF file.

datestr

Creation date/time of the MDIF File

dataBlockslist of MDIFGroup objects
static read(filename)

Reads an MDIF text file into the MDIF object.

Parameters:
filenamestr

MDIF filename.

Returns:
MDIF

A new MDIF object.

static read_dataset(datagroup, filename, group_index=0)

Reads an MDIF text file dataBlock into a dataset.

Parameters:
datagroupDatagroupModel

Parent datagroup where the resulting dataset is stored.

filenamestr

MDIF filename.

group_indexint

MDIF dataBlock index

use_group_namebool

If True (default), use the MDIF dataBlock name as the dataset name. If False, use the MDIF filename as the dataset name.

Returns:
DatasetModel

A new dataset.

static read_datagroup(filename, class_=None)

Reads an MDIF text file into an existing datagroup.

Parameters:
filenamestr

MDIF filename.

Returns:
DatagroupModel

A new datagroup.

write(filename)

Writes a MDIF object to an MDIF text file.

Parameters:
filenamestr

MDIF filename.

static write_dataset(dataset, filename)

Writes a dataset to an MDIF text file.

Parameters:
datasetDatasetModel

Parent datagroup where the resulting dataset is stored.

filenamestr

MDIF filename.

static write_datagroup(datagroup, filename)

Writes a datagroup to an MDIF text file.

Parameters:
datagroupDatagroupModel

Parent datagroup where the resulting dataset is stored.

filenamestr

MDIF filename.