MCPcopy Create free account
hub / github.com/aff3ct/aff3ct / export_as_mat

Method export_as_mat

scripts/debug_parser/aff3ct_debug_parser.py:133–155  ·  view source on GitHub ↗
(self, path, frame_index=None)

Source from the content-addressed store, hash-verified

131 return c_type
132
133 def export_as_mat(self, path, frame_index=None):
134 local_frames = []
135 sck_name = os.path.basename(path)
136
137 for frame in self.frames:
138 local_frame = []
139 for value in frame:
140 if not self.hex_format:
141 if "float" in self.data_format:
142 value = float(value)
143 else:
144 value = int(value)
145 else:
146 if "float" in self.data_format:
147 value = float.fromhex(value)
148 else:
149 value = int(value, 16)
150 if value > 0x7FFFFFFF:
151 value -= 0x100000000
152 local_frame.append(value)
153 local_frames.append(local_frame)
154
155 mat4py.savemat(path + '.mat', dict({sck_name : local_frames}));
156
157
158 def export_as_bin(self, path, frame_index=None):

Callers 1

mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected