Skip to content

Instantly share code, notes, and snippets.

View cardosorapha's full-sized avatar

Raphael Cardoso cardosorapha

  • Ecole Centrale de Lyon
  • Ecully-FR
View GitHub Profile
@snmishra
snmishra / rawread.py
Last active January 22, 2024 10:22
Short python script to read ngspice raw binary files
# MIT license: https://opensource.org/licenses/MIT
# See https://github.com/Isotel/mixedsim/blob/master/python/ngspice_read.py
# for a more complete library. Isotel's version is GPL licensed
from __future__ import division
import numpy as np
BSIZE_SP = 512 # Max size of a line of data; we don't want to read the
# whole file to find a line, in case file does not have
# expected structure.
MDATA_LIST = [b'title', b'date', b'plotname', b'flags', b'no. variables',
b'no. points', b'dimensions', b'command', b'option']