Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion openfast_toolbox/io/fast_output_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,8 @@ def freadRowOrderTableBuffered(fid, n, type_in, nCols, nOff=0, type_out='float64
data[:,0] = time
else:
# NOTE: memory expensive due to time conversion, and concatenation
data = (data - ColOff) / ColScl
if FileID != FileFmtID_NoCompressWithoutTime: # uncompressed data are not scaled
data = (data - ColOff) / ColScl
data = np.concatenate([time.reshape(NT, 1), data], 1)

info = {'name': os.path.splitext(os.path.basename(filename))[0],
Expand Down
Binary file not shown.
11 changes: 11 additions & 0 deletions openfast_toolbox/io/tests/test_fast_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ def test_FASTOutBin(self):
except:
pass

def test_FASTOutBin_uncompressed(self):
# Uncompressed binary (FileID 3), written by OpenFAST with OutFileFmt=4
filename = os.path.join(MyDir,'FASTOutBin_ID3.outb')
M = FASTOutputFile(filename).toDataFrame()
np.testing.assert_allclose(M['Time_[s]'].values, [0, 0.025, 0.05, 0.075, 0.1])
# Values from the text output of the same run
np.testing.assert_allclose(M['TwrBsFxt_[kN]'].values, [10.448863, 0.17119217, 8.0563698, -1.2610151, 26.274128], rtol=1e-7)
# Buffered reading gives the same data
M2 = FASTOutputFile(filename, use_buffer=True).toDataFrame()
np.testing.assert_array_equal(M.values, M2.values)

if __name__ == '__main__':
# Test().test_000_debug()
unittest.main()
Loading