Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dragonman225/ngrp
A Ngspice ASCII rawfile parser written in Javascript.
https://github.com/dragonman225/ngrp
eda eletronics ic-design ngspice spice
Last synced: about 2 months ago
JSON representation
A Ngspice ASCII rawfile parser written in Javascript.
- Host: GitHub
- URL: https://github.com/dragonman225/ngrp
- Owner: dragonman225
- Created: 2019-05-08T20:15:43.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T02:24:18.000Z (almost 3 years ago)
- Last Synced: 2024-10-13T12:05:21.483Z (3 months ago)
- Topics: eda, eletronics, ic-design, ngspice, spice
- Language: JavaScript
- Size: 1010 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ngspice **ASCII** Rawfile Parser
> A Ngspice **ASCII** rawfile parser written in Javascript. Dependent on Node.js.
## Installation
```bash
npm install dragonman225/ngrp
```## Run the Example
```bash
npm run test
```Take a look at `parser.spec.js` in folder `test` to see how it works.
## API
### Instance `parser`
##### `async parser.load(path)`
* Load Ngspice **ASCII** raw file asynchronously.
* To change Ngspice rawfile format to `ascii`, add a line `set filetype=ascii` in your `.spiceinit`.
##### `parser.summarize()`
* Return a summary object of the parsed data.
##### `parser.getResults()`
* Return the parsed data in the following format.
* An array containing all plots (e.g. Operating Points, Transient Analysis). Each plot is an object.
```javascript
[
{
title: String, /* Title. Normally empty. */
date: String, /* Date */
name: String, /* Plotname. Name of the plot. */
flags: String, /* Flags */
nVariables: Integer, /* No. Variables */
nPoints: Integer, /* No. Points */
variables: [
{
index: Integer, /* The index of data values in "Point" array. */
name: String, /* Name of the variable. */
type: String /* Type of the variable, e.g. voltage, current. Ngspice sometimes gives wrong type. */
}
],
values: [
[ Float ] /* An array of float numbers. */
]
}
]
```* Note
For a variable :
```javascript
{
index: 3,
name: "xxx",
type: "yyy"
}
```Data of the variable are `values[0][3]`, `values[1][3]`, ... `values[nPoints-1][3]`.
##### `parser.getResultsCSV()`
* Return CSV strings of all plots.
```javascript
[
String, /* Plot 1 CSV string */
String, /* Plot 2 CSV string */
...
]
```