carputils
Doxygen code documentation for the python framework controlling openCARP
Public Member Functions | List of all members
carputils.carpio.sv.SVFile Class Reference

Read a single state variable (sv) file. More...

Inheritance diagram for carputils.carpio.sv.SVFile:
carputils.carpio.filelike.FileLikeMixin

Public Member Functions

def __init__ (self, filename, dtype, dsize, bigendian, nsamps=None)
 
def close (self)
 Close the file. More...
 
def varname (self)
 Return the variable name, determined from the read file name. More...
 
def dtype (self)
 Return the file data type. More...
 
def data (self)
 Return the sv file contents as a numpy array. More...
 
- Public Member Functions inherited from carputils.carpio.filelike.FileLikeMixin
def __enter__ (self)
 
def __exit__ (self, exc_type, exc_val, exc_tb)
 

Detailed Description

Read a single state variable (sv) file.

It's unlikely that you will want to instantiate this class directly. Correctly reading an sv file requires additional information found in the header file, which is already done by :class:SVSeries.

Parameters
filenamestr The filename to be read
dtypestr The sv-header data type
dsizeint The size, in bytes, of the data type
bigendianbool Whether the file is big endian
nsampsint, optional The number of values in the sv file

Constructor & Destructor Documentation

◆ __init__()

def carputils.carpio.sv.SVFile.__init__ (   self,
  filename,
  dtype,
  dsize,
  bigendian,
  nsamps = None 
)

Member Function Documentation

◆ close()

def carputils.carpio.sv.SVFile.close (   self)

Close the file.

◆ data()

def carputils.carpio.sv.SVFile.data (   self)

Return the sv file contents as a numpy array.

Returns
numpy.ndarray The file data

◆ dtype()

def carputils.carpio.sv.SVFile.dtype (   self)

Return the file data type.

Returns
str The data type name

◆ varname()

def carputils.carpio.sv.SVFile.varname (   self)

Return the variable name, determined from the read file name.

Returns
str The variable name

The documentation for this class was generated from the following file: