Skip to content

FrameW

def () -> None

Class to write frames to a SdifFile

A FrameW is not created directly but is returned by sdiffile.new_frame(...) After creating a new frame, you add matrices via:

framew.add_matrix(signature, numpy_array)

After finishing adding matrices, .write must be called:

framew.write()

Alternatively you can do:

with sdiffile.new_frame(sig, time) as frame:
    frame.add_matrix(matrix_sig, data1) 
    frame.add_matrix(matrix_sig, data2)
    ...

There is no need to call .write in this case


Summary

Property Description
written -
Method Description
add_matrix Add a matrix to this Frame
write Write the current frame to disk.

Attributes

  • written

Methods

add_matrix

FrameW.add_matrix(self, str signature, ndarray data_array)

Add a matrix to this Frame

Args

  • signature (str): the signature of the matrix
  • data_array (numpy.array): the data of the matrix, a 2D array

write

FrameW.write(self)

Write the current frame to disk.

This function is called after add_matrix has been called (if there are any matrices in the current frame). The frame is written all at once.