{"id":49172939,"url":"https://github.com/suryakantamangaraj/touchstone-dotnet","last_synced_at":"2026-04-24T22:00:42.725Z","repository":{"id":352563603,"uuid":"1214162273","full_name":"suryakantamangaraj/touchstone-dotnet","owner":"suryakantamangaraj","description":".NET library for Touchstone .sNp file parsing and S‑parameter handling. Offers strongly typed classes, LINQ‑friendly APIs, and seamless integration into enterprise RF/microwave analysis and simulation pipelines.","archived":false,"fork":false,"pushed_at":"2026-04-22T06:22:51.000Z","size":465,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-22T20:27:26.865Z","etag":null,"topics":["dotnet","microwave","parser","rf","s-parameters","s2p","touchstone"],"latest_commit_sha":null,"homepage":"http://suryaraj.com/touchstone-dotnet/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suryakantamangaraj.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"suryakantamangaraj","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2026-04-18T07:42:28.000Z","updated_at":"2026-04-22T06:22:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/suryakantamangaraj/touchstone-dotnet","commit_stats":null,"previous_names":["suryakantamangaraj/touchstone-dotnet"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/suryakantamangaraj/touchstone-dotnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suryakantamangaraj%2Ftouchstone-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suryakantamangaraj%2Ftouchstone-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suryakantamangaraj%2Ftouchstone-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suryakantamangaraj%2Ftouchstone-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suryakantamangaraj","download_url":"https://codeload.github.com/suryakantamangaraj/touchstone-dotnet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suryakantamangaraj%2Ftouchstone-dotnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32198232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-23T20:19:26.138Z","status":"ssl_error","status_checked_at":"2026-04-23T20:19:23.520Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","microwave","parser","rf","s-parameters","s2p","touchstone"],"created_at":"2026-04-22T20:04:48.945Z","updated_at":"2026-04-23T21:00:59.343Z","avatar_url":"https://github.com/suryakantamangaraj.png","language":"C#","funding_links":["https://github.com/sponsors/suryakantamangaraj"],"categories":[],"sub_categories":[],"readme":"# Touchstone.Parser\n\n\u003e **A .NET library for Touchstone `.sNp` parsing and S‑parameter analysis in RF/microwave engineering.**\n\n[![NuGet](https://img.shields.io/nuget/v/Touchstone.Parser?style=flat-square\u0026logo=nuget\u0026label=NuGet)](https://www.nuget.org/packages/Touchstone.Parser)\n[![NuGet Downloads](https://img.shields.io/nuget/dt/Touchstone.Parser?style=flat-square\u0026logo=nuget)](https://www.nuget.org/packages/Touchstone.Parser)\n[![Build](https://img.shields.io/github/actions/workflow/status/suryakantamangaraj/touchstone-dotnet/ci.yml?branch=main\u0026style=flat-square\u0026logo=github\u0026label=CI)](https://github.com/suryakantamangaraj/touchstone-dotnet/actions/workflows/ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/github/suryakantamangaraj/touchstone-dotnet?style=flat-square\u0026logo=codecov)](https://codecov.io/gh/suryakantamangaraj/touchstone-dotnet)\n[![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue?style=flat-square\u0026logo=github)](https://suryakantamangaraj.github.io/touchstone-dotnet/)\n[![License](https://img.shields.io/github/license/suryakantamangaraj/touchstone-dotnet?style=flat-square)](LICENSE)\n[![.NET](https://img.shields.io/badge/.NET-6.0%20%7C%20Standard%202.1-512BD4?style=flat-square\u0026logo=dotnet)](https://dotnet.microsoft.com/)\n\n**Touchstone.Parser** is a clean, modular, enterprise-ready .NET library for parsing [Touchstone](https://ibis.org/) (`.sNp`) files — the industry-standard format for RF and microwave S‑parameter data. It provides strongly typed classes, LINQ-friendly APIs, and seamless integration into simulation and analysis workflows.\n\n---\n\n## ✨ Features\n\n- **Parse `.sNp` files** into strongly typed C# classes (`TouchstoneData`, `FrequencyPoint`, `NetworkParameter`)\n- **Multi-port support** — 1‑port through N‑port networks\n- **All data formats** — Real/Imaginary (RI), Magnitude/Angle (MA), Decibel/Angle (DB)\n- **All frequency units** — Hz, kHz, MHz, GHz with automatic normalization\n- **All parameter types** — S, Y, Z, H, G\n- **LINQ-friendly APIs** — query S‑parameters with `GetS11()`, `GetS21()`, `GetParameter(i, j)`\n- **RF calculations** — insertion loss, return loss, VSWR out of the box\n- **Export utilities** — CSV export and Touchstone writer for round-trip fidelity\n- **Async support** — `ParseAsync()` with cancellation token\n- **Cross-platform** — targets `net6.0` and `netstandard2.1`\n- **Ecosystem breadth** — check out the [Python version](https://github.com/suryakantamangaraj/touchstone-python) for Python-based workflows\n- **Zero dependencies** — pure .NET, no external packages\n\n---\n\n## 📦 Installation\n\n```bash\ndotnet add package Touchstone.Parser\n```\n\nOr via the NuGet Package Manager:\n\n```\nInstall-Package Touchstone.Parser\n```\n\n---\n\n## 🚀 Quick Start\n\n```csharp\nusing Touchstone.Parser.Parsing;\nusing Touchstone.Parser.Utilities;\nusing Touchstone.Parser.Models;\n\n// Parse a Touchstone file\nvar data = TouchstoneParser.Parse(\"filter.s2p\");\n\nConsole.WriteLine($\"Ports: {data.NumberOfPorts}\");\nConsole.WriteLine($\"Frequency points: {data.Count}\");\n\n// Query S21 insertion loss with LINQ\nforeach (var (freqHz, param) in data.GetS21())\n{\n    double freqGhz = FrequencyConverter.FromHz(freqHz, FrequencyUnit.GHz);\n    Console.WriteLine($\"{freqGhz:F3} GHz → S21 = {param.MagnitudeDb:F2} dB\");\n}\n\n// Filter to a frequency range\nvar passband = data.InFrequencyRange(2.0e9, 3.0e9);\n\n// Compute VSWR\nforeach (var (freqHz, vswr) in data.ToVswr())\n{\n    Console.WriteLine($\"VSWR = {vswr:F3}\");\n}\n\n// Export to CSV\nusing var writer = new StreamWriter(\"output.csv\");\ndata.ToCsv(writer, FrequencyUnit.GHz, DataFormat.DecibelAngle);\n```\n\n---\n\n## 📖 API Overview\n\n### Parsing\n\n| Method | Description |\n|--------|-------------|\n| `TouchstoneParser.Parse(filePath)` | Parse from a file path |\n| `TouchstoneParser.Parse(stream, fileName?)` | Parse from a stream |\n| `TouchstoneParser.Parse(textReader, fileName?)` | Parse from a TextReader |\n| `TouchstoneParser.ParseString(content, fileName?)` | Parse from a raw string |\n| `TouchstoneParser.ParseAsync(filePath, ct)` | Async file parsing |\n\n### Data Access (LINQ-friendly)\n\n| Method | Description |\n|--------|-------------|\n| `data.GetParameter(row, col)` | Get any S‑parameter across all frequencies |\n| `data.GetS11()` / `GetS21()` / `GetS12()` / `GetS22()` | Common 2‑port shortcuts |\n| `data.Frequencies` | All frequency values in Hz |\n| `data.GetFrequenciesIn(FrequencyUnit.GHz)` | Frequencies in any unit |\n| `data[index]` | Access a specific frequency point |\n\n### RF Calculations\n\n| Method | Description |\n|--------|-------------|\n| `data.ToInsertionLoss()` | \\|S21\\| insertion loss in dB |\n| `data.ToReturnLoss()` | \\|S11\\| return loss in dB |\n| `data.ToVswr()` | VSWR from S11 |\n\n### Filtering \u0026 Export\n\n| Method | Description |\n|--------|-------------|\n| `data.InFrequencyRange(minHz, maxHz)` | Filter to frequency range |\n| `data.Where(predicate)` | Custom filtering |\n| `data.ToCsv(writer, unit, format)` | Export to CSV |\n| `data.ToCsvString(unit, format)` | Export to CSV string |\n| `TouchstoneWriter.Write(data, filePath)` | Write back to Touchstone format |\n\n### Utilities\n\n| Method | Description |\n|--------|-------------|\n| `FrequencyConverter.Convert(val, from, to)` | Convert between frequency units |\n| `NetworkParameter.FromRealImaginary(re, im)` | Create from RI |\n| `NetworkParameter.FromMagnitudeAngle(mag, deg)` | Create from MA |\n| `NetworkParameter.FromDecibelAngle(dB, deg)` | Create from DB |\n\n---\n\n## 🏗️ Project Structure\n\n```\ntouchstone-dotnet/\n├── src/\n│   └── Touchstone.Parser/          # Core library\n│       ├── Models/                  # Domain models (enums, data classes)\n│       ├── Parsing/                 # Parser engine\n│       └── Utilities/               # Converters, extensions, writer\n├── tests/\n│   └── Touchstone.Parser.Tests/    # xUnit test suite\n├── examples/\n│   └── Touchstone.Parser.Examples/ # Demo console app\n├── Directory.Build.props            # Centralized build settings\n├── Touchstone.Parser.sln            # Solution file\n└── global.json                      # .NET SDK version\n```\n\n---\n\n## 🔧 Supported Formats\n\n| Feature | Supported |\n|---------|-----------|\n| Touchstone v1.0 / v1.1 | ✅ |\n| 1‑port (`.s1p`) | ✅ |\n| 2‑port (`.s2p`) | ✅ |\n| Multi-port (`.s3p`, `.s4p`, ...) | ✅ |\n| Real-Imaginary (RI) | ✅ |\n| Magnitude-Angle (MA) | ✅ |\n| Decibel-Angle (DB) | ✅ |\n| Hz / kHz / MHz / GHz | ✅ |\n| S / Y / Z / H / G parameters | ✅ |\n| Comments and metadata | ✅ |\n| Touchstone v2.0 keywords | 🔜 Planned |\n\n---\n\n## 🧪 Running Tests\n\n```bash\ndotnet test --verbosity normal\n```\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n---\n\n## 💬 Community\n\n- ⭐ **Star this repo** and related RF/microwave projects to help them grow - then mention your project in context to build visibility.\n- 💡 **Share feedback** via [GitHub Discussions](https://github.com/suryakantamangaraj/touchstone-dotnet/discussions) - we'd love to hear how you're using the library, what's working, and what could be better.\n\n---\n\n## 📄 License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n\n## 💖 Support \u0026 Funding\n\nIf this library helps you in your RF/microwave engineering work, consider supporting its maintenance and the development of new features:\n- **[Sponsor on GitHub](https://github.com/sponsors/suryakantamangaraj)**\n- ⭐ **Star the project** to help it gain visibility in the engineering community.\n\n---\n\n## 📚 Resources\n\n- [Touchstone File Format Specification (IBIS)](https://ibis.org/)\n- [S-parameter — Wikipedia](https://en.wikipedia.org/wiki/Scattering_parameters)\n- [NuGet Package](https://www.nuget.org/packages/Touchstone.Parser)\n\n---\n\n\u003cp align=\"center\"\u003e\n  Made by \u003ca href=\"https://suryaraj.com\"\u003esuryamangaraj\u003c/a\u003e · Built for the RF/microwave engineering community 📡\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuryakantamangaraj%2Ftouchstone-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuryakantamangaraj%2Ftouchstone-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuryakantamangaraj%2Ftouchstone-dotnet/lists"}