sknrf.app.dataviewer.model.snp module

SNP File (sknrf.model.dataviewer.snp)

This module converts between the Touchstone text format, the SNP object format, Scikit-rf network, and the sknrf datagroup.

Touchstone Text Format

Touchstone Specification

Note

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

See Also

sknrf.model.dataviewer.mdif.MDIF, sknrf.model.dataviewer.dataset.DatagroupModel, sknrf.model.dataviewer.dataset.DatasetModel

class sknrf.app.dataviewer.model.snp.SNPBlock(sweep=None, attributes=None, independent=None, dependents=None)

Bases: MDIFBlock

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

Bases: MDIFGroup

class sknrf.app.dataviewer.model.snp.SNP(name='', date='', dataBlocks=None)

Bases: MDIF

SNP Object

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

Parameters:
namestr

Name of the SNP file.

datestr

Creation date/time of the SNP File

dataBlockslist of SNPGroup objects
static read(filename)

Reads a Touchstone text file into the SNP object.

Parameters:
filenamestr

SNP filename.

Returns:
SNP

A new SNP object.

static read_network(filename)

Reads a Touchstone text file into the scikit-rf network object.

Parameters:
filenamestr

SNP filename.

Returns:
rf.Network

A new Scikit-rf network object.

static read_dataset(datagroup, filename, num_ports, 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, num_ports)

Reads an MDIF text file into an existing datagroup.

Parameters:
filenamestr

MDIF filename.

Returns:
DatagroupModel

A new datagroup.

write(filename)

Writes a SNP object to an SNP text file.

Parameters:
filenamestr

SNP filename.

static write_network(network, filename)

Writes a Scikit-rf network to an SNP text file.

Parameters:
networkrf.network

Scikit-rf network

filenamestr

SNP filename.