Millepede-II V04-17-04
Functions | Variables
readMilleBinary Namespace Reference

Functions

def unpack (typechar, number=1)
 

Variables

 parser
 
 choices
 
 default
 
 help
 
 type
 
 int
 
 action
 
 arg = parser.parse_args()
 
int Cfiles = -1
 
int CFiles = 1
 
 f = open(arg.filename, "rb")
 
 header_words = struct.unpack('ii', f.read(8))
 
int nrec = 0
 
int nr = 0
 
def lenf = struct.unpack('i', f.read(4))
 
def length = unpack('i')
 
string floattype = 'f'
 
def glder = unpack(floattype, nr)
 
def inder = unpack('i', nr)
 
int i = 0
 
int nh = 0
 
int ja = 0
 
int jb = 0
 
int jsp = 0
 
int nsp = 0
 
list lab = []
 
list val = []
 

Function Documentation

◆ unpack()

def readMilleBinary.unpack (   typechar,
  number = 1 
)
unpack a certain number of the input type

We read from the file stored in the variable `f`.

Raises
------
EOFError
    if there is no data returned when the read is done
ValueError
    if data is returned but the length does not match
    the amount of data requested

Arguments
---------
typechar : str
    single-character name of type to unpack: 'i', 'f', or 'd'
number : int, optional
    number of that type to unpack, default one 

Returns
-------
array of input length and type, filled with data unpacked
from file

Definition at line 136 of file readMilleBinary.py.

Variable Documentation

◆ action

readMilleBinary.action

Definition at line 109 of file readMilleBinary.py.

◆ arg

readMilleBinary.arg = parser.parse_args()

Definition at line 112 of file readMilleBinary.py.

◆ Cfiles

int readMilleBinary.Cfiles = -1

Definition at line 117 of file readMilleBinary.py.

◆ CFiles

int readMilleBinary.CFiles = 1

Definition at line 119 of file readMilleBinary.py.

◆ choices

readMilleBinary.choices

Definition at line 100 of file readMilleBinary.py.

◆ default

readMilleBinary.default

Definition at line 100 of file readMilleBinary.py.

◆ f

readMilleBinary.f = open(arg.filename, "rb")

Definition at line 124 of file readMilleBinary.py.

◆ floattype

string readMilleBinary.floattype = 'f'

Definition at line 201 of file readMilleBinary.py.

◆ glder

def readMilleBinary.glder = unpack(floattype, nr)

Definition at line 206 of file readMilleBinary.py.

◆ header_words

readMilleBinary.header_words = struct.unpack('ii', f.read(8))

Definition at line 125 of file readMilleBinary.py.

◆ help

readMilleBinary.help

Definition at line 101 of file readMilleBinary.py.

◆ i

int readMilleBinary.i = 0

◆ inder

def readMilleBinary.inder = unpack('i', nr)

Definition at line 207 of file readMilleBinary.py.

◆ int

readMilleBinary.int

◆ ja

int readMilleBinary.ja = 0

Definition at line 226 of file readMilleBinary.py.

◆ jb

int readMilleBinary.jb = 0

Definition at line 227 of file readMilleBinary.py.

◆ jsp

int readMilleBinary.jsp = 0

Definition at line 228 of file readMilleBinary.py.

◆ lab

list readMilleBinary.lab = []

Definition at line 255 of file readMilleBinary.py.

◆ lenf

def readMilleBinary.lenf = struct.unpack('i', f.read(4))

Definition at line 185 of file readMilleBinary.py.

◆ length

def readMilleBinary.length = unpack('i')

Definition at line 188 of file readMilleBinary.py.

◆ nh

int readMilleBinary.nh = 0

Definition at line 225 of file readMilleBinary.py.

◆ nr

readMilleBinary.nr = 0

Definition at line 183 of file readMilleBinary.py.

◆ nrec

int readMilleBinary.nrec = 0

Definition at line 179 of file readMilleBinary.py.

◆ nsp

readMilleBinary.nsp = 0

Definition at line 229 of file readMilleBinary.py.

◆ parser

readMilleBinary.parser
Initial value:
1= argparse.ArgumentParser(
2 formatter_class=argparse.ArgumentDefaultsHelpFormatter,
3 description='read a mille binary file and print its data'
4 )

Definition at line 96 of file readMilleBinary.py.

◆ type

readMilleBinary.type

◆ val

list readMilleBinary.val = []

Definition at line 256 of file readMilleBinary.py.