pysdic.cordin.get_frames#
- get_frames(root, key='frame', convert_types=True)[source]#
Return the frame acquisition information.
Each
FrameInfoelement is converted into a dictionary containing both its XML attributes and the associated raw image filename.The returned dictionary can be indexed either by frame number or by module number.
- Parameters:
root (xml.etree.ElementTree.Element) – Root element returned by
load_capture_info().key ({“frame”, “module”}, optional (default:
"frame")) –Dictionary indexing strategy.
"frame": keys correspond toFrameNumber."module": keys correspond toModule.
convert_types (bool, optional (default:
True)) – If True, XML attribute values are automatically converted to native Python types (bool,intandfloatwhenever possible). Otherwise, all values remain strings.
- Returns:
Dictionary whose keys are frame numbers or module numbers and whose values are dictionaries containing the acquisition metadata.
- Return type:
Notes
Each frame dictionary additionally contains the
FileNameentry, which corresponds to the text contained in theFileNameXML child node.Examples
Index by frame number
>>> frames = get_frames(root) >>> frames[12]["ExposureTime"]
Index by module number
>>> modules = get_frames(root, key="module") >>> modules[60]["FileName"]