Table of Contents

Class TouchstoneData

Namespace
Touchstone.Parser.Models
Assembly
Touchstone.Parser.dll

Represents the complete parsed contents of a Touchstone (.sNp) file. Provides strongly typed access to frequency points, network parameters, options, and metadata.

public sealed class TouchstoneData
Inheritance
TouchstoneData
Inherited Members
Extension Methods

Remarks

This is the primary output of TouchstoneParser. All frequency values are normalized to Hertz internally. All parameter values are normalized to real/imaginary representation internally.

Constructors

TouchstoneData(TouchstoneOptions, int, IReadOnlyList<FrequencyPoint>, IReadOnlyList<string>, string?)

Initializes a new instance of the TouchstoneData class.

public TouchstoneData(TouchstoneOptions options, int numberOfPorts, IReadOnlyList<FrequencyPoint> frequencyPoints, IReadOnlyList<string> comments, string? fileName = null)

Parameters

options TouchstoneOptions

The parsed option line configuration.

numberOfPorts int

The number of ports.

frequencyPoints IReadOnlyList<FrequencyPoint>

The list of frequency points.

comments IReadOnlyList<string>

The comment lines.

fileName string

The optional source file name.

Exceptions

ArgumentNullException

Thrown when required parameters are null.

ArgumentOutOfRangeException

Thrown when numberOfPorts is less than 1.

Properties

Comments

Gets the comment lines extracted from the file (without the '!' prefix).

public IReadOnlyList<string> Comments { get; }

Property Value

IReadOnlyList<string>

Count

Gets the number of frequency points in the dataset.

public int Count { get; }

Property Value

int

FileName

Gets the source file name, if available.

public string? FileName { get; }

Property Value

string

Frequencies

Gets an enumerable of all frequency values in Hertz.

public IEnumerable<double> Frequencies { get; }

Property Value

IEnumerable<double>

FrequencyPoints

Gets the ordered list of frequency points with their parameter data. Frequencies are in strictly increasing order and normalized to Hertz.

public IReadOnlyList<FrequencyPoint> FrequencyPoints { get; }

Property Value

IReadOnlyList<FrequencyPoint>

this[int]

Gets the FrequencyPoint at the specified index.

public FrequencyPoint this[int index] { get; }

Parameters

index int

The zero-based index.

Property Value

FrequencyPoint

The frequency point at the specified index.

NumberOfPorts

Gets the number of ports in the network (N in .sNp).

public int NumberOfPorts { get; }

Property Value

int

Options

Gets the option line configuration from the file.

public TouchstoneOptions Options { get; }

Property Value

TouchstoneOptions

Methods

GetParameter(int, int)

Returns the parameter data for a specific S‑parameter (e.g., S11, S21) across all frequency points.

public IEnumerable<(double FrequencyHz, NetworkParameter Value)> GetParameter(int row, int col)

Parameters

row int

The output port index (0-based).

col int

The input port index (0-based).

Returns

IEnumerable<(double FrequencyHz, NetworkParameter Value)>

An enumerable of tuples containing the frequency in Hz and the NetworkParameter value at each frequency point.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.