MCPcopy Create free account
hub / github.com/NatLabRockies/windtools / read_float

Method read_float

windtools/io/binary.py:101–105  ·  view source on GitHub ↗
(self,N=1,dtype=float)

Source from the content-addressed store, hash-verified

99
100 # float reads
101 def read_float(self,N=1,dtype=float):
102 if N==1:
103 return dtype( self.unpack('f',self.f.read(4))[0] )
104 else:
105 return [ dtype(val) for val in self.unpack('{:d}f'.format(N),self.f.read(N*4))[0:N] ]
106 def read_double(self,N=1):
107 if N==1:
108 return self.unpack('d',self.f.read(8))[0]

Callers 3

read_real4Method · 0.95
read_real8Method · 0.95
_readBTSMethod · 0.80

Calls 2

unpackMethod · 0.95
readMethod · 0.80

Tested by

no test coverage detected