Skip to content
Merged
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
31 changes: 10 additions & 21 deletions cuvis/Measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,28 +127,17 @@ def set_name(self, name: str) -> None:
self._refresh_metadata()
pass

def get_thumbnail(self):
thumbnail = [val for key, val in self.data.items() if "view" in key]
if len(thumbnail) == 0:
@property
def thumbnail(self):
thumb = [val for key, val in self.data.items() if "view" in key]
if len(thumb) == 0:
print("No thumbnail available. Use cube instead!")
pass
elif len(thumbnail) == 1:
return thumbnail[0]
elif len(thumbnail) > 1:
shapes = [th.array.shape for th in thumbnail]
return thumbnail[shapes.index(min(shapes))]

def get_data_info(self):
return_dict = {}
for att in self.data["IMAGE_info"].__dir__():
if not (att.startswith("__") or att.startswith("this") or att.startswith("_")):
return_dict.update(
{att: self.data["IMAGE_info"].__getattribute__(att)})
try:
return_dict["readout_time"] = str(return_dict["readout_time"])
except:
print("No human readable readout_time available!")
return return_dict
return None
elif len(thumb) == 1:
return thumb[0]
elif len(thumb) > 1:
shapes = [th.array.shape for th in thumb]
return thumb[shapes.index(min(shapes))]

@property
def capabilities(self) -> Capabilities:
Expand Down
2 changes: 1 addition & 1 deletion cuvis/SessionFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_measurement(self, frameNo: int, itemtype: SessionItemType = SessionItemT
def get_reference(self, frameNo: int, reftype: ReferenceType) -> Optional[Measurement]:
_ptr = cuvis_il.new_p_int()
ret = cuvis_il.cuvis_session_file_get_reference_mesu(
self._handle, frameNo, internal.__CuvisSessionItemType__[reftype],
self._handle, frameNo, internal.__CuvisReferenceType__[reftype],
_ptr)
if cuvis_il.status_no_measurement == ret:
return None
Expand Down