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
optionsTouchstoneOptionsThe parsed option line configuration.
numberOfPortsintThe number of ports.
frequencyPointsIReadOnlyList<FrequencyPoint>The list of frequency points.
commentsIReadOnlyList<string>The comment lines.
fileNamestringThe 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
Count
Gets the number of frequency points in the dataset.
public int Count { get; }
Property Value
FileName
Gets the source file name, if available.
public string? FileName { get; }
Property Value
Frequencies
Gets an enumerable of all frequency values in Hertz.
public IEnumerable<double> Frequencies { get; }
Property Value
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
this[int]
Gets the FrequencyPoint at the specified index.
public FrequencyPoint this[int index] { get; }
Parameters
indexintThe 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
Options
Gets the option line configuration from the file.
public TouchstoneOptions Options { get; }
Property Value
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
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.